larcenists / larceny

Larceny Scheme implementation
Other
202 stars 32 forks source link

number->string fails in base 36 on large numbers #820

Open WillClinger opened 6 years ago

WillClinger commented 6 years ago
> (number->string (expt 2 48) 36)
Error: string-ref: illegal second argument: 28  is not a valid index into string

> (number->string (expt 2 32) 36)
Error: string-ref: illegal second argument: 35  is not a valid index into string

> (number->string (expt 2 26) 36)
"13ydj4"

I don't think any of the standards require number->string to work in base 36, but this is clearly a bug.