Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

Pray to God, but keep rowing to shore. -- Russian Proverb


tech / sci.electronics.design / Re: 0.0 / 0.0 = -NAN ?

SubjectAuthor
o Re: 0.0 / 0.0 = -NAN ?Jasen Betts

1
Re: 0.0 / 0.0 = -NAN ?

<t4l005$r2a$2@gonzo.revmaps.no-ip.org>

  copy mid

https://www.novabbs.com/tech/article-flat.php?id=95902&group=sci.electronics.design#95902

  copy link   Newsgroups: sci.electronics.design
Path: i2pn2.org!i2pn.org!news.neodome.net!news.uzoreto.com!news-out.netnews.com!news.alt.net!fdc2.netnews.com!peer02.ams1!peer.ams1.xlned.com!news.xlned.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx48.iad.POSTED!not-for-mail
From: use...@revmaps.no-ip.org (Jasen Betts)
Newsgroups: sci.electronics.design
Subject: Re: 0.0 / 0.0 = -NAN ?
Organization: JJ's own news server
Message-ID: <t4l005$r2a$2@gonzo.revmaps.no-ip.org>
References: <85f22bc1-17c7-46d9-b933-4c6238863740n@googlegroups.com>
Injection-Date: Sun, 1 May 2022 03:49:25 -0000 (UTC)
Injection-Info: gonzo.revmaps.no-ip.org; posting-host="localhost:127.0.0.1";
logging-data="27722"; mail-complaints-to="usenet@gonzo.revmaps.no-ip.org"
User-Agent: slrn/1.0.3 (Linux)
X-Face: ?)Aw4rXwN5u0~$nqKj`xPz>xHCwgi^q+^?Ri*+R(&uv2=E1Q0Zk(>h!~o2ID@6{uf8s;a
+M[5[U[QT7xFN%^gR"=tuJw%TXXR'Fp~W;(T"1(739R%m0Yyyv*gkGoPA.$b,D.w:z+<'"=-lVT?6
{T?=R^:W5g|E2#EhjKCa+nt":4b}dU7GYB*HBxn&Td$@f%.kl^:7X8rQWd[NTc"P"u6nkisze/Q;8
"9Z{peQF,w)7UjV$c|RO/mQW/NMgWfr5*$-Z%u46"/00mx-,\R'fLPe.)^
Lines: 26
X-Complaints-To: https://www.astraweb.com/aup
NNTP-Posting-Date: Sun, 01 May 2022 04:00:58 UTC
Date: Sun, 1 May 2022 03:49:25 -0000 (UTC)
X-Received-Bytes: 2004
 by: Jasen Betts - Sun, 1 May 2022 03:49 UTC

On 2022-04-30, Skybuck Flying <skybuckflying@gmail.com> wrote:
> When exception masks are all enabled to stop the processor from throwing floating point exceptions the following calculation produces a somewhat strange result:
>
> 0.0 / 0.0 = -nan
>
> (At least in Delphi).

> For now I will assume this is the case in C/C++ as well and with that I mean on x86/x64 which should and seems to be following IEEE 754 floating-point format.

You get nan in C see the standards documents.

> I am a little bit surprised by this and I want/need to know more. Where is this defined that 0.0 / 0.0 should be -NAN ?!?

I guess this was invented by Borland, SFAIK they made all the decisions.

> Problem is with the code, example:
>
> T := 0;
> D := 0.0 / 0.0;
> P := T * D;
>
> This screws up P. instead of P being zero, P is now also -NAN ?!?

seems reasonable to me.
--
Jasen.

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor