Language

The Free and Open Productivity Suite
Released: Apache OpenOffice 4.1.15

API

SDK

Tips ‘n’ Tricks

Miscellaneous


Global Functions in Namespace math
in Sourcefile math.hxx


acosh
double acosh(
double fValue );

virtual abstract const volatile template static inline C-linkage
NO NO NO NO NO NO YES NO

Summary
A wrapper around rtl_math_acosh.

approxAdd
double approxAdd(
double a,
double b );

virtual abstract const volatile template static inline C-linkage
NO NO NO NO NO NO YES NO

Summary
Add two values.
Description
If signs differ and the absolute values are equal according to approxEqual() the method returns 0.0 instead of calculating the sum. If you wanted to sum up multiple values it would be convenient not to call approxAdd() for each value but instead remember the first value not equal to 0.0, add all other values using normal + operator, and with the result and the remembered value call approxAdd().

approxCeil
double approxCeil(
double a );

virtual abstract const volatile template static inline C-linkage
NO NO NO NO NO NO YES NO

Summary
ceil()method taking approxValue() into account.
Description
Use for expected integer values being calculated by double functions.

approxEqual
bool approxEqual(
double a,
double b );

virtual abstract const volatile template static inline C-linkage
NO NO NO NO NO NO YES NO

Summary
Test equality of two values with an accuracy of the magnitude of the given values scaled by 2^-48 (4 bits roundoff stripped).
ATTENTION!
approxEqual( value!=0.0, 0.0 ) _never_ yields true.

approxFloor
double approxFloor(
double a );

virtual abstract const volatile template static inline C-linkage
NO NO NO NO NO NO YES NO

Summary
floor()method taking approxValue() into account.
Description
Use for expected integer values being calculated by double functions.

approxSub
double approxSub(
double a,
double b );

virtual abstract const volatile template static inline C-linkage
NO NO NO NO NO NO YES NO

Summary
Substract two values (a-b).
Description
If signs are identical and the values are equal according to approxEqual() the method returns 0.0 instead of calculating the substraction.

approxValue
double approxValue(
double fValue );

virtual abstract const volatile template static inline C-linkage
NO NO NO NO NO NO YES NO

Summary
A wrapper around rtl_math_approxValue.

asinh
double asinh(
double fValue );

virtual abstract const volatile template static inline C-linkage
NO NO NO NO NO NO YES NO

Summary
A wrapper around rtl_math_asinh.

atanh
double atanh(
double fValue );

virtual abstract const volatile template static inline C-linkage
NO NO NO NO NO NO YES NO

Summary
A wrapper around rtl_math_atanh.

cos
double cos(
double d );

virtual abstract const volatile template static inline C-linkage
NO NO NO NO NO NO YES NO

Summary
Safe cos(), returns NAN if not valid.

doubleToString
rtl::OString doubleToString(
double fValue,
rtl_math_StringFormat eFormat,
sal_Int32 nDecPlaces,
sal_Char cDecSeparator,
const sal_Int32 * pGroups,
sal_Char cGroupSeparator,
bool bEraseTrailingDecZeros = false );

virtual abstract const volatile template static inline C-linkage
NO NO NO NO NO NO YES NO

Summary
A wrapper around rtl_math_doubleToString.

doubleToString
rtl::OString doubleToString(
double fValue,
rtl_math_StringFormat eFormat,
sal_Int32 nDecPlaces,
sal_Char cDecSeparator,
bool bEraseTrailingDecZeros = false );

virtual abstract const volatile template static inline C-linkage
NO NO NO NO NO NO YES NO

Summary
A wrapper around rtl_math_doubleToString, with no grouping.

doubleToUString
rtl::OUString doubleToUString(
double fValue,
rtl_math_StringFormat eFormat,
sal_Int32 nDecPlaces,
sal_Unicode cDecSeparator,
const sal_Int32 * pGroups,
sal_Unicode cGroupSeparator,
bool bEraseTrailingDecZeros = false );

virtual abstract const volatile template static inline C-linkage
NO NO NO NO NO NO YES NO

Summary
A wrapper around rtl_math_doubleToUString.

doubleToUString
rtl::OUString doubleToUString(
double fValue,
rtl_math_StringFormat eFormat,
sal_Int32 nDecPlaces,
sal_Unicode cDecSeparator,
bool bEraseTrailingDecZeros = false );

virtual abstract const volatile template static inline C-linkage
NO NO NO NO NO NO YES NO

Summary
A wrapper around rtl_math_doubleToUString, with no grouping.

doubleToUStringBuffer
void doubleToUStringBuffer(
rtl::OUStringBuffer & rBuffer,
double fValue,
rtl_math_StringFormat eFormat,
sal_Int32 nDecPlaces,
sal_Unicode cDecSeparator,
const sal_Int32 * pGroups,
sal_Unicode cGroupSeparator,
bool bEraseTrailingDecZeros = false );

virtual abstract const volatile template static inline C-linkage
NO NO NO NO NO NO YES NO

Summary
A wrapper around rtl_math_doubleToUString that appends to an rtl::OUStringBuffer.

