On Fri Apr 30 07:57:00 2010, bbkr wrote: > This returns NAN now (in my case on 1024th operation) > > > perl6 -e 'my $d = 2; my $p = 1; for 1..1024 { print "operation $_: "; > say $p *= ($d-1)/($d); $d *= 2 }' > > operation 1017: 0.288788095086602 > operation 1018: 0.288788095086602 > operation 1019: 0.288788095086602 > operation 1020: 0.288788095086602 > operation 1021: 0.288788095086602 > operation 1022: 0.288788095086602 > operation 1023: 0.288788095086602 > operation 1024: NaN
Here's my current run: $ ./perl6 -e 'my $d = 2; my $p = 1; while 1 { say $p *= ($d-1)/($d); $d *= 2 }' 0.5 0.375 0.328125 0.3076171875 0.298004150390625 0.293347835540771 0.291056055575609 0.289919117858517 0.28935286958145 0.289070298419749 Inf ... Inf Floating point exception $ echo $? 136 -- Will "Coke" Coleda