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

.base method works incorrectly with low $digits values #4526

Closed
p6rt opened this issue Sep 9, 2015 · 3 comments
Closed

.base method works incorrectly with low $digits values #4526

p6rt opened this issue Sep 9, 2015 · 3 comments
Labels

Comments

@p6rt
Copy link

p6rt commented Sep 9, 2015

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

Searchable as RT126022$

@p6rt
Copy link
Author

p6rt commented Sep 9, 2015

From @labster

[7​:51pm] labster​: m​: 1.5e0.base(10, -1).say
[7​:51pm] camelia​: rakudo-moar 10dcba​: OUTPUT«2␤»
[7​:51pm] labster​: m​: 1.base(10, -1).say
[7​:51pm] camelia​: rakudo-moar 10dcba​: OUTPUT«1.␤»
[7​:52pm] labster​: m​: (3/2).base(10, -1).say
[7​:52pm] camelia​: rakudo-moar 10dcba​: OUTPUT«Index out of range. Is​: -1,
should be in 0..Inf␤ in block <unit> at /tmp/8pBvED6LJ6​:1␤␤Actually thrown
at​:␤ in any at src/gen/m-Metamodel.nqp​:2869␤ in block <unit> at
/tmp/8pBvED6LJ6​:1␤␤»
[7​:52pm] labster​: oddly enough, it's the last one that's closest to spec.
[8​:00pm] labster​: m​: say (98/99).base(10, 1)
[8​:00pm] camelia​: rakudo-moar 10dcba​: OUTPUT«010.0␤»
[8​:00pm] labster​: right, so I already have a fix for that one, but I'm
going to rakudobug this so I can get a tracking ticket

@p6rt
Copy link
Author

p6rt commented Sep 16, 2015

From @labster

Fixed in 5746df26c1, tests added in 4adf0d865e. Negative indices now fail.

Resolving ticket.

On Tue Sep 08 20​:10​:24 2015, labster wrote​:

[7​:51pm] labster​: m​: 1.5e0.base(10, -1).say
[7​:51pm] camelia​: rakudo-moar 10dcba​: OUTPUT«2␤»
[7​:51pm] labster​: m​: 1.base(10, -1).say
[7​:51pm] camelia​: rakudo-moar 10dcba​: OUTPUT«1.␤»
[7​:52pm] labster​: m​: (3/2).base(10, -1).say
[7​:52pm] camelia​: rakudo-moar 10dcba​: OUTPUT«Index out of range. Is​: -1,
should be in 0..Inf␤ in block <unit> at /tmp/8pBvED6LJ6​:1␤␤Actually thrown
at​:␤ in any at src/gen/m-Metamodel.nqp​:2869␤ in block <unit> at
/tmp/8pBvED6LJ6​:1␤␤»
[7​:52pm] labster​: oddly enough, it's the last one that's closest to spec.
[8​:00pm] labster​: m​: say (98/99).base(10, 1)
[8​:00pm] camelia​: rakudo-moar 10dcba​: OUTPUT«010.0␤»
[8​:00pm] labster​: right, so I already have a fix for that one, but I'm
going to rakudobug this so I can get a tracking ticket

@p6rt p6rt closed this as completed Sep 16, 2015
@p6rt
Copy link
Author

p6rt commented Sep 16, 2015

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

@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