Re:How does your programming language handle “minus zero” (-...
by zokier on Friday March 05, 2021 @12:47PM
(#26359639)
IEEE 754 does also specify operations and their behavior. E.g. section 5.1 (from 2008 edition):
> All conforming implementations of this standard shall provide the operations listed in this clause for all supported arithmetic formats, except as stated below. Each of the computational operations that return a numeric result specified by this standard shall be performed as if it first produced an intermediate result correct to infinite precision and with unbounded range, and then rounded that intermediate result, if necessary, to fit in the destination’s format (see 4 and 7).
Re:How does your programming language handle “minus zero” (-...
by quelsolaar on Friday March 05, 2021 @04:10PM
(#26362162)
Well the fact is that different hardware rounds it differently, so its the world we live in. My guess is that actually implementing something in hardware " to infinite precision and with unbounded range" might not be realistic.
A separate, complicating factor is that floating point math often don't yield the same results with different levels of optimization turned on. The reason to use integer math for games is because you want it to be deterministic so can be an issue.