Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: PATCH: prevent SIGFPE on systems where LONG_MIN < -LONG_MAX



On 2012-09-04 19:26:44 +0100, Peter Stephenson wrote:
> > > The shell should not crash, neither should it return incorrect
> > > results.
> > 
> > Agreed.
> 
> Well, that depends what you mean by an incorrect result.  Mathematically
> incorrect results are inevitable if you don't account of the precision,
> but we don't warn for any other rounding error so I agree there's no
> reason to here.

Here these are integer operations, and it seems that zsh chose
modular arithmetic, so that a "correct" representable result
is always possible under these conditions ("correct" but not
necessarily meaningful, but no-one can prevent the user from
writing meaningless expressions).

-- 
Vincent Lefèvre <vincent@xxxxxxxxxx> - Web: <http://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <http://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)



Messages sorted by: Reverse Date, Date, Thread, Author