On Fri Jan 09 06:47:29 2015, masak wrote:
> <masak> r: say 6103515625/5; say ((((6103515625/5) * 4 + 123327057) **
> 2) % 6103515625); say (((1220703125 * 4 + 123327057) ** 2) %
> 6103515625)
> <camelia> rakudo-{parrot,moar} c5dcdf:
> OUTPUT«1220703125␤0␤6103515624␤»
> <masak> ok -- between those three expressions, something is quite
> wrong.
> <masak> note that the third is just the second but with the evaluated
> result from the first inserted.
> <masak> the second and the third should show up the same.
> * masak submits rakudobug
> <FROGGS_> m: say ((((6103515625  /  5) * 4 + 123327057) ** 2) %
> 6103515625)
> <camelia> rakudo-moar c5dcdf: OUTPUT«0␤»
> <FROGGS_> m: say ((((6103515625 div 5) * 4 + 123327057) ** 2) %
> 6103515625)
> <camelia> rakudo-moar c5dcdf: OUTPUT«6103515624␤»
> <masak> FROGGS_: you're implying I'm suffering from bignum/rounding
> effects?
> <FROGGS_> I'm implying nothing atm
> < masak> anyway, FROGGS_++ for interesting data point. that goes in
> the ticket, too.
> <FROGGS_> m: say ((((6103515625 / 5).Int * 4 + 123327057) ** 2) %
> 6103515625)
> <camelia> rakudo-moar c5dcdf: OUTPUT«6103515624␤»
> <FROGGS_> m: say ((((6103515625 div 5).Num * 4 + 123327057) ** 2) %
> 6103515625)
> <camelia> rakudo-moar c5dcdf: OUTPUT«0␤»
> <FROGGS_> :o)

> <masak> the second and the third should show up the same.

$ ./perl6 rt123570.p6
1220703125
6103515624
6103515624

Now they do. Added test to integration/weird-errors.t, closing ticket.

-- 
Will "Coke" Coleda

Reply via email to