doubleToUStringBuffer
void doubleToUStringBuffer(
rtl::OUStringBuffer & rBuffer,
double fValue,
rtl_math_StringFormat eFormat,
sal_Int32 nDecPlaces,
sal_Unicode cDecSeparator,
bool bEraseTrailingDecZeros = false );

virtual abstract const volatile template static inline C-linkage
NO NO NO NO NO NO YES NO

Summary
A wrapper around rtl_math_doubleToUString that appends to an rtl::OUStringBuffer, with no grouping.

erf
double erf(
double fValue );

virtual abstract const volatile template static inline C-linkage
NO NO NO NO NO NO YES NO

Summary
A wrapper around rtl_math_erf.

erfc
double erfc(
double fValue );

virtual abstract const volatile template static inline C-linkage
NO NO NO NO NO NO YES NO

Summary
A wrapper around rtl_math_erfc.

expm1
double expm1(
double fValue );

virtual abstract const volatile template static inline C-linkage
NO NO NO NO NO NO YES NO

Summary
A wrapper around rtl_math_expm1.

isFinite
bool isFinite(
double d );

virtual abstract const volatile template static inline C-linkage
NO NO NO NO NO NO YES NO

Summary
Tests whether a value is neither INF nor NAN.

isInf
bool isInf(
double d );

virtual abstract const volatile template static inline C-linkage
NO NO NO NO NO NO YES NO

Summary
If a value represents +INF or -INF.
Description
The sign bit may be queried with isSignBitSet(). If isFinite(d)==false and isInf(d)==false then NAN.

isNan
bool isNan(
double d );

virtual abstract const volatile template static inline C-linkage
NO NO NO NO NO NO YES NO

Summary
Test on any QNAN or SNAN.

isSignBitSet
bool isSignBitSet(
double d );

virtual abstract const volatile template static inline C-linkage
NO NO NO NO NO NO YES NO

Summary
If the sign bit is set.

isValidArcArg
bool isValidArcArg(
double d );

virtual abstract const volatile template static inline C-linkage
NO NO NO NO NO NO YES NO

Summary
If a value is a valid argument for sin(), cos(), tan().
Description
IEEE 754 specifies that absolute values up to 2^64 (=1.844e19) for the radian must be supported by trigonometric functions. Unfortunately, at least on x86 architectures, the FPU doesn't generate an error pattern for values >2^64 but produces erroneous results instead and sets only the "invalid operation" (IM) flag in the status word :-( Thus the application has to handle it itself.

log1p
double log1p(
double fValue );

virtual abstract const volatile template static inline C-linkage
NO NO NO NO NO NO YES NO

Summary
A wrapper around rtl_math_log1p.

pow10Exp
double pow10Exp(
double fValue,
int nExp );

virtual abstract const volatile template static inline C-linkage
NO NO NO NO NO NO YES NO

Summary
A wrapper around rtl_math_pow10Exp.

round
double round(
double fValue,
int nDecPlaces = 0,
rtl_math_RoundingMode eMode = rtl_math_RoundingMode_Corrected );

virtual abstract const volatile template static inline C-linkage
NO NO NO NO NO NO YES NO

Summary
A wrapper around rtl_math_round.

setInf
void setInf(
double * pd,
bool bNegative );

virtual abstract const volatile template static inline C-linkage
NO NO NO NO NO NO YES NO

Summary
Set to +INF if bNegative==false or -INF if bNegative==true.

setNan
void setNan(
double * pd );

virtual abstract const volatile template static inline C-linkage
NO NO NO NO NO NO YES NO

Summary
Set a QNAN.

sin
double sin(
double d );

virtual abstract const volatile template static inline C-linkage
NO NO NO NO NO NO YES NO

Summary
Safe sin(), returns NAN if not valid.

stringToDouble
double stringToDouble(
const rtl::OString & rString,
sal_Char cDecSeparator,
sal_Char cGroupSeparator,
rtl_math_ConversionStatus * pStatus,
sal_Int32 * pParsedEnd );

virtual abstract const volatile template static inline C-linkage
NO NO NO NO NO NO YES NO

Summary
A wrapper around rtl_math_stringToDouble.

stringToDouble
double stringToDouble(
const rtl::OUString & rString,
sal_Unicode cDecSeparator,
sal_Unicode cGroupSeparator,
rtl_math_ConversionStatus * pStatus,
sal_Int32 * pParsedEnd );

virtual abstract const volatile template static inline C-linkage
NO NO NO NO NO NO YES NO

Summary
A wrapper around rtl_math_uStringToDouble.

tan
double tan(
double d );

virtual abstract const volatile template static inline C-linkage
NO NO NO NO NO NO YES NO

Summary
Safe tan(), returns NAN if not valid.

Top of Page

Apache Software Foundation

Copyright & License | Privacy | Contact Us | Donate | Thanks

Apache, OpenOffice, OpenOffice.org and the seagull logo are registered trademarks of The Apache Software Foundation. The Apache feather logo is a trademark of The Apache Software Foundation. Other names appearing on the site may be trademarks of their respective owners.