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-03 17:08:18 +0200, Jérémie Roquet wrote:
> I think we want a warning, as we have for division by zero.

I don't think so. The division by zero is mathematically undefined,
so that a warning is fine. But a division by -1 could be replaced by
a negate operation; then you have the usual modular arithmetic rules.
They already occur for

$ echo $[ 2**63 ]
-9223372036854775808

anyway.

> The shell should not crash, neither should it return incorrect
> results.

Agreed.

-- 
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