[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Sc-devel] When integers go bad



I don't think that is appropriate for a real time language.

On Wed, Feb 27, 2008 at 11:32 AM, Tim Walters
<walters@xxxxxxxxxxxxxxxxxx> wrote:
> I like Ruby's solution, which is that integers get promoted to BigNums
>  transparently as needed:
>
>  irb(main):010:0> a = 1000000000
>  => 1000000000
>  irb(main):013:0> a.class
>  => Fixnum
>  irb(main):011:0> b = 1000
>  => 1000
>  irb(main):014:0> b.class
>  => Fixnum
>  irb(main):015:0> c = a * b
>  => 1000000000000
>  irb(main):016:0> c.class
>  => Bignum
>  irb(main):017:0> c * c
>  => 1000000000000000000000000
>
>  I have no idea how hard this would be to implement, or what the
>  performance implications would be. But it's nifty.
>
>  --
>  Tim Walters | http://doubtfulpalace.com
>
>
>
>
>  _______________________________________________
>  Sc-devel mailing list
>  Sc-devel@xxxxxxxxxxxxxxx
>  http://lists.create.ucsb.edu/mailman/listinfo/sc-devel
>



-- 
--- james mccartney