Hacker News new | ask | show | jobs
by dpkendal 3876 days ago
Perl 6 uses rationals by default. They have the advantages of being base-agnostic, able to accurately represent any recurring digit expansion accurately regardless of eventual base, and also faster (since, especially if you normalize (convert to lowest terms) lazily, most operations are just a few integer instructions with no branching, looping, or bit-twiddling involved).
1 comments

True. Also notice that if the user wants a floating point, the literal format is the one with the e<exponent> suffix:

    0.1e0, 1e-1, 0.2e0, 2e-1 etc.