[rrd-developers] Re: Representation of NAN and INF
Alex van den Bogaerdt
alex at slot.hollandcasino.nl
Thu Jul 26 04:37:28 MEST 2001
Matt Zimmerman wrote:
>
> Mathematically speaking, 1.0/0.0 is undefined while 0.0/0.0 is indeterminate,
> and those do not mean the same thing. From a programming standards
> perspective, as far as I know, IEEE 754 says that there are multiple
> permissible representations for NaN and infinity (not all bits are defined).
> So there are values for which, within rrdtool:
>
> isnan(x) && x != DNAN
> and
> isinf(x) && x != DINF
Good to know.
> I would hope that rrdtool only uses these macros to obtain reasonable values to
> use in its internal storage format, and not for any comparisons (where the IEEE
> functions should be used).
A quick scan doesn't reveal any such comparisons. I'll check more careful
later on.
> As long as this is true, the expressions for DNAN and DINF are a perfectly
> valid way to obtain some values which will satisfy finite/isnan/isinf in the
> expected ways: IEEE defines that isnan(0.0/0.0) and isinf(1.0/0.0) will both
> be true.
Do you also happen to know the official way to handle isnan(1.0/0.0) ?
> I missed the original post...is there some compiler which is not handling these
> expressions correctly?
It was about porting to VB OCX or something alike. I don't know if it
was asked because it fails in VB or not.
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