Quote:

> Is there any ANSI function or code snippet that would test a double for

> (positive) infinity? For that matter, how about for denormals and NaN's?

> Please send responses (or copies of posts) to me by email, since I don't

> check these newsgroups frequently.

John,

As I mentioned in a previous email, I would send something to you.

NaNs, Infinities, and denormals are not included as part of the C

standard. They are covered by other standards, such as IEEE and XPG4

(Unix). IEEE only requires certain properties, such as NaN, Infinity,

and denormals. XPG4 defines the isnan() function, which reports non-zero

when its argument is a NaN. IEEE 754-1985 does recommend function

class(). Digital Unix implements that as fp_class. This function returns

Constant Class

_____________________________________________________

FP_SNAN Signaling NaN (Not-a-Number)

FP_QNAN Quiet NaN (Not-a-Number)

FP_POS_INF +infinity

FP_NEG_INF -infinity

FP_POS_NORM Positive normalized

FP_NEG_NORM Negative normalized

FP_POS_DENORM Positive denormalized

FP_NEG_DENORM Negative denormalized

FP_POS_ZERO +0.0 (positive zero)

FP_NEG_ZERO -0.0 (negative zero)

There is also an IEEE finite() function.

Those systems supporting IEEE functionality should have all of these

functions available, though posssibly in some different forms.

--

Jerry Feldman Digital Unix Development Environment

Digital Equipment Corp. Nashua, NH 03062-9987