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, -- __________________________________________________________________ / [EMAIL PROTECTED] [EMAIL PROTECTED] \ | 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:[EMAIL PROTECTED] Help mailto:[EMAIL PROTECTED] Archive http://www.ee.ethz.ch/~slist/rrd-developers WebAdmin http://www.ee.ethz.ch/~slist/lsg2.cgi
