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

'div' for Ints truncates towards 0 when it should round down in Rakudo #2739

Closed
p6rt opened this issue Apr 29, 2012 · 4 comments
Closed

'div' for Ints truncates towards 0 when it should round down in Rakudo #2739

p6rt opened this issue Apr 29, 2012 · 4 comments
Labels

Comments

@p6rt
Copy link

p6rt commented Apr 29, 2012

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

Searchable as RT112678$

@p6rt
Copy link
Author

p6rt commented Apr 29, 2012

From @masak

<moritz> p6​: say (-8) div 3
<p6eval> ..niecza v16-23-gaa61ed5​: OUTPUT«-3␤»
<p6eval> ..rakudo 2a962e​: OUTPUT«-2␤»
<masak> huh!
<masak> I think Rakudo is right here.
<masak> it's truncate-towards-0, not round-down semantics.
* masak submits nieczabug
<sisar> masak​: no. the spec says "In general, div should give the same
result as​: $x div $y == floor($x/$y) "
<masak> oh!
* masak unsubmits the nieczabug and submits rakudobug

@p6rt
Copy link
Author

p6rt commented Oct 11, 2014

From @usev6

This works now​:

$ perl6-m -e 'say (-8) div 3'
-3

I added a test to S03-operators/div.t with the following commit​: Raku/roast@d03302f512

1 similar comment
@p6rt
Copy link
Author

p6rt commented Oct 11, 2014

From @usev6

This works now​:

$ perl6-m -e 'say (-8) div 3'
-3

I added a test to S03-operators/div.t with the following commit​: Raku/roast@d03302f512

@p6rt
Copy link
Author

p6rt commented Oct 11, 2014

@usev6 - Status changed from 'new' to 'resolved'

@p6rt p6rt closed this as completed Oct 11, 2014
@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