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

ArgumentError when sprintf("%b", (1<<10)) #3025

Closed
murasesyuka opened this Issue Nov 17, 2015 · 1 comment

Comments

Projects
None yet
2 participants
@murasesyuka
Contributor

murasesyuka commented Nov 17, 2015

this error is spec? expected?

$ ./bin/mirb --version
mruby 1.2.0 (2015-11-17) 
$ ./bin/mirb
mirb - Embeddable Interactive Ruby Shell

> 31.times{|i| p sprintf("%b", (1<<i))}
"1"
"10"
"100"
"1000"
"10000"
"100000"
"1000000"
"10000000"
"100000000"
"1000000000"
(mirb):1: string (10000000000) too big for integer (ArgumentError)
> p sprintf("%b", (1<<9))
"1000000000"
 => "1000000000"
> p sprintf("%b", (1<<10))
(mirb):3: string (10000000000) too big for integer (ArgumentError)
> sprintf("%b", (1<<10))
(mirb):4: string (10000000000) too big for integer (ArgumentError)
@matz

This comment has been minimized.

Show comment
Hide comment
@matz

matz Nov 18, 2015

Member

It should be an error!

Member

matz commented Nov 18, 2015

It should be an error!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment