看板Linux
标 题Re: 问题:不明函式finite()
发信站海大计中 (Wed Jun 11 11:16:04 2008)
转信站ptt!ctu-reader!ctu-gate!news.nctu!news.ntu!news.ind.ntou!news.ntou!NTO
感谢你的指教,我耍笨了。
网路上查了一大堆,却完全忘记系统最基本的
文件:Manpage的存在了。(整个糗)
查到了,我的系统定义在ieeefp.h里面。
这样我就知道怎麽改那段source code了......
感谢你点醒了我差点遭到遗忘的记忆。
..
..
※ 引述《[email protected] (风)》之铭言:
> ※ 引述《[email protected] (旧的关系开始一一切断)》之铭言:
> : 最近编译一只程式时,遇到finite()函式未定义的错误讯息。
> : 然後就开始寻找finite()就近是属於哪个函式库的。
> : 结果就是找不到,看起来像是C++的某个函式。
> : 但是Google找不到,翻开C++数学函式没有这个,
> : GSL也没有,libstdc++手册都没有。
> : 所以只好上来向大家求助了。希望大家告诉
> : 我它来自什麽函式库的名称就可以了,谢谢。
> 你这样的描述太过馍糊了,一般来说,要先去看看 source code 里面有引用了
> 哪些 header file,看看 Makefile 里面有引用了哪些 library,然後才能确定
> finite() 到底是哪个 library 的函式。
> 不过基本上,用 man 查一下不就有了?你的系统的 manpage 不完整吗?
> 节录以下 finite(3) 的 manpage:
> <quote>
> FINITE(3) Linux Programmer's Manual FINITE(3)
> NAME
> finite, finitef, finitel, isinf, isinff, isinfl, isnan, isnanf, isnanl
> - BSD floating point classification functions
> SYNOPSIS
> #define _BSD_SOURCE
> #include <math.h>
> int finite(double x);
> [中略]
> DESCRIPTION
> The finite() functions return a non-zero value if x is neither infinite
> nor a "not-a-number" (NaN) value, and 0 otherwise.
> [中略]
> NOTES
> Note that these functions are obsolete. C99 defines macros isfinite(),
> isinf() and isnan() (for all types) replacing them. Further note that
> the C99 isinf() has weaker guarantees on the return value. See fpclas-
> sify(3).
> On a glibc system, these functions are declared by <math.h> when
> _BSD_SOURCE or _SVID_SOURCE or _GNU_SOURCE is defined. The isnan()
> functions will also be declared when _XOPEN_SOURCE is defined.
> [後略]
> </quote>
> 请注意变色的部分。
--
┌┼ Or
igin:
国立台湾海洋大学˙海大计中 bbs.ntou.edu.tw
└┘ A
uthor:
parvenir 从 D211-120.dorm1.ntou.edu.tw 发表