News for hackers. Stuff that matters.
Re:One does not simply calculate the absolute value by pm215 on Sunday August 22, 2021 @04:09PM (#28269105)
It's the required semantics of the IEEE floating point spec's absolute-value operation. This does mean that abs() doesn't behave like eg addition in that it won't set fp exception flags for signaling NaNs, or canonicalize NaNs, or set a flag to note that this was a denormal number. But at the language level "follows IEEE semantics" is probably overall less surprising.

chs() ("flip the sign bit") is the other operation that's defined as effectively just an operation on the representation rather than a "do a real floating point computation".

There are no comments on this comment yet.