Commit Graph

6 Commits

Author SHA1 Message Date
Sylvain PILLOT 406cc3739e Resync with last Azur update 2023-05-13 11:28:27 +02:00
Lephenixnoir 1d8851cbf5
libnum: add experimental string representation
Currently only has hand-picked tests and very rough code, but it's a
start. In the future, I want to have better tests, more
options like printf's %e/%f/%g, and more versatile methods.
2022-08-07 11:32:57 +02:00
Lephenixnoir 10cf9951a0
libnum: rename the namespace [num] -> [libnum]
The first name would make `num` on its own ambiguous when using the
namespace.
2022-08-01 23:01:35 +01:00
Lephenixnoir 708ba1b017
libnum: unit tests, perf tests for num16, double limits
* Add a unit testing framework in libnum/test/. Assertions are checked
  against sparse sets of input values (a couple thousands for each
  type), distributed fractally.
* Add performance tests for num16.
* Fix an overly ambitious substitution of /256 by >>8 in num16::mul,
  which would give some incorrect results for negative results.
* Also fix an incorrect sign extension in the num16->num32 conversion.
* Express comparison-with-int operators in terms of the integer even
  though some versions are faster when expressed in terms of the fixed-
  point value. This is because the integer is frequently known at
  compile-time.
* Add minDouble and maxDouble static members to each num type to
  programmatically supply the bounds of the type.
2022-07-24 00:05:41 +01:00
Lephenixnoir d77c7fef78
libnum: add num8/num16 comparisons with integers and some tests 2022-07-19 23:12:23 +01:00
Lephenixnoir bf5db2a0f0
libnum: initial commit 2022-06-02 21:18:28 +01:00