3 ms·
How many programs written in Perl do you think add currency values together, vs. how many sum the harmonic series?
by jzwinck 12y ago
How many programs written in Perl do you think add currency values together, vs. how many sum the harmonic series?
- reikonomusha 12y agoConsider 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.
- smosher_ 12y agoConsidering .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.