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

Robert avatar
By Robert
at 2008-06-11T10:35

Table of Contents

※ 引述《[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>

請注意變色的部分。


--
Tags: Linux

All Comments

proftpd的LangDefault用途

Gilbert avatar
By Gilbert
at 2008-06-11T01:55
※ [本文轉錄自 FTP 看板] 作者: b60413 (None) 看板: FTP 標題: [問問] proftpd的LangDefault用途 時間: Tue Jun 10 15:41:16 2008 AS Title 想問proftpd的LangDefault用途是做什麼用的? 現在FTP遇到編 ...

Re: 整合多顆小硬碟LVM?Raid0?

Rebecca avatar
By Rebecca
at 2008-06-11T01:52
※ 引述《kadok (暗夜流星)》之銘言: : 最近想要實作 整合多顆小硬碟 來當NAS 使用 : 我記得有LVM 和 Raid0 兩種方法 : 可是 仔細想想  兩者好像都差不多? 是這樣嗎? : 甚至近年來 幾乎都沒看到Raid0 : 幾乎Raid都是 1或是 5的文章比較多 : 目前手上 ...

整合多顆小硬碟LVM?Raid0?

Olive avatar
By Olive
at 2008-06-10T22:21
最近想要實作 整合多顆小硬碟 來當NAS 使用 我記得有LVM 和 Raid0 兩種方法 可是 仔細想想  兩者好像都差不多? 是這樣嗎? 甚至近年來 幾乎都沒看到Raid0 幾乎Raid都是 1或是 5的文章比較多 目前手上是有一些淘汰電腦可組合使用 但是 這些零件另一方面又想成為 ...

EeePC的解析度

Charlie avatar
By Charlie
at 2008-06-10T21:41
嗯 我用701(請不要叫我買90x atat) 原生Linux的解析度只有800*480 我是希望可以模擬到1024*614 但過了很久還是沒看到有這種linux的程式釋出 xp的話有Astray+可以用 linux是有看到利用vnc達到 但是一來vnc放大後很模糊,二來會有明顯lag,三是有很多熱鍵無法使 ...

我的Ubuntu會自動跳出圖形介面

Queena avatar
By Queena
at 2008-06-10T20:47
最進發生了幾次 圖形介面自動關掉變成文字介面 大部分是把Firefox縮到最小時發生的 不知到是什麼問題呢 還有我要附上那個記錄檔呢 謝謝 - ...