gamo> Forget about it. It's unusable because hangs out.
It's unusable because the author of the code doesn't understand how
computers do math. This is not a problem with Perl 6 but a problem in
translating abstract concepts with theoretically infinite precision into
electrons moving on silicon.
http://docs.oracle.com/cd/E19957-01/806-3568/ncg_goldberg.html
Read and be enlightened.
Charlton
gamo> I used this program to test
gamo> #!/usr/bin/perl6
gamo> use v6;
gamo> =begin pod
gamo> Calculate the N(0,1) prob. value corresponding to Z
gamo> =end pod
gamo> # say "Enter Z: "; my $z = 1; # @ARGV[0]; # $*IN; # .lines; #
gamo> chomp $z; die "Wrong number" unless $z;
gamo> my $step = 1/1000000; my $r = 0.5; my $pi =
gamo> 3.14159265358979324; my $static = 1/(1000000*sqrt(2*$pi)); my
gamo> $e = exp(1); my $i = $step; loop { $i += $step; if $i > $z {
gamo> last;
gamo> }
gamo> $r += $static*($e**(-0.5*$i*$i));
gamo> }
gamo> $r = sprintf ("%.7f",$r); say "P[Z<=$z] = $r"; my $rleft = 1 -
gamo> $r; $r -= $rleft; say "P[-$z<=Z<=$z] = $r";
gamo> exit 0;
gamo> # After correcting it more than 20 times, it shows no error
gamo> but doesn't run