Simon Schuster
9/7/2007 7:22:00 PM
ok ok. I'm glad I read that wrong, it caused me some confusion.
On 9/7/07, Phrogz <phrogz@mac.com> wrote:
> On Sep 7, 8:51 am, "Simon Schuster" <significa...@gmail.com> wrote:
> > On 9/7/07, Erik Veenstra <erikv...@gmail.com> wrote:
> > > What's the advantage of toBase36, compared to the built-in
> > > to_s(36)?
> >
> > > p toBase36(30)
> > > p 30.to_s(36)
> > whaaaa, changing the base of a string? this is totally bizarre to me.
> >
> > 003:0> p 10.to_s
> > "10"
> > nil
> > 004:0> p 10.to_s(14)
> > "a"
> > nil
>
> Er, you're not changing the base of a string. (That would be something
> like 10.to_s.to_base(14).) You're changing the number to be
> represented as a string in a specific base, via an argument to the
> to_s method.
>
>
>