Make no-float policy explicit #684

pull real-or-random wants to merge 1 commits into bitcoin-core:master from real-or-random:real-or-random-patch-2 changing 1 files +1 −0
  1. real-or-random commented at 9:41 AM on November 1, 2019: contributor

    We don't want floating types for various reasons, e.g.,

    • Their representation and often their behavior is implementation-defined.
    • Many targets don't support them.

    Closes #683.

  2. Make no-float policy explicit
    We don't want floating types for various reasons, e.g.,
     - Their representation and often their behavior is implementation-defined.
     - Many targets don't support them.
    bae1bea3c4
  3. laanwj commented at 9:44 AM on November 1, 2019: member

    ACK

  4. jonasnick commented at 10:17 AM on November 1, 2019: contributor

    ACK bae1bea3c4b46a2fb5ca76ff6bf1e98d43cff52f

  5. jonasnick referenced this in commit e2625f8a98 on Nov 1, 2019
  6. jonasnick merged this on Nov 1, 2019
  7. jonasnick closed this on Nov 1, 2019

  8. real-or-random deleted the branch on Nov 1, 2019
  9. gmaxwell commented at 5:59 AM on November 4, 2019: contributor

    After the fact ACK.

    One thing to keep in mind WRT benchmarks, is that it's my experience that many embedded developers look at a library and if they see ANY float at all they'll instantly just report up the chain "nope, can't be ported, uses floating point". ... even if that float is some build time optional thing.

    [I find they do the same for malloc/free and file I/O too.]

    The explicit statement in the readme is probably good enough, but if you encounter this thinking don't be too surprised by it.

  10. laanwj commented at 10:57 AM on November 5, 2019: member

    One thing to keep in mind WRT benchmarks, is that it's my experience that many embedded developers look at a library and if they see ANY float at all they'll instantly just report up the chain "nope, can't be ported, uses floating point".

    This is the only use of double in the bench framework.

    src/bench.h:static double gettimedouble(void) {
    src/bench.h:void print_number(double x) {
    src/bench.h:    double y = x;
    src/bench.h:    double min = HUGE_VAL;
    src/bench.h:    double sum = 0.0;
    src/bench.h:    double max = 0.0;
    src/bench.h:        double begin, total;
    src/bench.h:        begin = gettimedouble();
    src/bench.h:        total = gettimedouble() - begin;
    

    It'd be pretty straightforward to change this to use 64 bit microseconds instead, and get rid of the exception. I might have a stab at it.

  11. sipa cross-referenced this on Jun 9, 2020 from issue Update libsecp256k1 subtree by sipa
  12. fanquake referenced this in commit 8c97780db8 on Jun 13, 2020
  13. sidhujag referenced this in commit 8a3a072968 on Jun 13, 2020
  14. ComputerCraftr referenced this in commit b98f1c6e6c on Jun 16, 2020
  15. UdjinM6 referenced this in commit 9d36ba6570 on Aug 10, 2021
  16. 5tefan referenced this in commit 8ded2caa74 on Aug 12, 2021
  17. gades referenced this in commit d855cc511d on May 8, 2022

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin-core/secp256k1. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-14 21:15 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me