diff options
author | Vagrant Cascadian <[email protected]> | 2023-05-12 16:18:18 -0700 |
---|---|---|
committer | Liliana Marie Prikler <[email protected]> | 2023-07-09 07:31:36 +0200 |
commit | 4c610d2b2e700a8aca6d5aba344e0dabad386467 (patch) | |
tree | e762b7ce4505d0ce2383d1515564a120455ab785 /gnu/packages/patches/fuzzylite-soften-float-equality.patch | |
parent | 1f42ba3533b1183062c5e97bd8fbe704d88b4312 (diff) |
gnu: Add fuzzylite.
* gnu/packages/games.scm (fuzzylite): New variable.
* gnu/packages/patches/fuzzylite-relative-path-in-tests.patch: New file.
* gnu/packages/patches/fuzzylite-use-catch2.patch: New file.
* gnu/packages/patches/fuzzylite-soften-float-equality.patch: New file.
* gnu/local.mk (dist_patch_DATA): Register them here.
Signed-off-by: Liliana Marie Prikler <[email protected]>
Diffstat (limited to 'gnu/packages/patches/fuzzylite-soften-float-equality.patch')
-rw-r--r-- | gnu/packages/patches/fuzzylite-soften-float-equality.patch | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/gnu/packages/patches/fuzzylite-soften-float-equality.patch b/gnu/packages/patches/fuzzylite-soften-float-equality.patch new file mode 100644 index 0000000000..47403605dd --- /dev/null +++ b/gnu/packages/patches/fuzzylite-soften-float-equality.patch @@ -0,0 +1,30 @@ +Origin: https://salsa.debian.org/debian/fuzzylite/-/blob/debian/6.0+dfsg-6/debian/patches/when-testing-large-float-numbers-for-equ.patch +From: Johannes 'josch' Schauer <[email protected]> +Date: Sun, 3 Feb 2019 10:33:22 +0100 +X-Dgit-Generated: 6.0+dfsg-2 80960ae38da9db032dfbfec6405398653e8205ff +Subject: when testing large float numbers for equality, use a larger epsilon + + +--- + +--- fuzzylite-6.0+dfsg.orig/fuzzylite/test/BenchmarkTest.cpp ++++ fuzzylite-6.0+dfsg/fuzzylite/test/BenchmarkTest.cpp +@@ -96,7 +96,17 @@ namespace fl { + CHECK(Op::isEq(1.0, Benchmark::convert(1000.0, Benchmark::MilliSeconds, Benchmark::Seconds))); + FL_LOG(Benchmark::convert(1000.0, Benchmark::MilliSeconds, Benchmark::Seconds)); + +- CHECK(Op::isEq(35e9, Benchmark::convert(35, Benchmark::Seconds, Benchmark::NanoSeconds))); ++ scalar eps = ++#ifndef __i386__ ++ fuzzylite::macheps(); ++#else ++ // on i386, due to the 80bit x87 register, double floating point ++ // numbers are handled differently and thus the difference between ++ // 35e9 and the result of Benchmark::convert() will be 2.179e-6, ++ // which is greater than the default epsilon of 1e-6. ++ 1e-5; ++#endif ++ CHECK(Op::isEq(35e9, Benchmark::convert(35, Benchmark::Seconds, Benchmark::NanoSeconds), eps)); + CHECK(Op::isEq(35, Benchmark::convert(35e9, Benchmark::NanoSeconds, Benchmark::Seconds))); + } + |