Stephen Simmons (via RT) wrote: > # New Ticket Created by "Stephen Simmons" > # Please include the string: [perl #58500] > # in the subject line of all future correspondence about this issue. > # <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=58500 > > > > With revision 30669, I find the following behavior of round() > > sully:perl6 stephensimmons$ perl6 -e 'say round(3.5);' > 4 > sully:perl6 stephensimmons$ perl6 -e 'say round(3.4);' > 3.9 > sully:perl6 stephensimmons$ perl6 -e 'say round(3.6);' > 4.1 > > It's trivial, but here is the diff of the fix: > > sully:perl6 stephensimmons$ svn diff -r HEAD src/builtins/math.pir > Index: src/builtins/math.pir > =================================================================== > --- src/builtins/math.pir (revision 30669) > +++ src/builtins/math.pir (working copy) > @@ -61,7 +61,7 @@ > .param num a > a += 0.5 > $N0 = floor a > - .return (a) > + .return ($N0) > .end
Thanks, applied as r30697. I also fudged the rounders.t file to work with rakudo (what a mess, see pugs revision 22098), and added it to spectest_regression (r30698) > After: > sully:perl6 stephensimmons$ perl6 -e 'say round(3.4);' > 3 > sully:perl6 stephensimmons$ perl6 -e 'say round(4);' > 4 > sully:perl6 stephensimmons$ perl6 -e 'say round(3.6);' > 4 > > Please let me know the proper form for submitting bug fixes. I remember > reading it somewhere, but I couldn't find it tonight. Yes it is. Thanks again. Moritz -- Moritz Lenz http://moritz.faui2k3.org/ | http://perl-6.de/