Re:How does your programming language handle “minus zero” (-...
by rsj_hn on Friday March 05, 2021 @06:19PM
(#26363537)
This. Floating point numbers, as they are lossy attempts to discretize continuous data, are more complex and usually non-deterministic. They should never be chosen when a non-lossy representation is available for the problem domain.
Re:How does your programming language handle “minus zero” (-...
by OneWingedShark on Friday March 05, 2021 @06:55PM
(#26363844)
laughs in Ada
-- IEEE754/64-bits: Interfaces.IEEE_Float_64
-- And here we strip out non-numeric values.
Use Interfaces;
Subtype Numeric_Real is IEEE_Float_64 range IEEE_Float_64'Range;
Done.
NaNs/infs are particularly vicious, as they propagate through computations.