[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: About big integers in Lua 5.3.
- From: Sean Conner <sean@...>
- Date: Fri, 15 Jan 2016 02:09:41 -0500
It was thus said that the Great Dirk Laurie once stated:
> 2016-01-14 22:39 GMT+02:00 Tom N Harris <firstname.lastname@example.org>:
> > Lua doesn't hide the imprecision of floats, nor do I think it should
> > hide the overflow of integers.
> I grew up in a time when integer overflow caused a program to
> crash unless you had explicitly set a CPU flag that would make
> it wrap around. Don't modern machines have such a flag, only
> by default it is off? And if so, is the feature accessible from C?
The only architecture I know of  that can do that is the VAX
architecture . The MIPS can trap overflow, but it requires the use of
separate instructions (ADD instead of ADDU that every C compiler seems to
use). Such features aren't necessarily accesible from C in a portable
manner, although compilers might support options to enable/disable such
I did some microbenchmarks on this  and it doesn't seem to add that
much overhead on modern machines .
 I'm not saying it's the only one, just that it's the only one I know
 Sweet system and the most regular and orthogonal CISC architecture
I've come across.