2 ms·
You completely miss the point twice over. The REPL example intends to show what the program does, not whether or not something is intuitive for you. Second, u
by emil-lp 1y ago
You completely miss the point twice over.
The REPL example intends to show what the program does, not whether or not something is intuitive for you.
Second, using your same argumentation,
>>> 010 + 006 == 14
True
Is also wrong.
It's based on a misunderstanding of what representations of numbers in programming languages are.
In Python (and almost all other languages), 0.1 means the IEEE float closest to the decimal number 0.1, and arithmetic operations are performed according to the IEEE standard.
- librasteve 1y agoI am not “missing the point”, I am disagreeing with you. (Hopefully in an agreeable way) I am making the point that using a decimal literal (eg 0.1) representation for a IEEE double is a bad choice and that using it as a representation for a Rat (aka Fraction) is a better choice. I 100% accept your point that in Python 0.1+0.2>0.3 is true which is why I prefer Raku’s number system.