News for hackers. Stuff that matters.
Re:Beware of Fast-Math by knert on Saturday May 31, 2025 @09:56AM (#44144315)
How do you store negative numbers?
Re:Beware of Fast-Math by psychoslave on Saturday May 31, 2025 @09:59AM (#44144329)
Maybe as in accounting, one column for benefits, one for debts?
Re:Beware of Fast-Math by MobiusHorizons on Saturday May 31, 2025 @11:17AM (#44144819)
You use a signed integer type, so you just store a negative number.

You can think of fixed point as equivalent to ieee754 floats with a fixed exponent and a two’s complement mantissa instead of a sign bit.