第四章阵列与指标.ppt

第四章阵列与指标.ppt

* * * * * * * * * * * * 函式庫補充資料 6-4 函式庫 C語言編譯軟體內部提供了很多常用的函式,它們集中在所謂的程式庫或函式庫 使用函式庫中的函式只需將此檔利用#include指令包含進來就可以了 6-4.1 數學函式 常用的數學函式(參考課本6-31頁) 函 數 原 型 作    用 表頭檔 int abs(int n); 計算整數n的絕對值(取正值)。 stdlib.h或math.h double fabs(double x); 計算雙浮點數x的絕對值(取正值)。 math.h long labs(long n); 計算長整數n的絕對值(取正值)。 stdlib.h或math.h double sqrt(double x); 計算雙浮點數x的平方根值。 math.h double pow(double x, double y); 計算x的y次方值,即xy。 math.h 6-4.1 數學函式 常用的數學函式 type __max( type a, type b ); 傳回a和b中數值較大者,可以是任何型態的數值,特別注意的是max前面的底線有兩個。 stdlib.h type __min( type a, type b ); 和__max相反,__min傳回a和b中數值較小者。 stdlib.h double floor( double x

文档评论(0)

1亿VIP精品文档

相关文档