Global functions

This alphabetical list contains functions, macros, and constants. The summaries mention all exceptional cases; an exception not mentioned will not be raised. These symbols are used throughout this chapter:

Abs returns , the absolute value of its argument, by forcing it to have a positive sign. It raises no exceptions.

AddHalfTruncate returns , where s is the sign of the argument x. It raises inexact when its result differs from x.

AddHalfTruncatetoLong returns the value , where s is the sign of the argument x, converted to a long. It raises inexact when its result differs from x because of rounding. It raises invalid when the mathematical result cannot be held exactly in the long format.

Annuity returns the value of the financial formula . It is called as Annuity(r, n), where r is the rate and n the number of periods. Annuity is robust and accurate over the full range of mathematically meaningful r and n, regardless of the financial interpretation.

Annuity raises invalid for rates less than -1. The case depends on n:

Otherwise, , and, when , . Annuity raises inexact in all other cases. Annuity can raise overflow or underflow.

ArcCos returns the inverse cosine in radians of its argument x. ArcCos raises invalid for or . It raises inexact for all values except 1. ArcCos returns values between zero and .

ArcCosh returns the inverse hyperbolic cosine of its argument x. ArcCosh raises invalid for . It raises inexact for finite x except 1. , but ArcCosh never overflows. Its value at the largest double number is
approximately 710.

ArcSin returns the inverse sine in radians of its argument x. ArcSin raises invalid for or . It raises inexact for all values except zero and raises underflow for x near zero. ArcSin returns values between and .

ArcSinh returns the inverse hyperbolic sine of its argument x. It raises inexact for all finite x except zero. and . ArcSinh raises underflow for x near 0.

ArcTan returns the inverse tangent in radians of its argument x. It raises inexact for all x except zero. and . ArcTan returns values between and . It raises underflow for x near 0.

When called as ArcTan(y, x), ArcTan returns the inverse tangent of , using the algebraic signs of the arguments to determine the quadrant of the return value. In this case, ArcTan returns results in the range to .

ArcTanh returns the hyperbolic arctangent of its argument x. ArcTanh raises invalid for or . It raises inexact for all valid arguments except zero. and . Although ArcTanh is steeply sloped and asymptotic with the lines and , it never raises overflow. For example, ArcTanh(NextDouble(1.0, 0.0)) is less than 19.

Ceiling returns , the smallest integral value no less than its argument x. It raises inexact when its result differs from x.

Compound returns the value of the financial formula . It is called in the form Compound(r, n), where r is the rate and n the number of periods. Compound is robust and accurate over the full range of mathematically meaningful r and n, regardless of the financial interpretation.

Compound raises invalid for . The case depends on n:

Otherwise, . . When and n is infinite, Compound raises invalid. Compound can raise inexact, underflow, or overflow.

CopySign, called as CopySign(x, y), returns the floating-point value whose sign is that of y and whose exponent and significand are those of x. It raises no exceptions.

Cos returns the cosine of its argument x in radians. Cos raises inexact for all finite arguments except zero. It is periodic with period , rounded to the precision of the computation. Cos raises invalid when x is infinite.

Cosh returns the hyperbolic cosine of its argument x. Cosh is inexact for all finite arguments except zero. . Cosh raises overflow for finite values of large magnitude.

Erf returns , the error function of its argument x. Erf raises inexact for all finite arguments except zero, where its value is zero. and . Erf raises underflow for x near zero.

Erfc returns , the complementary error function of its argument x. Erfc raises inexact for all finite arguments except zero, where its value is 1. and . Erfc raises underflow for x near .

Exp returns , the exponential of its argument x. Exp is inexact for finite arguments other than zero. and . Exp raises overflow for large, positive, finite x and underflow for large, negative, finite x.

Exp2 returns , two raised to the power of its argument x. Because , Exp2 shares the limiting properties of Exp. Exp2 is inexact for finite arguments other than zero (and, perhaps, integer values for which Exp2 neither underflows nor overflows). and . Exp2 raises overflow for large, positive, finite x and underflow for large, negative, finite x.

