Home/Support/Support Forum/how do I test for INF, -INF and NaN
New and improved user forum site going live on 12/6 (All users will need to reset their password when the new forum is active)
Welcome to Digi Forum, where you can ask questions and receive answers from other members of the community.

how do I test for INF, -INF and NaN

0 votes

I'm trying to write a software that will catch if a float gets a "INF" or "-INF" or "NaN".
the isInf() function is not supported and i tried several options, none worked.
please help.
asked Feb 3, 2017 in Rabbit Software by oazrad New to the Community (1 point)

Please log in or register to answer this question.

1 Answer

0 votes
I believe you can compare directly using the macros INF and -INF (e.g., "if (f == INF)").

I don't know of instances where the Dynamic C floating point library will use a NaN value other than INF or -INF.

Can you post an example of what you're trying to test for, and how the test is failing?
answered Feb 3, 2017 by TomCollins Veteran of the Digi Community (2,382 points)