9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] Floating point and dividing by 0
@ 2014-04-18 19:52 Riddler
  2014-04-18 19:56 ` erik quanstrom
  2014-04-18 20:10 ` erik quanstrom
  0 siblings, 2 replies; 7+ messages in thread
From: Riddler @ 2014-04-18 19:52 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

[-- Attachment #1: Type: text/plain, Size: 880 bytes --]

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.

Regards,
Rid.

[-- Attachment #2: Type: text/html, Size: 1122 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2014-04-18 21:39 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-04-18 19:52 [9fans] Floating point and dividing by 0 Riddler
2014-04-18 19:56 ` erik quanstrom
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

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