ExpMinus1 returns , given the argument x. While accurate for all arguments, ExpMinus1 avoids loss of accuracy when is nearly zero (and is nearly 1). ExpMinus1 is inexact for all finite arguments except zero. and . ExpMinus1 raises overflow for large, positive, finite x and underflow for x near zero.

Floor returns , the greatest integral value less than or equal to its argument x. It raises inexact when its result differs from x.

FPClassify returns an element of the enumerated type EFPNumberKind indicating the nature of its argument x: kFPNaN, kFPInfinite, kFPNormal, kFPSubnormal, or kFPZero.

Gamma returns , the gamma function applied to its argument x. Gamma raises inexact for all non-integral arguments. It raises invalid for non-positive integral arguments. for positive integral arguments, with defined to be . . Gamma can raise overflow.

Hash returns a long hash value corresponding to its argument x. Hash supports the use of tables of floating-point values.

Hypotenuse, called as Hypotenuse(x, y), returns , taking care to avoid spurious underflow and overflow. It can raise inexact, underflow, and overflow.

IsFinite returns true when its argument x is finite, that is, x is zero, subnormal, or normal. It returns false when x is infinite or a NaN. It raises no exceptions.

IsGreater, called as IsGreater(x, y), returns true when and false when or when x and y are unordered. IsGreater raises no exceptions.

IsGreaterEqual, called as IsGreaterEqual(x, y), returns true when and false when or when x and y are unordered. IsGreaterEqual raises no exceptions.

IsInfinite returns true when its argument x is or . It returns false when x is zero, subnormal, normal, or a NaN. It raises no exceptions.

IsLess, called as IsLess(x, y), returns true when and false when or when x and y are unordered. IsLess raises no exceptions.

IsLessEqual, called as IsLessEqual(x, y), returns true when and false when or when x and y are unordered. IsLessEqual raises no exceptions.

IsLessGreater, called as IsLessGreater(x, y), returns true when or , and false when or when x and y are unordered. IsLessGreater raises no exceptions.

IsNaN returns true when its argument x is a NaN. It returns false when x is zero, subnormal, normal, or infinite. It raises no exceptions.

IsNormal returns true when its argument x is normal. It returns false when x is zero, subnormal, infinite, or a NaN. It raises no exceptions.

IsSignNegative returns true when the sign bit of its argument x is 1; that is, x is , , or x is a NaN with negative sign. It returns false when the sign bit of x is 0. It raises no exceptions.

IsUnordered, called as IsUnordered(x, y), returns true when x and y are unordered and false when or . IsUnordered raises no exceptions.

kDegreesToRadians is the value in the double_t format. When d is in units of degrees, has units of radians.

kDegreesToRadiansLongDouble is the value in the long double format.

kInfinity is the floating-point value .

kNaN is a NaN.

kPi is the value in the double_t format.

kPiLongDouble is the value in the long double format.

kRadiansToDegrees is the value in the double_t format. When r is in units of radians, has units of degrees.

kRadiansToDegreesLongDouble is the value in the long double format.

Log returns the natural logarithm of its argument x. Log raises inexact for all positive, finite arguments except 1. Log raises invalid for all arguments . Although and , Log never underflows or overflows. Log(0) raises divide-by-zero.

Log10 returns the logarithm base 10 of its argument x. Because , Log10 shares the computational properties of Log.

Log1Plus returns , given the argument x. While accurate for all values no less than , Log1Plus is devised to preserve accuracy when its argument is nearly zero--when explicitly performing the sum would sacrifice low-order bits of . Log1Plus raises inexact for all finite arguments greater than except 0. and raises divide-by-zero. . Log1Plus raises invalid for . Log1Plus raises underflow for x near zero.

Log2 returns the logarithm base 2 of its argument x. Because , Log2 shares the computational properties of Log.

Logb returns the integral value k such that , for argument x. and raises divide-by-zero. .

