Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

round broken, bugfix included #289

Closed
p6rt opened this issue Sep 2, 2008 · 5 comments
Closed

round broken, bugfix included #289

p6rt opened this issue Sep 2, 2008 · 5 comments
Labels

Comments

@p6rt
Copy link

p6rt commented Sep 2, 2008

Migrated from rt.perl.org#58500 (status was 'resolved')

Searchable as RT58500$

@p6rt
Copy link
Author

p6rt commented Sep 2, 2008

From @stifynsemons

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

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.

Stephen Simmons

@p6rt
Copy link
Author

p6rt commented Sep 2, 2008

From @stifynsemons

I forgot to mention​: when I do make spectest_regression, the t/S29-rounders.t is not run, which
probably would catch this. But I wasn't sure how to patch this without potentially breaking
things.

Stephen Simmons

@p6rt
Copy link
Author

p6rt commented Sep 2, 2008

@stifynsemons - Status changed from 'new' to 'open'

@p6rt
Copy link
Author

p6rt commented Sep 2, 2008

From @moritz

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/

@p6rt
Copy link
Author

p6rt commented Sep 2, 2008

@moritz - Status changed from 'open' to 'resolved'

@p6rt p6rt closed this as completed Sep 2, 2008
@p6rt p6rt added the Bug label Jan 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant