in reply to Re: Behaviour of int() unexpected
in thread Behaviour of int() unexpected
Interesting. To me, this makes no sense at all. Up to this point, I belived that a float point value such as 8.95 is stored as a plain integer like 895 along with an exponent which is -2. So, to turn that into the original number, you print "895" and then move the decimal point to the left by two spaces. But that's apparently not how it's done. But this would be the most logical way to encode a float number if you ask me.
Convert 8.95 to 8.9499999999999992894572642399 and store it like that. Who came up with this "standard" and WHY?????
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Behaviour of int() unexpected
by ikegami (Patriarch) on Mar 11, 2025 at 00:41 UTC | |
by harangzsolt33 (Deacon) on Mar 11, 2025 at 02:41 UTC | |
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 | |
by ikegami (Patriarch) on Mar 11, 2025 at 03:25 UTC | |
|
Re^3: Behaviour of int() unexpected
by syphilis (Archbishop) on Mar 11, 2025 at 03:30 UTC | |
|
Re^3: Behaviour of int() unexpected
by LanX (Saint) on Mar 11, 2025 at 03:48 UTC | |
by cavac (Prior) on Mar 13, 2025 at 15:27 UTC | |
by LanX (Saint) on Mar 13, 2025 at 20:25 UTC | |
by cavac (Prior) on Mar 14, 2025 at 07:36 UTC |