n*******r 发帖数: 60 | 1 in C++ How to judge a variable is a number (double type) or N/A, anybody
could help. I spent several hours in searching the document. Thanks very
much! |
h*****k 发帖数: 5022 | 2 wot do u mean judge a variable?
a variable should declared first, then u know the type |
X****r 发帖数: 3557 | 3 Google "IEEE 754"
e.g. on http://steve.hollasch.net/cgindex/coding/ieeefloat.html , see the "Summary" section.
anybody
【在 n*******r 的大作中提到】 : in C++ How to judge a variable is a number (double type) or N/A, anybody : could help. I spent several hours in searching the document. Thanks very : much!
|
n********e 发帖数: 2 | 4 #include
numeric_limits::quiet_NaN()
Actually there should be many representation of NaN for IEE754
So to determine whether a number is NaN one use isnan(double) in math.h
anybody
【在 n*******r 的大作中提到】 : in C++ How to judge a variable is a number (double type) or N/A, anybody : could help. I spent several hours in searching the document. Thanks very : much!
|