问题描述
当我使用-ansi选项编译时(使用gcc 3.2.3)我被警告了一个
函数''finite''的隐式声明。这是否意味着finite()是
不是ANSI C的一部分,或者我没有包含必要的头文件? (我
确实包含math.h.)无论哪种方式,是否有推荐的方法来检查ANSI C中的浮点数或双精度浮点数是否有限?谢谢。
When I compile with the -ansi option (using gcc 3.2.3) I''m warned of an
implicit declaration of function ''finite''. Does this mean that finite() is
not part of ANSI C, or that I didn''t include a necessary header file? (I
did include math.h.) Either way, is there a recommended way to check if a
float or double is finite in ANSI C? Thanks.
推荐答案
finite()不属于ANSI C.
-
/ - Joona Palaste(pa*****@cc.helsinki.fi)-------------芬兰-------- \
\ - ---------------------规则! -------- /
"''所谓的''意味着'''这有很长的解释,但我没有
时间在这里解释一下。''"
- JIPsoft
finite() is not part of ANSI C.
--
/-- Joona Palaste (pa*****@cc.helsinki.fi) ------------- Finland --------\
\-- http://www.helsinki.fi/~palaste --------------------- rules! --------/
"''So called'' means: ''There is a long explanation for this, but I have no
time to explain it here.''"
- JIPsoft
finite()来自BSD。 C99中的等价物是isfinite()。
-
Brian Gough
Network Theory Ltd,
发布免费软件手册---
您的实现中的标题(特别是< math.h>)将显示
C99中的一些内容但是不是隐藏在#ifdefs中的C89
旨在使它们与C89不可见。只需将它们移到
#ifdefs之外。这并没有解决从标题(可能还有库)中完全遗漏的问题。
The headers (in particular <math.h>) in your implementation will show
some things which are in C99 but not in C89 hidden within #ifdefs
designed to make them invisible with C89. Just move them outside the
#ifdefs. This does not solve the problem of things missing completely
from the headers (and perhaps from the libraries).
这篇关于ANSI C中的finite()?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!