Skip to content

Universal v5.16.0

Choose a tag to compare

@github-actions github-actions released this 14 Nov 02:16
· 45 commits to main since this release
100de17

[5.16.0] - 2026-11-14

Behaviour changes

  • numeric: faithful finite / +-inf is now a signed zero instead of NaN, a -0 result keeps its sign (-0 * 1 is -0, x / -0 is -inf for positive x), and pow with a negative integer exponent whose positive power overflows returns the underflowed (zero or subnormal) result instead of NaN (#1974)
  • rational: rational parse() and operator>> now accept the type's most negative integer (-128 in rational<8>, -32768 in rational<16>), which they rejected (#1976)
  • interval: interval sqrt of a fully negative interval is the empty interval (NaN bounds) with EDOM instead of [0, NaN]; mid() and double() of [-inf, +inf] are 0 and of a half-bounded interval the finite extreme instead of NaN or inf; the empty interval compares false under <= and >=, hull(empty, x) is x and intersect(x, empty) is empty; odd powers are [lo^n, hi^n] (tighter across zero); operator>> sets failbit and leaves the target unchanged on malformed input (#1979)
  • areal: areal conversions from float, double and integers set the ubit when they drop bits into a subnormal target or from an integer above 2^53 (they returned an exact-marked truncation), and areal<a,b>(areal<c,d>) converts the value instead of leaving the result uninitialized (#1982)
  • areal: areal addition, multiplication and division of subnormal operands in configurations with 61 or more fraction bits (such as areal<72,4>) now return the correct value; the operand was read as 1.f and the result was wrong (#1982)
  • areal: numeric_limits reports the encoding's limits (min() is the smallest normal value instead of minpos, denorm_min() minpos instead of 1, epsilon() 2^-fbits instead of 0, digits fbits + 1 instead of counting the ubit, IEEE-convention exponents, has_denorm present, is_bounded true); abs(areal) compiles; fma marks its result inexact when an input is (#1983)
  • sorn: sorn operator!= compares values (it was always false) and operator== exists (#1985)
  • sorn: double(sorn)/float(sorn) return the interval midpoint instead of 0 (#1985)
  • sorn: printing a const sorn or a temporary prints its value, not the lattice range (#1985)
  • sorn: sorn NaN assignment gives NaN, out-of-range values saturate, and NaN operands propagate (#1985)
  • sorn: sorn multiplication keeps an attained zero bound closed and no longer turns 0 * inf bounds into NaN (#1985)
  • edecimal: edecimal -x % y with an exact division, -edecimal(0) and edecimal(0) << k now give +0, which compares equal to edecimal(0) (#1992)
  • edecimal: edecimal from a NaN or infinite float/double is now 0 instead of a large garbage value (#1992)
  • erational: erational ++ and -- now add/subtract one (1/2 ++ is 3/2, was 2/2) (#1993)
  • erational: erational zero results are +0: 0 * -3 and 0 / -3 print 0/1 and convert to +0.0 (were -0/1 and -0.0) (#1993)
  • erational: erational::toPair() returns the sign on the numerator and saturates to INT64_MIN/INT64_MAX (was the magnitude, wrapping) (#1993)
  • erational: erational from a NaN or +/-inf float/double/long double is now NaN (0/0), was 0 (#1993)
  • einteger: einteger parse() rejects more than one leading sign ("--5", "-+0x5"), which used to parse with radix-dependent signs (#1995)
  • einteger: einteger parse() leaves the destination unchanged on failure instead of setting it to 0 (#1995)
  • einteger: einteger a >>= -k now shifts left by k (was right by k) (#1994)
  • einteger: einteger conversion to float/double/long double is now correctly rounded; values above 2^24 (float) or 2^53 (double) can differ in the last bit from before (#1994)
  • sorn: std::numeric_limits<sorn<...>> min(), max(), lowest(), denorm_min(), round_error(), the digit and exponent constants, has_infinity, has_quiet_NaN, is_signed and round_style now describe the lattice instead of placeholder values (#2000)
  • elreal: elreal iszero/sign/scale/abs/signbit/significand read the first nonzero block, so cancelled values are zero and a leading zero block no longer gives the wrong sign; integer construction is exact; the math functions return C99 special values for NaN, inf and out-of-domain arguments; pow changes for negative and zero bases and for exponents near an integer (#2013)
  • ereal: ereal math functions return C99 Annex F special values (sqrt(-1) and sqrt(-inf) are NaN; sqrt(+inf), log(+inf), asinh(+inf) and acosh(+inf) are +inf; atanh(+-1) is +-inf; pow and atan2 follow the C99 tables; hypot(inf, NaN) is inf) and keep the sign of zero (sin, tan, asin, atan, sinh, tanh, asinh, atanh, expm1, log1p, cbrt, floor, ceil, trunc, round, rint, modf, fmod and remainder); copysign reads the sign bit; fmod(x, 0) and remainder(x, 0) return NaN instead of throwing, fmod(x, +-inf) is x, and both are exact for any quotient; hypot no longer overflows in its squares; sqrt is exact on perfect squares and differs in the last limbs otherwise (#2018)
  • ereal: ereal comparisons with a NaN operand are false (!= true) where ==, >= and <= returned true; ereal min/max ignore a NaN operand (C99 fmin/fmax) whatever the argument order; ereal signbit(-0) is true, abs(-0) is +0 and -0 prints with its sign; numeric_limits<ereal<N, F>>::min() is 2^(min_exponent(F) - 1 + digits(F) (N - 1)) (2^-651 for ereal<8>, was 2^-969 for every N), min_exponent follows it, has_denorm is denorm_present and denorm_min() is minpos(); ereal parse of a decimal exponent beyond int saturates to inf or 0; ereal fixed-format to_string rounds values below 10^-p and keeps the last digit after a carry; efloat to_string prints the extreme values with a 64-bit exponent and its last digits can differ for large exponents (now exact); efloat parse of exponents beyond about +-13000 returns the value (was NaN and false), and 0eN is a signed zero (#2020)
  • sorn conversions from double, long double and wide integers enclose the input (sorn(1e-300) is (0, 0.5], was exact 0), scalar sorn operators round their bounds outward and open a rounded bound, float(sorn) of a wide interval is its midpoint, and zero sorn * inf is 0; sorn<..., _halfopen = false> no longer compiles; einteger compound operators with a NaN, inf or |x| >= 2^63 floating-point operand use einteger(x) (NaN and inf are 0) instead of an undefined long long conversion; einteger parse rejects a 0x or 0b prefix with no digits ("0x'"); areal fma of an exact zero product is exact, fma marks a sum the double intermediate rounded as inexact, and numeric_limits::signaling_NaN() is a signaling NaN; areal<72,8,uint32_t> multiplication is correct (#2024)
  • quire: quire, quire and quire now resolve a sum with an infinite term and no NaN to that signed infinity instead of NaN; quire::isinf() and isnan() no longer both report every non-finite state (#2025)
  • ereal: ereal sin/cos/tan of large arguments and erf/erfc/tgamma/lgamma now return values correct to the configuration's precision instead of to about 53 bits (and, for sin/cos/tan past about 1e100 at ereal<4>, instead of wrong values) (#2027)
  • math: complex, complex, complex
    and complex abs, arg and transcendentals now return values at the element type's precision instead of double's; abs on the double path uses std::hypot (#2030)
  • dd: dd and qd arithmetic, sin/tan/log1p/expm1/sqrt and conversions to native floats now give zero results the IEEE 754 sign (e.g. +0 * -1 is -0, sin(-0) is -0, double(dd(-0.0)) is -0); dd and qd atan2 now return correct values for arguments whose squares leave the double range (#2034)
  • sorn: sorn + - * / sorn and scalar / sorn can return a wider interval (one more lattice interval at a bound) where the exact bound is not a float; the result now encloses the exact one (#2037)
  • internal: blockbinary Unsigned / and % at nbits == limb width, and arithmetic >>= by nbits or more on a negative value, now return the correct results; blocktriple comparisons follow IEEE-754 (NaN unordered, +0 == -0) and a MUL/DIV blocktriple built from a native value has the operand layout mul()/div() consume (#2055)
  • numeric: ereal fmod/remainder of multi-limb operands are now exact; floatcascade<3>/<4> division gains full precision and x / +0 is +inf; elreal conversion past double's range is +-inf instead of NaN; sorn arithmetic past the ends of a lattice without infinity saturates; a float or double assigned to a native quire keeps its last significand bit; expansion_ops fast_expansion_sum, scale_expansion, compress_expansion and expansion_quotient special cases changed (#2056)
  • internal: value arithmetic, rounding and special values now follow IEEE-754 (sums were wrong for every input; x / 0 is inf; infinities keep their sign; round_to rounds to nearest even); blockdecimal BID wraps modulo 10^ndigits; the internal gfp and f2s types are archived (#2057)

Added

  • Add a precision table for floating point formats useful in DSP, Control, and HPC (#1968) by @Ravenwater
  • valid: Join the ubox trace, with an exact oracle for sqrt (#1997) by @Ravenwater
  • fixpnt: Circular CORDIC engine for sin, cos, atan, atan2 and hypot (#2038) by @Ravenwater
  • fixpnt: Linear CORDIC for multiply and divide, on a unified CORDIC core (#2043) by @Ravenwater
  • fixpnt: Hyperbolic CORDIC for exp, log, sqrt and the hyperbolic functions, and tan (#2044) by @Ravenwater
  • dfixpnt: Decimal CORDIC for sin, cos, atan, atan2 and hypot (#2045) by @Ravenwater
  • lns: CORDICDatapathAddSub, lns add/sub on the fixpnt hyperbolic CORDIC datapath (#2048) by @Ravenwater

Build System

CI/CD

Documentation

  • Fill in the CHANGELOG for v5.2.0 through v5.15.0 (#1966) by @Ravenwater
  • integer: Restore two comments mangled by the throw_or_abort rewrite (#1977) by @Ravenwater
  • Record the two QA sweeps of 2026-11-06/08 and fill in Unreleased (#1998) by @Ravenwater
  • qd_cascade: Record that clang 21 no longer loses on the add_cascades<4> merge (#2002) by @Ravenwater
  • math: Branch cuts, signed zeros and C99 Annex G for complex (#2031) by @Ravenwater
  • Record the elastic reals sweep and the CORDIC family, and fill in Unreleased (#2049) by @Ravenwater
  • Prepare the v5.16.0 release (#2061) by @Ravenwater

Fixed

  • Replace the non-ASCII epsilon in playground/precision_table.cpp (#1975) by @Ravenwater
  • numeric: Faithful divides by infinity, keeps -0, and pow underflows (#1974) by @Ravenwater
  • rational: Parse the most negative value (#1976) by @Ravenwater
  • interval: Enclose subnormal square roots and handle unbounded and empty intervals (#1979) by @Ravenwater
  • areal: Set the ubit wherever a conversion drops bits, and convert between configurations (#1982) by @Ravenwater
  • faithful: Adding missing to_binary and print format (#1981) by @Ravenwater
  • areal: Numeric_limits from the encoding, a callable abs, fma ubits, and the ubit's promise (#1983) by @Ravenwater
  • sorn: Comparison, to_native, NaN, SpecificValue, const operators and division (#1985) by @Ravenwater
  • edecimal: One form of zero, NaN/inf conversion to 0, and single-step shifts (#1992) by @Ravenwater
  • erational: ++/-- as values, x /= x aliasing, no -0, signed toPair, NaN/inf to NaN (#1993) by @Ravenwater
  • einteger: One optional sign in parse, unchanged value on failure, chunked decimal parse (#1995) by @Ravenwater
  • einteger: Negative shift direction, +0 after >>=, round-once float conversion, any native operand (#1994) by @Ravenwater
  • numeric: Settle the #1991 sweep follow-ups: expansion copy, dbns bound, interval and areal tests (#1996) by @Ravenwater
  • sorn: Derive numeric_limits from the lattice (#2000) by @Ravenwater
  • elreal: Zero and sign of cancelled values, C99 special values, pow and exp range (#2013) by @Ravenwater
  • ereal: C99 special values, exact fmod, and math tests checked to the type's precision (#2018) by @Ravenwater
  • ereal: NaN comparisons, signed zero, numeric_limits floor, and efloat print/parse at the exponent extremes (#2020) by @Ravenwater
  • Sorn enclosure, einteger operands and parse, areal fma, and QA sweep test follow-ups (#2024) by @Ravenwater
  • quire: Keep signed infinities apart from NaN in the generalized quire (#2025) by @Ravenwater
  • ereal: Payne-Hanek reduction for sin/cos/tan, and erf/erfc/tgamma/lgamma in ereal arithmetic (#2027) by @Ravenwater
  • math: Compute complex abs, arg and the transcendentals in T for high-precision types (#2030) by @Ravenwater
  • dd: Keep the sign of zero and atan2's range in dd and qd; fix stale complex CMake gates (#2034) by @Ravenwater
  • areal: Exact references for the level 2-4 addition, subtraction and integer tests (#2035) by @Ravenwater
  • efloat: Make the allocation-counting tests immune to gcc 15 folding the counter (#2036) by @Ravenwater
  • sorn: Round the sorn-with-sorn bounds and the reciprocal outward (#2037) by @Ravenwater
  • internal: Blocktriple, blockbinary, blockfraction and blocksignificand conversion, comparison, division and shift defects (#2055) by @Ravenwater
  • numeric: Exact ereal remainder, elreal past double range, sorn saturation, floatcascade division, expansion_ops sums and native quire assignment (#2056) by @Ravenwater
  • internal: Value arithmetic and special values, bitblock helpers, abstract triple, blockdecimal/blockdigit edges; archive gfp/f2s (#2057) by @Ravenwater

Performance

  • dbns: Search wide windows of the second base exponent in O(log) steps (#1978) by @Ravenwater
  • numeric: Keep faithful's exact expansion in an inline buffer (#1980) by @Ravenwater