Стандарт языка Си С99 TC (1113411), страница 42
Текст из файла (страница 42)
First, an argumentrepresented in a format wider than its semantic type is converted to its semantic type.Then classification is based on the type of the argument.205)Returns3The fpclassify macro returns the value of the number classification macroappropriate to the value of its argument.4EXAMPLEThe fpclassify macro might be implemented in terms of ordinary functions as#define fpclassify(x) \((sizeof (x) == sizeof (float)) ? _ _fpclassifyf(x) : \(sizeof (x) == sizeof (double)) ? _ _fpclassifyd(x) : \_ _fpclassifyl(x))7.12.3.2 The isfinite macroSynopsis1#include <math.h>int isfinite(real-floating x);Description2The isfinite macro determines whether its argument has a finite value (zero,subnormal, or normal, and not infinite or NaN). First, an argument represented in aformat wider than its semantic type is converted to its semantic type.
Then determinationis based on the type of the argument.205) Since an expression can be evaluated with more range and precision than its type has, it is important toknow the type that classification is based on. For example, a normal long double value mightbecome subnormal when converted to double, and zero when converted to float.216Library§7.12.3.2WG14/N1256Committee Draft — Septermber 7, 2007ISO/IEC 9899:TC3Returns3The isfinite macro returns a nonzero value if and only if its argument has a finitevalue.7.12.3.3 The isinf macroSynopsis1#include <math.h>int isinf(real-floating x);Description2The isinf macro determines whether its argument value is an infinity (positive ornegative).
First, an argument represented in a format wider than its semantic type isconverted to its semantic type. Then determination is based on the type of the argument.Returns3The isinf macro returns a nonzero value if and only if its argument has an infinitevalue.7.12.3.4 The isnan macroSynopsis1#include <math.h>int isnan(real-floating x);Description2The isnan macro determines whether its argument value is a NaN.
First, an argumentrepresented in a format wider than its semantic type is converted to its semantic type.Then determination is based on the type of the argument.206)Returns3The isnan macro returns a nonzero value if and only if its argument has a NaN value.7.12.3.5 The isnormal macroSynopsis1#include <math.h>int isnormal(real-floating x);206) For the isnan macro, the type for determination does not matter unless the implementation supportsNaNs in the evaluation type but not in the semantic type.§7.12.3.5Library217ISO/IEC 9899:TC3Committee Draft — Septermber 7, 2007WG14/N1256Description2The isnormal macro determines whether its argument value is normal (neither zero,subnormal, infinite, nor NaN).
First, an argument represented in a format wider than itssemantic type is converted to its semantic type. Then determination is based on the typeof the argument.Returns3The isnormal macro returns a nonzero value if and only if its argument has a normalvalue.7.12.3.6 The signbit macroSynopsis1#include <math.h>int signbit(real-floating x);Description2The signbit macro determines whether the sign of its argument value is negative.207)Returns3The signbit macro returns a nonzero value if and only if the sign of its argument valueis negative.7.12.4 Trigonometric functions7.12.4.1 The acos functionsSynopsis1#include <math.h>double acos(double x);float acosf(float x);long double acosl(long double x);Description2The acos functions compute the principal value of the arc cosine of x. A domain erroroccurs for arguments not in the interval [−1, +1].Returns3The acos functions return arccos x in the interval [0, π ] radians.207) The signbit macro reports the sign of all values, including infinities, zeros, and NaNs.
If zero isunsigned, it is treated as positive.218Library§7.12.4.1WG14/N1256Committee Draft — Septermber 7, 2007ISO/IEC 9899:TC37.12.4.2 The asin functionsSynopsis1#include <math.h>double asin(double x);float asinf(float x);long double asinl(long double x);Description2The asin functions compute the principal value of the arc sine of x. A domain erroroccurs for arguments not in the interval [−1, +1].Returns3The asin functions return arcsin x in the interval [−π /2, +π /2] radians.7.12.4.3 The atan functionsSynopsis1#include <math.h>double atan(double x);float atanf(float x);long double atanl(long double x);Description2The atan functions compute the principal value of the arc tangent of x.Returns3The atan functions return arctan x in the interval [−π /2, +π /2] radians.7.12.4.4 The atan2 functionsSynopsis1#include <math.h>double atan2(double y, double x);float atan2f(float y, float x);long double atan2l(long double y, long double x);Description2The atan2 functions compute the value of the arc tangent of y/x, using the signs of botharguments to determine the quadrant of the return value.
A domain error may occur ifboth arguments are zero.Returns3The atan2 functions return arctan y/x in the interval [−π , +π ] radians.§7.12.4.4Library219ISO/IEC 9899:TC3Committee Draft — Septermber 7, 2007WG14/N12567.12.4.5 The cos functionsSynopsis1#include <math.h>double cos(double x);float cosf(float x);long double cosl(long double x);Description2The cos functions compute the cosine of x (measured in radians).Returns3The cos functions return cos x.7.12.4.6 The sin functionsSynopsis1#include <math.h>double sin(double x);float sinf(float x);long double sinl(long double x);Description2The sin functions compute the sine of x (measured in radians).Returns3The sin functions return sin x.7.12.4.7 The tan functionsSynopsis1#include <math.h>double tan(double x);float tanf(float x);long double tanl(long double x);Description2The tan functions return the tangent of x (measured in radians).Returns3The tan functions return tan x.220Library§7.12.4.7WG14/N1256Committee Draft — Septermber 7, 2007ISO/IEC 9899:TC37.12.5 Hyperbolic functions7.12.5.1 The acosh functionsSynopsis1#include <math.h>double acosh(double x);float acoshf(float x);long double acoshl(long double x);Description2The acosh functions compute the (nonnegative) arc hyperbolic cosine of x.
A domainerror occurs for arguments less than 1.Returns3The acosh functions return arcosh x in the interval [0, +∞].7.12.5.2 The asinh functionsSynopsis1#include <math.h>double asinh(double x);float asinhf(float x);long double asinhl(long double x);Description2The asinh functions compute the arc hyperbolic sine of x.Returns3The asinh functions return arsinh x.7.12.5.3 The atanh functionsSynopsis1#include <math.h>double atanh(double x);float atanhf(float x);long double atanhl(long double x);Description2The atanh functions compute the arc hyperbolic tangent of x. A domain error occursfor arguments not in the interval [−1, +1].
A range error may occur if the argumentequals −1 or +1.§7.12.5.3Library221ISO/IEC 9899:TC3Committee Draft — Septermber 7, 2007WG14/N1256Returns3The atanh functions return artanh x.7.12.5.4 The cosh functionsSynopsis1#include <math.h>double cosh(double x);float coshf(float x);long double coshl(long double x);Description2The cosh functions compute the hyperbolic cosine of x. A range error occurs if themagnitude of x is too large.Returns3The cosh functions return cosh x.7.12.5.5 The sinh functionsSynopsis1#include <math.h>double sinh(double x);float sinhf(float x);long double sinhl(long double x);Description2The sinh functions compute the hyperbolic sine of x.
A range error occurs if themagnitude of x is too large.Returns3The sinh functions return sinh x.7.12.5.6 The tanh functionsSynopsis1#include <math.h>double tanh(double x);float tanhf(float x);long double tanhl(long double x);Description2The tanh functions compute the hyperbolic tangent of x.222Library§7.12.5.6WG14/N1256Committee Draft — Septermber 7, 2007ISO/IEC 9899:TC3Returns3The tanh functions return tanh x.7.12.6 Exponential and logarithmic functions7.12.6.1 The exp functionsSynopsis1#include <math.h>double exp(double x);float expf(float x);long double expl(long double x);Description2The exp functions compute the base-e exponential of x.
A range error occurs if themagnitude of x is too large.Returns3The exp functions return ex .7.12.6.2 The exp2 functionsSynopsis1#include <math.h>double exp2(double x);float exp2f(float x);long double exp2l(long double x);Description2The exp2 functions compute the base-2 exponential of x. A range error occurs if themagnitude of x is too large.Returns3The exp2 functions return 2x .7.12.6.3 The expm1 functionsSynopsis1#include <math.h>double expm1(double x);float expm1f(float x);long double expm1l(long double x);§7.12.6.3Library223ISO/IEC 9899:TC3Committee Draft — Septermber 7, 2007WG14/N1256Description2The expm1 functions compute the base-e exponential of the argument, minus 1.