LogGamma returns , the log of the gamma function applied to its argument x. LogGamma raises inexact for all finite arguments. It raises divide-by-zero for non-positive integral arguments. Gamma can raise overflow; LogGamma cannot.

Max, called as Max(x, y), returns the larger of x and y. When one is a NaN, it returns the other. When both are NaNs it returns one of them. Max raises no flags.

Min, called as Min(x, y), returns the smaller of x and y. When one is a NaN, it returns the other. When both are NaNs it returns one of them. Min raises no flags.

NaN returns a NaN whose significand depends in a platform-dependent way on its TText argument.

NearbyInt returns the integral value nearest its argument x, according to the current rounding mode:

NearbyInt never raises a flag; it is the same as RoundIEEE except that RoundIEEE raises inexact when its result differs from x.

NextAfter, called as NextAfter(x, y), returns, in the format of x, the number adjacent to x toward y. When , NextAfter returns x. When x or y is a NaN, NextAfter returns one of the input NaNs. When x is finite but the result is infinite, NextAfter raises overflow and inexact. When the result is subnormal or zero, NextAfter raises underflow and inexact.

NextDouble is a variant of NextAfter in which both arguments are of type double.

NextFloat is a variant of NextAfter in which both arguments are of type float.

NextLongDouble is a variant of NextAfter in which both arguments are of type long double.

PositiveDifference, called as PositiveDifference(x, y), returns when and returns otherwise. It can raise inexact and overflow.

Power, called as Power(x, y), returns . When , Power raises invalid unless y is an integral value. It can raise inexact, underflow, overflow, and invalid.

Remainder, called as Remainder(x, y), returns the exact difference , where n is the nearest mathematical integer to in the sense of rounding to nearest. Note that n can be huge--even thousands of bits wide--when x is much larger than y in magnitude. The result is no greater than in magnitude; when it is zero it has sign of x. Remainder raises invalid when y is zero or x is infinite. Remainder never raises inexact, underflow, or overflow.

Called as Remainder(x, y, &q), Remainder returns its result as above along with several low-order bits of the quotient n through the reference argument q. These bits are useful for some forms of argument reduction. See the example "Sin(huge)" on page 228.

Rint is a pseudonym for RoundIEEE.

RintToLong is a pseudonym for RoundToLongIEEE.

Round is a pseudonym for AddHalfTruncate.

RoundIEEE is identical to NearbyInt, except that it raises inexact when its result differs from its argument x.

RoundToLong is a pseudonym for AddHalfTruncateToLong.

RoundToLongIEEE returns the integral value nearest its argument x, converted to a long, according to the current rounding mode:

RoundToLongIEEE raises inexact when its result differs from x. It raises invalid when the mathematical result cannot be held exactly in the long format.

Scalb, called as Scalb(x, n), returns . It avoids explicit computation of , and so avoids possible underflow or overflow in cases where the result is within range but isn't. Scalb can raise inexact, underflow, or overflow. Scalb and Logb are related as shown in "Manipulating numbers without arithmetic" on page 199: for finite, nonzero x.

Sin returns the sine of its argument x in radians. Sin raises inexact for all finite arguments except zero. It is periodic with period . Sin raises invalid when x is infinite. Sin raises underflow for small x.

Sinh returns the hyperbolic sine of its argument x. Sinh raises inexact for all finite arguments except zero. and . Sinh raises overflow for finite values of large magnitude. Sinh raises underflow for small x.

Square returns , the square of its argument x. It can raise inexact, underflow, or overflow.

SquareRoot returns , the square root of its argument x. It raises invalid for . It can raise inexact. .

Tan returns the tangent of the radian measure of its argument x. It is periodic with period . Tan raises invalid when x is infinite. Tan raises inexact for all finite, nonzero arguments, and raises underflow for values near zero.

Tanh returns the hyperbolic tangent of its argument x. and . It can raise inexact or underflow.

Truncate returns , where s is the sign of the argument x. It raises inexact when its result differs from x.


[Contents] [Previous] [Next]
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.

Generated with WebMaker