9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: erik quanstrom <quanstro@quanstro.net>
To: riddler876@gmail.com, 9fans@9fans.net
Subject: Re: [9fans] Floating point and dividing by 0
Date: Fri, 18 Apr 2014 15:56:12 -0400	[thread overview]
Message-ID: <b0f268a200ec6f512328e5de0976e8da@ladd.quanstro.net> (raw)
In-Reply-To: <CAGMcHPqONnwf6gB2ajEGseA2FE6fxjvJ4V6+zr2pr7kQUP3NYg@mail.gmail.com>

On Fri Apr 18 15:54:00 EDT 2014, riddler876@gmail.com wrote:

> Hello again,
>
> Continuing on with my floating point adventures, I have a question that I
> hope someone can provide some input on.
>
> I'm general idea of what I'm doing the following:
>     double zero = 0.0;
>     notify(fpnotecatch); //Ignore divide by zero note for a moment
>     double pInf = 1.0/zero;
>     notify(0); //Back to default note handler
>
>     if(isInf(pInf, 1) <= 0 && isInf(pInf, 0) <= 0) exits("Divide by zero
> did not result in infinity");
>
> The error "did not result in infinity" is always tripped. My understanding
> is that according to the spec it should have resulted in either + or -
> infinity.
>
> I suspect it's not required as there was a note thrown instead, and I can't
> think of any reason why you would deliberately ignore the note like I do of
> the top of my head. Thought I would mention it anyway see what input you
> guys had.

which kernel is this with?  also, be sure to note the fcr (see getfcr(2)).


- erik



  reply	other threads:[~2014-04-18 19:56 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-18 19:52 Riddler
2014-04-18 19:56 ` erik quanstrom [this message]
2014-04-18 20:10 ` erik quanstrom
2014-04-18 20:44   ` Riddler
2014-04-18 20:54     ` erik quanstrom
2014-04-18 21:32       ` Riddler
2014-04-18 21:39         ` erik quanstrom

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=b0f268a200ec6f512328e5de0976e8da@ladd.quanstro.net \
    --to=quanstro@quanstro.net \
    --cc=9fans@9fans.net \
    --cc=riddler876@gmail.com \
    /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.
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).