From mboxrd@z Thu Jan 1 00:00:00 1970 From: erik quanstrom Date: Fri, 18 Apr 2014 15:56:12 -0400 To: riddler876@gmail.com, 9fans@9fans.net Message-ID: In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Subject: Re: [9fans] Floating point and dividing by 0 Topicbox-Message-UUID: d9c34514-ead8-11e9-9d60-3106f5b1d025 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