Re:A little thing to love about Perl 6 and COBOL
by reikonomusha on Thursday February 05, 2015 @04:34AM
(#9002391)
Consider computing compound interest using rationals. That's a practical thing that could happen akin to harmonic series calculation, where you'll get absurdly large rationals.
[ Parent
| on HN ]
Re:A little thing to love about Perl 6 and COBOL
by smosher_ on Thursday February 05, 2015 @07:09AM
(#9002795)
Considering .exp results in a Num, not a Rat, there's no problem here. I seem to recall this working sensibly years ago, where numerical types would coerce in sensible manner. Same happens with large denominators, so even if you roll your own successive approximation it will coerce away from Rat before things get out of hand.