3 ms·
Waaaay less magic than Javascript. Looks like the rules are described here. Two kinds of numbers: exact and rough. Unless you use trig functions it will all be
by justinpombrio 5y ago
Waaaay less magic than Javascript. Looks like the rules are described here. Two kinds of numbers: exact and rough. Unless you use trig functions it will all be exact. https://www.pyret.org/docs/latest/numbers.html https://www.pyret.org/docs/latest/numbers.html
Fun fact about Javascript: there are string and number constants x, y, and z, such that `x < y` and `y < z` and `z < x`. No NaN shenanigans, just regular small strings and numbers. Hint: it involves a string containing digits that starts with "0", thus sometimes getting implicitly coerced to octal.
Think about what this means for sorting!