Re: 問題:不明函式finite()

看板Linux作者時間17年前 (2008/06/11 11:32), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串3/4 (看更多)
感謝你的指教,我耍笨了。 網路上查了一大堆,卻完全忘記系統最基本的 文件:Manpage的存在了。(整個糗) 查到了,我的系統定義在ieeefp.h裡面。 這樣我就知道怎麼改那段source code了...... 感謝你點醒了我差點遭到遺忘的記憶。 .. .. ※ 引述《Storm.bbs@ptt.cc (風)》之銘言: > ※ 引述《parvenir.bbs@bbs.ntou.edu.tw (舊的關係開始一一切斷)》之銘言: > : 最近編譯一隻程式時,遇到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> > 請注意變色的部分。 -- Origin: 國立台灣海洋大學˙海大計中 bbs.ntou.edu.tw Author: parvenir D211-120.dorm1.ntou.edu.tw 發表
文章代碼(AID): #18JqSq00 (Linux)
文章代碼(AID): #18JqSq00 (Linux)