Skip to content

Version 6.0.0: Internal refactoring, accuracy improvements, bug fixes

Compare
Choose a tag to compare
@eyalroz eyalroz released this 11 Feb 09:31
· 51 commits to master since this release

Changes since v5.3.0:

Bug fixes

  • #95 : Now always including <limits.h> (which we need)
  • #114 : Fixed a bug exposed by other changes in these versions, with slightly-sub-normal numbers such as 1e-308.
  • #115 : Now "playing it safe" with powers close to the extremal ones (-307 to 308 for double) w.r.t. precision - sacrificing some accuracy to ensure we don't exceed representation range.
  • #121 : %#b no longer exceeding the specified width by 1 in some cases.
  • #122 : Now properly respecting the PRINTF_DECIMAL_BUFFER_SIZE preprocessor flag (and the corresponding CMake option).

Build configuration

  • #76: Now helping library users prevent gcc and clang from substituting their builtins for our standard-library-aliasing functions (using PUBLIC compilation flag -fno-builtin-printf for the library's CMake target; if you don't use CMake - make sure to do that yourself).
  • Now building with the -Wconversion flag.
  • Can now set the number of terms in the Taylor series expansion used in computing the base-10 logarithm

Other changes

  • #109: Better rounding-down of the computed base-10 exponent.
  • Added some precision to the constants in the Taylor series expansion of ln(x)/ln(10) in the base-10 logarithm computation - improving accuracy slightly.
  • #113: Added support for using more Taylor series terms in the base-10 logarithm computation.
  • README.md updates.
  • Now using GitHub actions to build the library and run the tests! :-)
  • #32: Now using a convenient uniform gadget for the inner implementation for all library functions. This is a significant internal refactoring of the code.
  • #105: Making all potentially-value-altering conversions explicit
  • Copyright & attribution text fixup.
  • Factored out the code computing a power-of-10 and a base-10-logarithm into their own functions
  • More comments about what we're doing, especially algorithmically.

Testing code

  • #111: Test suite now properly respects printf_config.h
  • Split the "float" testcase into several cases regarding float-point specifiers.
  • Added a few testcases with non-numeric floating-point values and the E specifier.
  • Added more warning-disabling where appropriate
  • Remove a duplicated non-standard test
  • #112: Test suite now accounts for the value of PRINTF_MAX_INTEGRAL_DIGITS_FOR_DECIMAL when deciding what to expect
  • Increased visibility of failures within the loops over larger ranges of floating-point values in the test suite.
  • Added an "precision latter" sequence of testcases to see when we start introducing errors due to our approximation shortcuts.
  • Some refactoring of the test suite code.

Caveats

  • Still no special handling for denormals.