UDK 3.2.7 C/C++ API Reference
rtl/math.h
Go to the documentation of this file.
00001 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
00002 /*************************************************************************
00003  *
00004  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
00005  *
00006  * Copyright 2000, 2010 Oracle and/or its affiliates.
00007  *
00008  * OpenOffice.org - a multi-platform office productivity suite
00009  *
00010  * This file is part of OpenOffice.org.
00011  *
00012  * OpenOffice.org is free software: you can redistribute it and/or modify
00013  * it under the terms of the GNU Lesser General Public License version 3
00014  * only, as published by the Free Software Foundation.
00015  *
00016  * OpenOffice.org is distributed in the hope that it will be useful,
00017  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00018  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00019  * GNU Lesser General Public License version 3 for more details
00020  * (a copy is included in the LICENSE file that accompanied this code).
00021  *
00022  * You should have received a copy of the GNU Lesser General Public License
00023  * version 3 along with OpenOffice.org.  If not, see
00024  * <http://www.openoffice.org/license.html>
00025  * for a copy of the LGPLv3 License.
00026  *
00027  ************************************************************************/
00028 
00029 #if !defined INCLUDED_RTL_MATH_H
00030 #define INCLUDED_RTL_MATH_H
00031 
00032 #include "rtl/ustring.h"
00033 #include "sal/types.h"
00034 
00035 #if defined __cplusplus
00036 extern "C" {
00037 #endif /* __cplusplus */
00038 
00042 enum rtl_math_StringFormat
00043 {
00046     rtl_math_StringFormat_E,
00047 
00050     rtl_math_StringFormat_F,
00051 
00055     rtl_math_StringFormat_G,
00056 
00060     rtl_math_StringFormat_Automatic,
00061 
00063     rtl_math_StringFormat_FORCE_EQUAL_SIZE = SAL_MAX_ENUM
00065 };
00066 
00069 enum rtl_math_ConversionStatus
00070 {
00073     rtl_math_ConversionStatus_Ok,
00074 
00077     rtl_math_ConversionStatus_OutOfRange,
00078 
00080     rtl_math_ConversionStatus_FORCE_EQUAL_SIZE = SAL_MAX_ENUM
00082 };
00083 
00086 enum rtl_math_RoundingMode
00087 {
00090     rtl_math_RoundingMode_Corrected,
00091 
00094     rtl_math_RoundingMode_Down,
00095 
00098     rtl_math_RoundingMode_Up,
00099 
00102     rtl_math_RoundingMode_Floor,
00103 
00106     rtl_math_RoundingMode_Ceiling,
00107 
00110     rtl_math_RoundingMode_HalfDown,
00111 
00114     rtl_math_RoundingMode_HalfUp,
00115 
00118     rtl_math_RoundingMode_HalfEven,
00119 
00121     rtl_math_RoundingMode_FORCE_EQUAL_SIZE = SAL_MAX_ENUM
00123 };
00124 
00128 enum rtl_math_DecimalPlaces
00129 {
00132     rtl_math_DecimalPlaces_Max = 0x7ffffff,
00133 
00138     rtl_math_DecimalPlaces_DefaultSignificance = 0x7ffffff
00139 };
00140 
00141 
00206 SAL_DLLPUBLIC void SAL_CALL rtl_math_doubleToString(rtl_String ** pResult,
00207                                       sal_Int32 * pResultCapacity,
00208                                       sal_Int32 nResultOffset, double fValue,
00209                                       enum rtl_math_StringFormat eFormat,
00210                                       sal_Int32 nDecPlaces,
00211                                       sal_Char cDecSeparator,
00212                                       sal_Int32 const * pGroups,
00213                                       sal_Char cGroupSeparator,
00214                                       sal_Bool bEraseTrailingDecZeros)
00215     SAL_THROW_EXTERN_C();
00216 
00281 SAL_DLLPUBLIC void SAL_CALL rtl_math_doubleToUString(rtl_uString ** pResult,
00282                                        sal_Int32 * pResultCapacity,
00283                                        sal_Int32 nResultOffset, double fValue,
00284                                        enum rtl_math_StringFormat eFormat,
00285                                        sal_Int32 nDecPlaces,
00286                                        sal_Unicode cDecSeparator,
00287                                        sal_Int32 const * pGroups,
00288                                        sal_Unicode cGroupSeparator,
00289                                        sal_Bool bEraseTrailingDecZeros)
00290     SAL_THROW_EXTERN_C();
00291 
00327 SAL_DLLPUBLIC double SAL_CALL rtl_math_stringToDouble(
00328     sal_Char const * pBegin, sal_Char const * pEnd, sal_Char cDecSeparator,
00329     sal_Char cGroupSeparator, enum rtl_math_ConversionStatus * pStatus,
00330     sal_Char const ** pParsedEnd) SAL_THROW_EXTERN_C();
00331 
00367 SAL_DLLPUBLIC double SAL_CALL rtl_math_uStringToDouble(
00368     sal_Unicode const * pBegin, sal_Unicode const * pEnd,
00369     sal_Unicode cDecSeparator, sal_Unicode cGroupSeparator,
00370     enum rtl_math_ConversionStatus * pStatus, sal_Unicode const ** pParsedEnd)
00371     SAL_THROW_EXTERN_C();
00372 
00386 SAL_DLLPUBLIC double SAL_CALL rtl_math_round(double fValue, int nDecPlaces,
00387                                enum rtl_math_RoundingMode eMode)
00388     SAL_THROW_EXTERN_C();
00389 
00402 SAL_DLLPUBLIC double SAL_CALL rtl_math_pow10Exp(double fValue, int nExp) SAL_THROW_EXTERN_C();
00403 
00409 SAL_DLLPUBLIC double SAL_CALL rtl_math_approxValue(double fValue) SAL_THROW_EXTERN_C();
00410 
00418 SAL_DLLPUBLIC double SAL_CALL rtl_math_expm1(double fValue) SAL_THROW_EXTERN_C();
00419 
00427 SAL_DLLPUBLIC double SAL_CALL rtl_math_log1p(double fValue) SAL_THROW_EXTERN_C();
00428 
00437 SAL_DLLPUBLIC double SAL_CALL rtl_math_atanh(double fValue) SAL_THROW_EXTERN_C();
00438 
00446 SAL_DLLPUBLIC double SAL_CALL rtl_math_erf(double fValue) SAL_THROW_EXTERN_C();
00447 
00455 SAL_DLLPUBLIC double SAL_CALL rtl_math_erfc(double fValue) SAL_THROW_EXTERN_C();
00456 
00464 SAL_DLLPUBLIC double SAL_CALL rtl_math_asinh(double fValue) SAL_THROW_EXTERN_C();
00465 
00473 SAL_DLLPUBLIC double SAL_CALL rtl_math_acosh(double fValue) SAL_THROW_EXTERN_C();
00474 
00475 #if defined __cplusplus
00476 }
00477 #endif /* __cplusplus */
00478 
00479 #endif /* INCLUDED_RTL_MATH_H */
00480 
00481 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines