You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Chibi implements fl-least as -DBL_MAX (lib/srfi/144/math.stub, line 46), but the SRFI says it should be the smallest positive finite flonum (so it's not -DBL_MAX, but rather DBL_TRUE_MIN).
However: this breaks compatibility with OpenBSD, since DBL_TRUE_MIN isn't there yet.
Using DBL_MIN would discard subnormal numbers which are less than DBL_MIN (and the SRFI recommends DBL_TRUE_MIN).
Maybe relevant:
I see Gauche forces the encoding of a flonum with an ad-hoc procedure,
If you trust that all supported platforms will always use IEEE 754-encoded floating numbers, one way to get DBL_TRUE_MIN is to make a properly-sized (32 or 64-bit) unsigned integer equal to one. That would give you a zero exponent, zero sign bit and a one in the mantissa (which is exactly what DBL_TRUE_MIN should be).
Or you could take DBL_MIN and keep dividing it by 2.0 until it becomes zero. The last non-zero number should be DBL_TRUE_MIN (this is what I think Sagittarius does, and what I have included in a PR for STklos).
Hello,
Chibi implements
fl-least
as-DBL_MAX
(lib/srfi/144/math.stub, line 46), but the SRFI says it should be the smallest positive finite flonum (so it's not-DBL_MAX
, but ratherDBL_TRUE_MIN
).However: this breaks compatibility with OpenBSD, since
DBL_TRUE_MIN
isn't there yet.Using
DBL_MIN
would discard subnormal numbers which are less thanDBL_MIN
(and the SRFI recommendsDBL_TRUE_MIN
).Maybe relevant:
(It's in
ext/scheme/flonum.scm
, line 123)I have used
DBL_TRUE_MIN
in STklos, but it won't compile on OpenBSD.The Chicken egg, srfi-144 seems to use
DBL_TRUE_MIN
also.The text was updated successfully, but these errors were encountered: