Safe addition: Difference between revisions
m
→{{header|Raku}}: Fix comment and code: Perl 6 --> Raku
Thundergnat (talk | contribs) (Rename Perl 6 -> Raku, alphabetize, minor clean-up) |
SqrtNegInf (talk | contribs) m (→{{header|Raku}}: Fix comment and code: Perl 6 --> Raku) |
||
Line 765:
{{works with|Rakudo|2018.12}}
of accuracy. If you insist on using floats your answer will be accurate in the range
± 1.1102230246251565e-16.
an exact stringified float with more than 15 digits of accuracy. It automatically
rounds since it doesn't try to pretend that it is more accurate than that.
If you really DO need very high precision and accuracy,
built-in Rational number support. Rationals are the ratio of two integers, and
are always exact. Standard Rats are limited to 64 bits of precision in the
Line 816:
use Rat::Precise; # module loading is scoped to the enclosing block
my $rat = 1.5**63;
say "\
say "\nRat::Precise stringification for 1.5**63:\n" ~$rat.precise; # full precision
}</lang>
Line 835:
Use a module to get full precision.
124093581919.64894769782737365038
|