[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Integer division
- From: Egor Skriptunoff <egor.skriptunoff@...>
- Date: Thu, 22 Nov 2012 04:04:02 +0300
On 11/21/12, Roberto Ierusalimschy <roberto@inf.puc-rio.br> wrote:
> a computation can "overflow" with floats and
> not overflow with 64-bit integers. ("overflow" here means lose of
> precision.) And (as you mentioned) "overflow" with floats never
> raise an error.
I have an idea.
Strings can be treated as integer numbers of arbitrary length.
So, a string of length 8 can be used instead of 64-bit integer.
Let all integer and bitwise operations be implemented on strings.
Strings will never overflow because of auto growing up.
It will be cool to have very-long-integer arithmetic in Lua
without external libraries.
- References:
- Integer division, Dirk Laurie
- Re: Integer division, Petri Häkkinen
- Re: Integer division, Roberto Ierusalimschy
- Re: Integer division, Egor Skriptunoff
- Re: Integer division, Sven Olsen
- Re: Integer division, Roberto Ierusalimschy
- Re: Integer division, Jay Carlson
- Re: Integer division, Roberto Ierusalimschy
- Re: Integer division, Jay Carlson
- Re: Integer division, Roberto Ierusalimschy