in reply to Re^3: Behaviour of int() unexpected
in thread Behaviour of int() unexpected
So, a number like 23.676767676767 might be represented as m = 2367 e = -2 r = 2 where r tells us to repeat the last two digits to infinity. Or 1/3 would be stored as m = 3 e = -1 r = 1
In a 64-bit variable, it would be 4 bits for r, 10 bits for e, and 48 bits for m. Then there would be one bit for mantissa's sign and another bit for exponent's sign. Total 64 bits.
Mantissa would go from -281474976710656 to +281474976710656
Exp would go from -1024 to +1024
Rep would go from 0 to 15
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^5: Behaviour of int() unexpected
by LanX (Saint) on Mar 11, 2025 at 03:59 UTC | |
by syphilis (Archbishop) on Mar 11, 2025 at 10:06 UTC | |
by LanX (Saint) on Mar 13, 2025 at 03:30 UTC | |
Re^5: Behaviour of int() unexpected
by ikegami (Patriarch) on Mar 11, 2025 at 03:25 UTC |