top | item 10559391

(no title)

dpkendal | 10 years 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).

discuss

order

grondilu|10 years ago

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.