fdimのヘルプ・マニュアル
日本語 英語
fdim --help
man fdim
FDIM(3) Linux Programmer’s Manual FDIM(3)
名前
fdim, fdimf, fdiml - 正の差分を計算する
書式
#include
double fdim(double x, double y);
float fdimf(float x, float y);
long double fdiml(long double x, long double y);
-lm でリンクする。
glibc 向けの機能検査マクロの要件 (feature_test_macros(7) 参照):
fdimf(), fdiml(): _XOPEN_SOURCE >= 600 || _ISOC99_SOURCE; or
cc -std=c99
説明
これらの関数は、二つの引き数間の正の差分 max(x-y,0) を返す。
返り値
成功すると、これらの関数は正の差分を返す。
x か y が NaN の場合、NaN が返される。
結果がオーバーフローする場合、範囲エラーが発生し、各関数 は そ れ ぞ れ
HUGE_VAL, HUGE_VALF, HUGE_VALL を返す。
エラー
こ れらの関数を呼び出した際にエラーが発生したかの判定方法についての情報
は math_error(7) を参照のこと。
以下のエラーが発生する可能性がある。
範囲エラー (range error)、オーバーフローの場合
オーバーフロー浮動小数点例外 (FE_OVERFLOW) が上がる。
これらの関数は errno を設定しない。
バージョン
これらの関数は glibc バージョン 2.1 で初めて登場した。
準拠
C99, POSIX.1-2001.
関連項目
fmax(3)
2008-08-11 FDIM(3)
FDIM(3) Linux Programmer’s Manual FDIM(3)
NAME
fdim, fdimf, fdiml - positive difference
SYNOPSIS
#include
double fdim(double x, double y);
float fdimf(float x, float y);
long double fdiml(long double x, long double y);
Link with -lm.
Feature Test Macro Requirements for glibc (see feature_test_macros(7)):
fdimf(), fdiml(): _XOPEN_SOURCE >= 600 || _ISOC99_SOURCE; or
cc -std=c99
DESCRIPTION
These functions return the positive difference, max(x-y,0), between
their arguments.
RETURN VALUE
On success, these functions return the positive difference.
If x or y is a NaN, a NaN is returned.
If the result overflows, a range error occurs, and the functions return
HUGE_VAL, HUGE_VALF, or HUGE_VALL, respectively.
ERRORS
See math_error(7) for information on how to determine whether an error
has occurred when calling these functions.
The following errors can occur:
Range error: result overflow
An overflow floating-point exception (FE_OVERFLOW) is raised.
These functions do not set errno.
VERSIONS
These functions first appeared in glibc in version 2.1.
CONFORMING TO
C99, POSIX.1-2001.
SEE ALSO
fmax(3)
COLOPHON
This page is part of release 3.22 of the Linux man-pages project. A
description of the project, and information about reporting bugs, can
be found at http://www.kernel.org/doc/man-pages/.
2008-08-11 FDIM(3)