News for hackers. Stuff that matters.
Re:0.30000000000000004 by umanwizard on Monday December 02, 2019 @04:32PM (#21687202)
FWIW, both of those can be expressed exactly by floating-point numbers ;)
Re:0.30000000000000004 by dang on Monday December 02, 2019 @05:53PM (#21687950)
Whew. I almost put some non-zeros in there.
Re:0.30000000000000004 by IshKebab on Monday December 02, 2019 @05:06PM (#21687558)
Right all integers up to 2^53 (or something like that) can be (in double precision).

I assume that's the reason they made the mantissa linear, even though having the whole thing logarithmic makes more sense.

Re:0.30000000000000004 by Iburinoc on Monday December 02, 2019 @05:38PM (#21687859)
Addition/subtraction are also much simpler/cheaper than they would be in an entirely logarithmic model. If floats were just 2^x with some 64 bit fixed point x, it's not clear to me how to do addition efficiently.
Re:0.30000000000000004 by nine_k on Monday December 02, 2019 @09:33PM (#21689407)
What. Mantissa is already logarithmic, bit number n has value 2^(n - N-1) for an N-bit mantissa.

This is how positional number systems work at all.

Re:0.30000000000000004 by IshKebab on Wednesday December 04, 2019 @04:13PM (#21707059)
The mantissa is linear. It's unrelated to how positional number systems work. A floating point value is split into two numbers - the exponent and the mantissa. Normally they are used to represent a final number like:

    x = 2^e * (1 + m)
Where e is the exponent and m is the mantissa (varying linearly from 0 to 1).

But you could have a fully exponential number format:

    x = 2^(m + o)
As pointed out though, it makes addition much more complicated, you can't exactly represent integers, and someone told me it makes quantisation noise worse too. Bad idea.