[rrd-developers] Re: Representation of NAN and INF

Alex van den Bogaerdt alex at slot.hollandcasino.nl
Wed Jul 25 16:54:25 MEST 2001


Dan McGinn-Combs wrote:

> I note in the C source that these two pseudo-numbers have representation
> defined in terms of the particular float scheme used with the C compiler:
> 
> #define DNAN    ((double)(0.0/0.0))
> #define DINF    ((double)(1.0/0.0))
> 
> Apparently, these two representations come out different. However, in the
> math I studied, "anything" divided by 0 is still ... like Undefined. And so
> 0/0 is the same as 1/0 and both are illegal.

For real mathematics this statement is entirely true.  However, in C
there is some IEEE standard that defines the float (and double) number
format and I *think* (so: not sure) this also defines the behaviour
when dividing by zero.

> So as I'm migrating the code to a (gasp!) VB OCX file, I'm trying to figure
> out what this has to be.

Just make sure the functions "isfinite()", "isnan()" and "isinf()" return
the proper result and you should be fine.

cheers,
-- 
   __________________________________________________________________
 / alex at slot.hollandcasino.nl                  alex at ergens.op.het.net \
| work                                                         private |
| My employer is capable of speaking therefore I speak only for myself |
+----------------------------------------------------------------------+
| Technical questions sent directly to me will be nuked. Use the list. | 
+----------------------------------------------------------------------+
| http://faq.mrtg.org/                                                 |
| http://rrdtool.eu.org  --> tutorial                                  |
+----------------------------------------------------------------------+

--
Unsubscribe mailto:rrd-developers-request at list.ee.ethz.ch?subject=unsubscribe
Help        mailto:rrd-developers-request at list.ee.ethz.ch?subject=help
Archive     http://www.ee.ethz.ch/~slist/rrd-developers
WebAdmin    http://www.ee.ethz.ch/~slist/lsg2.cgi



More information about the rrd-developers mailing list