zsh-workers
 help / color / mirror / code / Atom feed
From: Vincent Lefevre <vincent@vinc17.net>
To: zsh-workers@zsh.org
Subject: Re: PATCH: prevent SIGFPE on systems where LONG_MIN < -LONG_MAX
Date: Wed, 5 Sep 2012 01:50:34 +0200	[thread overview]
Message-ID: <20120904235034.GQ19561@xvii.vinc17.org> (raw)
In-Reply-To: <20120904192644.661329c3@pws-pc.ntlworld.com>

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@vinc17.net> - 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)


      reply	other threads:[~2012-09-04 23:50 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-03 14:32 Jérémie Roquet
2012-09-03 14:40 ` Mikael Magnusson
2012-09-03 14:57   ` Peter Stephenson
2012-09-03 15:08     ` Jérémie Roquet
2012-09-03 16:26       ` Vincent Lefevre
2012-09-04 18:26         ` Peter Stephenson
2012-09-04 23:50           ` Vincent Lefevre [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120904235034.GQ19561@xvii.vinc17.org \
    --to=vincent@vinc17.net \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).