modfのヘルプ・マニュアル
日本語 英語
modf --help
man modf
MODF(3) Linux Programmer’s Manual MODF(3)
名前
modf, modff, modfl - 浮動小数点実数から、符号付き整数と小数部分を取り出
す関数
書式
#include
double modf(double x, double *iptr);
float modff(float x, float *iptr);
long double modfl(long double x, long double *iptr);
-lm でリンクする。
glibc 向けの機能検査マクロの要件 (feature_test_macros(7) 参照):
modf(), modl(): _BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE >= 600 ||
_ISOC99_SOURCE; or cc -std=c99
説明
modf() 関数は、引数 x を整数部分と小数部分に分割する。このとき、ふたつ
の値はともに x と同じ符号を持つ。整数部分は iptr が指す場所に格納される
。
返り値
modf() 関数は x の小数部分を返す。
x が NaN の場合、NaN が返され、 *iptr に NaN が設定される。
x が正の無限大 (負の無限大) の場合、 +0 (-0) が返され、 *iptr に正の無
限大 (負の無限大) が設定される。
エラー
エラーは発生しない。
準拠
C99, POSIX.1-2001. double 版の関数は SVr4, 4.3BSD, C89 にも準拠して い
る。
関連項目
frexp(3), ldexp(3)
2008-08-05 MODF(3)
MODF(3) Linux Programmer’s Manual MODF(3)
NAME
modf, modff, modfl - extract signed integral and fractional values from
floating-point number
SYNOPSIS
#include
double modf(double x, double *iptr);
float modff(float x, float *iptr);
long double modfl(long double x, long double *iptr);
Link with -lm.
Feature Test Macro Requirements for glibc (see feature_test_macros(7)):
modf(), modl(): _BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE >= 600 ||
_ISOC99_SOURCE; or cc -std=c99
DESCRIPTION
The modf() function breaks the argument x into an integral part and a
fractional part, each of which has the same sign as x. The integral
part is stored in the location pointed to by iptr.
RETURN VALUE
The modf() function returns the fractional part of x.
If x is a NaN, a NaN is returned, and *iptr is set to a NaN.
If x is positive infinity (negative infinity), +0 (-0) is returned, and
*iptr is set to positive infinity (negative infinity).
ERRORS
No errors occur.
CONFORMING TO
C99, POSIX.1-2001. The variant returning double also conforms to SVr4,
4.3BSD, C89.
SEE ALSO
frexp(3), ldexp(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 MODF(3)