AlterOffice
AlterOffice 3.4 SDK C/C++ API Reference
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
math.h
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 
3 
4 #ifndef INCLUDED_RTL_MATH_H
5 #define INCLUDED_RTL_MATH_H
6 
7 #include "sal/config.h"
8 
9 #include "rtl/ustring.h"
10 #include "sal/saldllapi.h"
11 #include "sal/types.h"
12 
13 #if defined __cplusplus
14 extern "C" {
15 #endif /* __cplusplus */
16 
21 {
25 
29 
34 
39 
44 
49 
54 
59 
61  rtl_math_StringFormat_FORCE_EQUAL_SIZE = SAL_MAX_ENUM
63 };
64 
68 {
72 
76 
78  rtl_math_ConversionStatus_FORCE_EQUAL_SIZE = SAL_MAX_ENUM
80 };
81 
85 {
89 
93 
97 
101 
105 
109 
113 
117 
119  rtl_math_RoundingMode_FORCE_EQUAL_SIZE = SAL_MAX_ENUM
121 };
122 
127 {
131 
137 };
138 
139 
204 SAL_DLLPUBLIC void SAL_CALL rtl_math_doubleToString(rtl_String ** pResult,
205  sal_Int32 * pResultCapacity,
206  sal_Int32 nResultOffset, double fValue,
207  enum rtl_math_StringFormat eFormat,
208  sal_Int32 nDecPlaces,
209  char cDecSeparator,
210  sal_Int32 const * pGroups,
211  char cGroupSeparator,
212  sal_Bool bEraseTrailingDecZeros)
214 
279 SAL_DLLPUBLIC void SAL_CALL rtl_math_doubleToUString(rtl_uString ** pResult,
280  sal_Int32 * pResultCapacity,
281  sal_Int32 nResultOffset, double fValue,
282  enum rtl_math_StringFormat eFormat,
283  sal_Int32 nDecPlaces,
284  sal_Unicode cDecSeparator,
285  sal_Int32 const * pGroups,
286  sal_Unicode cGroupSeparator,
287  sal_Bool bEraseTrailingDecZeros)
289 
325 SAL_DLLPUBLIC double SAL_CALL rtl_math_stringToDouble(
326  char const * pBegin, char const * pEnd, char cDecSeparator,
327  char cGroupSeparator, enum rtl_math_ConversionStatus * pStatus,
328  char const ** pParsedEnd) SAL_THROW_EXTERN_C();
329 
366  sal_Unicode const * pBegin, sal_Unicode const * pEnd,
367  sal_Unicode cDecSeparator, sal_Unicode cGroupSeparator,
368  enum rtl_math_ConversionStatus * pStatus, sal_Unicode const ** pParsedEnd)
370 
384 SAL_DLLPUBLIC double SAL_CALL rtl_math_round(double fValue, int nDecPlaces,
385  enum rtl_math_RoundingMode eMode)
387 
400 SAL_DLLPUBLIC double SAL_CALL rtl_math_pow10Exp(double fValue, int nExp) SAL_THROW_EXTERN_C();
401 
407 SAL_DLLPUBLIC double SAL_CALL rtl_math_approxValue(double fValue) SAL_THROW_EXTERN_C();
408 
417 SAL_DLLPUBLIC bool SAL_CALL rtl_math_approxEqual(double a, double b) SAL_THROW_EXTERN_C();
418 
426 SAL_DLLPUBLIC double SAL_CALL rtl_math_expm1(double fValue) SAL_THROW_EXTERN_C();
427 
435 SAL_DLLPUBLIC double SAL_CALL rtl_math_log1p(double fValue) SAL_THROW_EXTERN_C();
436 
445 SAL_DLLPUBLIC double SAL_CALL rtl_math_atanh(double fValue) SAL_THROW_EXTERN_C();
446 
454 SAL_DLLPUBLIC double SAL_CALL rtl_math_erf(double fValue) SAL_THROW_EXTERN_C();
455 
463 SAL_DLLPUBLIC double SAL_CALL rtl_math_erfc(double fValue) SAL_THROW_EXTERN_C();
464 
472 SAL_DLLPUBLIC double SAL_CALL rtl_math_asinh(double fValue) SAL_THROW_EXTERN_C();
473 
481 SAL_DLLPUBLIC double SAL_CALL rtl_math_acosh(double fValue) SAL_THROW_EXTERN_C();
482 
483 #if defined __cplusplus
484 }
485 #endif /* __cplusplus */
486 
487 #endif /* INCLUDED_RTL_MATH_H */
488 
489 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
IEEE rounding mode (statistical).
Definition: math.h:116
Value to be used with rtl_math_StringFormat_G.
Definition: math.h:136
Same 'G', but with only 2 minimum digits in exponent.
Definition: math.h:58
Ceil of absolute value, signed return (commercial).
Definition: math.h:96
unsigned char sal_Bool
Definition: types.h:18
Conversion was successful.
Definition: math.h:71
SAL_DLLPUBLIC double rtl_math_atanh(double fValue) SAL_THROW_EXTERN_C()
Returns more accurate atanh(x) for x near 0 than calculating 0.5*log((1+x)/(1-x)).
SAL_DLLPUBLIC double rtl_math_expm1(double fValue) SAL_THROW_EXTERN_C()
Returns more accurate e^x-1 for x near 0 than calculating directly.
SAL_DLLPUBLIC double rtl_math_log1p(double fValue) SAL_THROW_EXTERN_C()
Returns more accurate log(1+x) for x near 0 than calculating directly.
rtl_math_ConversionStatus
Status for rtl_math_stringToDouble and rtl_math_uStringToDouble.
Definition: math.h:67
SAL_DLLPUBLIC double rtl_math_approxValue(double fValue) SAL_THROW_EXTERN_C()
Rounds value to 15 significant decimal digits.
Ceil of signed value.
Definition: math.h:104
SAL_DLLPUBLIC double rtl_math_erf(double fValue) SAL_THROW_EXTERN_C()
Returns values of the Errorfunction erf.
sal_uInt16 sal_Unicode
Definition: types.h:103
Frac < 0.5 ? floor of abs : ceil of abs, signed return (mathematical).
Definition: math.h:112
SAL_DLLPUBLIC double rtl_math_acosh(double fValue) SAL_THROW_EXTERN_C()
Returns values of the inverse hyperbolic cosine.
CPPU_DLLPUBLIC void SAL_THROW_EXTERN_C()
This method is called to wait for a reply of a previously sent request.
Like sprintf() f.
Definition: math.h:28
SAL_DLLPUBLIC double rtl_math_erfc(double fValue) SAL_THROW_EXTERN_C()
Returns values of the complement Errorfunction erfc.
SAL_DLLPUBLIC double rtl_math_pow10Exp(double fValue, int nExp) SAL_THROW_EXTERN_C()
Scales fVal to a power of 10 without calling pow() or div() for nExp values between -16 and +16...
Conversion caused overflow or underflow.
Definition: math.h:75
SAL_DLLPUBLIC double rtl_math_stringToDouble(char const *pBegin, char const *pEnd, char cDecSeparator, char cGroupSeparator, enum rtl_math_ConversionStatus *pStatus, char const **pParsedEnd) SAL_THROW_EXTERN_C()
Conversion analogous to strtod(), convert a string representing a decimal number into a double value...
Like sprintf() E.
Definition: math.h:24
Floor of absolute value, signed return (commercial).
Definition: math.h:92
rtl_math_StringFormat
Formatting modes for rtl_math_doubleToString and rtl_math_doubleToUString and rtl_math_doubleToUStrin...
Definition: math.h:20
Same 'E', but with only 1 minimum digits in exponent.
Definition: math.h:43
SAL_DLLPUBLIC void rtl_math_doubleToUString(rtl_uString **pResult, sal_Int32 *pResultCapacity, sal_Int32 nResultOffset, double fValue, enum rtl_math_StringFormat eFormat, sal_Int32 nDecPlaces, sal_Unicode cDecSeparator, sal_Int32 const *pGroups, sal_Unicode cGroupSeparator, sal_Bool bEraseTrailingDecZeros) SAL_THROW_EXTERN_C()
Conversions analogous to sprintf() using internal rounding.
rtl_math_RoundingMode
Rounding modes for rtl_math_round.
Definition: math.h:84
rtl_math_DecimalPlaces
Special decimal places constants for rtl_math_doubleToString and rtl_math_doubleToUString and rtl_mat...
Definition: math.h:126
Like sprintf() G, 'F' or 'E' format is used depending on which one is more compact.
Definition: math.h:33
Like HalfUp, but corrects roundoff errors, preferred.
Definition: math.h:88
Same 'G', but with only 1 minimum digits in exponent.
Definition: math.h:53
#define SAL_MAX_ENUM
Definition: types.h:185
Same 'E', but with only 2 minimum digits in exponent.
Definition: math.h:48
Value to be used with rtl_math_StringFormat_Automatic.
Definition: math.h:130
SAL_DLLPUBLIC double rtl_math_uStringToDouble(sal_Unicode const *pBegin, sal_Unicode const *pEnd, sal_Unicode cDecSeparator, sal_Unicode cGroupSeparator, enum rtl_math_ConversionStatus *pStatus, sal_Unicode const **pParsedEnd) SAL_THROW_EXTERN_C()
Conversion analogous to strtod(), convert a string representing a decimal number into a double value...
Automatic, 'F' or 'E' format is used depending on the numeric value to be formatted.
Definition: math.h:38
SAL_DLLPUBLIC void rtl_math_doubleToString(rtl_String **pResult, sal_Int32 *pResultCapacity, sal_Int32 nResultOffset, double fValue, enum rtl_math_StringFormat eFormat, sal_Int32 nDecPlaces, char cDecSeparator, sal_Int32 const *pGroups, char cGroupSeparator, sal_Bool bEraseTrailingDecZeros) SAL_THROW_EXTERN_C()
Conversions analogous to sprintf() using internal rounding.
Floor of signed value.
Definition: math.h:100
SAL_DLLPUBLIC bool rtl_math_approxEqual(double a, double b) SAL_THROW_EXTERN_C()
Test equality of two values with an accuracy of the magnitude of the given values scaled by 2^-48 (4 ...
#define SAL_DLLPUBLIC
Definition: saldllapi.h:14
SAL_DLLPUBLIC double rtl_math_asinh(double fValue) SAL_THROW_EXTERN_C()
Returns values of the inverse hyperbolic sine.
SAL_DLLPUBLIC double rtl_math_round(double fValue, int nDecPlaces, enum rtl_math_RoundingMode eMode) SAL_THROW_EXTERN_C()
Rounds a double value.
Frac <= 0.5 ? floor of abs : ceil of abs, signed return.
Definition: math.h:108