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

:256[list of numbers] wrongly allows the numbers to exceed 255 in Rakudo #3637

Open
p6rt opened this issue Jan 9, 2015 · 3 comments
Open

:256[list of numbers] wrongly allows the numbers to exceed 255 in Rakudo #3637

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

Comments

@p6rt
Copy link

@p6rt p6rt commented Jan 9, 2015

Migrated from rt.perl.org#123572 (status was 'new')

Searchable as RT123572$

@p6rt
Copy link
Author

@p6rt p6rt commented Jan 9, 2015

From @masak

<TimToady> m​: say :256["".ords]
<camelia> rakudo-moar c5dcdf​: OUTPUT«9786␤»
<TimToady> m​: say :256[0x263a]
<camelia> rakudo-moar c5dcdf​: OUTPUT«9786␤»
<TimToady> seems we could use a check there...
<TimToady> m​: say :256[256,256]
<camelia> rakudo-moar c5dcdf​: OUTPUT«65792␤»
* masak submits rakudobug

@p6rt
Copy link
Author

@p6rt p6rt commented Jun 2, 2017

From @TimToady

On Fri, 09 Jan 2015 10​:59​:08 -0800, masak wrote​:

<TimToady> m​: say :256["".ords]
<camelia> rakudo-moar c5dcdf​: OUTPUT«9786␤»
<TimToady> m​: say :256[0x263a]
<camelia> rakudo-moar c5dcdf​: OUTPUT«9786␤»
<TimToady> seems we could use a check there...
<TimToady> m​: say :256[256,256]
<camelia> rakudo-moar c5dcdf​: OUTPUT«65792␤»
* masak submits rakudobug

I suspect we should disallow out-of-radix entries for all but the first, since there are uses for allowing the first entry to overflow, such as encoding hours, minutes, and seconds. On the other hand, if we had something to do a reverse polymod, we wouldn't need to use :radix[] for that purpose, and could restrict all the digits on the assumption that it is only to be used for normal homogenous numeric bases.

1 similar comment
@p6rt
Copy link
Author

@p6rt p6rt commented Jun 2, 2017

From @TimToady

On Fri, 09 Jan 2015 10​:59​:08 -0800, masak wrote​:

<TimToady> m​: say :256["".ords]
<camelia> rakudo-moar c5dcdf​: OUTPUT«9786␤»
<TimToady> m​: say :256[0x263a]
<camelia> rakudo-moar c5dcdf​: OUTPUT«9786␤»
<TimToady> seems we could use a check there...
<TimToady> m​: say :256[256,256]
<camelia> rakudo-moar c5dcdf​: OUTPUT«65792␤»
* masak submits rakudobug

I suspect we should disallow out-of-radix entries for all but the first, since there are uses for allowing the first entry to overflow, such as encoding hours, minutes, and seconds. On the other hand, if we had something to do a reverse polymod, we wouldn't need to use :radix[] for that purpose, and could restrict all the digits on the assumption that it is only to be used for normal homogenous numeric bases.

@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
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant