in reply to Re^4: Small Perl 6 discoveries II, Rats
in thread [Perl6] Small discoveries I, __DATA__
and that $x (the Rat) gets handled in a way that I don't really expect:> my $x = 1.111111111111111111111.Rat; $x.nude (1111111111111111111111 1000000000000000000000) > my $y = 1.111111111111111111111.FatRat; $y.nude (1111111111111111111111 1000000000000000000000)
though the last result is as I expected.> my $r1 = $x * 0.3 0.333333333333333 > $r1 = $x * 0.3.Rat 0.333333333333333 > $r1 = $x * 0.3.Num 0.333333333333333 > $r1 = $x * 3e-1 0.333333333333333 > $r1 = $x * 0.3.FatRat 0.3333333333333333333333
which is more in keeping with my expectations.> my $r2 = $y * 0.3 0.3333333333333333333333 > my $r2 = $y * 0.3.Rat 0.3333333333333333333333 > my $r2 = $y * 0.3.Num 0.333333333333333 > my $r2 = $y * 3e-1 0.333333333333333 > my $r2 = $y * 0.3.FatRat 0.3333333333333333333333
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^6: Small Perl 6 discoveries II, Rats
by Anonymous Monk on Oct 22, 2017 at 15:14 UTC | |
by syphilis (Archbishop) on Oct 22, 2017 at 23:12 UTC | |
by raiph (Deacon) on Oct 24, 2017 at 02:55 UTC | |
by syphilis (Archbishop) on Oct 28, 2017 at 11:41 UTC | |
by raiph (Deacon) on Oct 28, 2017 at 13:52 UTC | |
| |
by Anonymous Monk on Oct 24, 2017 at 15:57 UTC | |
by holli (Abbot) on Oct 25, 2017 at 01:43 UTC | |
| |
by syphilis (Archbishop) on Oct 25, 2017 at 02:54 UTC | |
| |
by raiph (Deacon) on Oct 27, 2017 at 19:25 UTC | |
|