lua-users home
lua-l archive

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


On Wed, Jul 10, 2013, at 11:29 AM, Roberto Ierusalimschy wrote:
> > > That's one reason their choice of semantics for overflow are really
> > > pretty nice.
> > 
> > Yes. In fact, I can't think of any use of full 64-bit unsigned integer that won't "work just fine." We can even read and write them:
> > 
> > [...]
> 
> Comparison does not work for unsigneds, but we could add a function for
> unsigned comparison.
> 
> -- Roberto
> 

And, even with having to write functions to get around the sign bit, a
int64 type is still a huge improvement over the (potential) lost of
precision caused by using floating point to manipulate 64 bit values.

IMHO, Int64 is a very big deal (for Lua). The 53 bits of mantissa is
sufficient for a lot of applications, but I feel dirty every time I deal
with a protocol format that specifies a 64 bit field and I shove it into
a Lua (5.1/5.2) number: One day, someone will have a reason for using
all 64 bits in that field and my Lua app will munge that value.

/todd