expm1のヘルプ・マニュアル
日本語 英語
expm1 --help
man expm1
EXPM1(3) Linux Programmer’s Manual EXPM1(3)
名前
expm1, expm1f, expm1l - 引き数の指数から 1 を引いた値
書式
#include
double expm1(double x);
float expm1f(float x);
long double expm1l(long double x);
-lm でリンクする。
glibc 向けの機能検査マクロの要件 (feature_test_macros(7) 参照):
expm1(): _BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE >= 500 ||
_ISOC99_SOURCE; or cc -std=c99
expm1f(), expm1l(): _BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE >= 600
|| _ISOC99_SOURCE; or cc -std=c99
説明
expm1(x) は以下と等しい値を返す。
exp(x) - 1
x が 0 に近く、 exp(x) - 1 が引き算時の桁落ちのために不正確となるような
場合でも、正確な値が計算できる方法が用いられる。
返り値
成功すると、これらの関数は exp(x) - 1 を返す。
x が NaN の場合、NaN が返される。
x が +0 (-0) の場合、+0 (-0) が返される。
x が正の無限大の場合、正の無限大が返される。
x が負の無限大の場合、-1 が返される。
結果がオーバーフローする場合、範囲エラー (range error) が発生し、各関数
はそれぞれ -HUGE_VAL, -HUGE_VALF, -HUGE_VALL を返す。
エラー
こ れらの関数を呼び出した際にエラーが発生したかの判定方法についての情報
は math_error(7) を参照のこと。
以下のエラーが発生する可能性がある。
範囲エラー (range error)、オーバーフローの場合
オーバーフロー浮動小数点例外 (FE_OVERFLOW) が上がる。
これらの関数は errno を設定しない。
準拠
C99, POSIX.1-2001.
バグ
x が負の大きな値の場合 (この場合には関数の結果は -1 に近付いてい く) 、
expm1() は間違ってアンダーフロー浮動小数点例外を上げることがある。
x が正の大きな値の場合、 expm1() は期待通りのオーバーフロー例外だけでな
く間違って不正 (invalid) 浮動小数点例外を上げ、正の無限大ではな く NaN
を返すことがある。
関連項目
exp(3), log(3), log1p(3)
2008-08-05 EXPM1(3)
EXPM1(3) Linux Programmer’s Manual EXPM1(3)
NAME
expm1, expm1f, expm1l - exponential minus 1
SYNOPSIS
#include
double expm1(double x);
float expm1f(float x);
long double expm1l(long double x);
Link with -lm.
Feature Test Macro Requirements for glibc (see feature_test_macros(7)):
expm1(): _BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE >= 500 ||
_ISOC99_SOURCE; or cc -std=c99
expm1f(), expm1l(): _BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE >= 600
|| _ISOC99_SOURCE; or cc -std=c99
DESCRIPTION
expm1(x) returns a value equivalent to
exp(x) - 1
It is computed in a way that is accurate even if the value of x is near
zero—a case where exp(x) - 1 would be inaccurate due to subtraction of
two numbers that are nearly equal.
RETURN VALUE
On success, these functions return exp(x) - 1.
If x is a NaN, a NaN is returned.
If x is +0 (-0), +0 (-0) is returned.
If x is positive infinity, positive infinity is returned.
If x is negative infinity, -1 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, overflow
An overflow floating-point exception (FE_OVERFLOW) is raised.
These functions do not set errno.
CONFORMING TO
C99, POSIX.1-2001.
BUGS
For some large negative x values (where the function result approaches
-1), expm1() raises a bogus underflow floating-point exception.
For some large positive x values, expm1() raises a bogus invalid float-
ing-point exception in addition to the expected overflow exception, and
returns a NaN instead of positive infinity.
SEE ALSO
exp(3), log(3), log1p(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-05 EXPM1(3)