Redian新闻
>
How to judge if it is a number in C++
avatar
How to judge if it is a number in C++# Programming - 葵花宝典
n*r
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!
avatar
h*k
2
wot do u mean judge a variable?
a variable should declared first, then u know the type
avatar
X*r
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!

avatar
n*e
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!

相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。