5 ms·
That’s only formatting. The other (and more important) matter, — that is not even mentioned, — is comparison. E. g. in “rational by default in this specific c
by lelf 7y ago
That’s only formatting.
The other (and more important) matter, — that is not even mentioned, — is comparison. E. g. in “rational by default in this specific case” languages (Perl 6),
> 0.1+0.2==0.3
True
Or, APL (now they are floats there! But comparison is special)
0.1+0.2
0.3
⎕PP←20 ⋄ 0.1+0.2
0.30000000000000004
(0.1+0.2) ≡ 0.3
1
- Athas 7y agoExactly what are the rules for the "special comparison" in APL? That sounds horrifying to me.
- lizmat 7y agoPlease note that Perl 6 has been renamed to "Raku" (https://raku.org https://raku.org using #rakulang as a tag for social media). In Raku, the comparison operator is basically a subroutine that uses multiple dispatch to select the correct candidate for handling comparisons between Rat's and other numeric objects.