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  * This file is part of the LibreOffice project.
00004  *
00005  * This Source Code Form is subject to the terms of the Mozilla Public
00006  * License, v. 2.0. If a copy of the MPL was not distributed with this
00007  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
00008  *
00009  * This file incorporates work covered by the following license notice:
00010  *
00011  *   Licensed to the Apache Software Foundation (ASF) under one or more
00012  *   contributor license agreements. See the NOTICE file distributed
00013  *   with this work for additional information regarding copyright
00014  *   ownership. The ASF licenses this file to you under the Apache
00015  *   License, Version 2.0 (the "License"); you may not use this file
00016  *   except in compliance with the License. You may obtain a copy of
00017  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
00018  */
00019 
00020 #ifndef INCLUDED_RTL_MATH_H
00021 #define INCLUDED_RTL_MATH_H
00022 
00023 #include "sal/config.h"
00024 
00025 #include "rtl/ustring.h"
00026 #include "sal/saldllapi.h"
00027 #include "sal/types.h"
00028 
00029 #if defined __cplusplus
00030 extern "C" {
00031 #endif /* __cplusplus */
00032 
00036 enum rtl_math_StringFormat
00037 {
00040     rtl_math_StringFormat_E,
00041 
00044     rtl_math_StringFormat_F,
00045 
00049     rtl_math_StringFormat_G,
00050 
00054     rtl_math_StringFormat_Automatic,
00055 
00057     rtl_math_StringFormat_FORCE_EQUAL_SIZE = SAL_MAX_ENUM
00059 };
00060 
00063 enum rtl_math_ConversionStatus
00064 {
00067     rtl_math_ConversionStatus_Ok,
00068 
00071     rtl_math_ConversionStatus_OutOfRange,
00072 
00074     rtl_math_ConversionStatus_FORCE_EQUAL_SIZE = SAL_MAX_ENUM
00076 };
00077 
00080 enum rtl_math_RoundingMode
00081 {
00084     rtl_math_RoundingMode_Corrected,
00085 
00088     rtl_math_RoundingMode_Down,
00089 
00092     rtl_math_RoundingMode_Up,
00093 
00096     rtl_math_RoundingMode_Floor,
00097 
00100     rtl_math_RoundingMode_Ceiling,
00101 
00104     rtl_math_RoundingMode_HalfDown,
00105 
00108     rtl_math_RoundingMode_HalfUp,
00109 
00112     rtl_math_RoundingMode_HalfEven,
00113 
00115     rtl_math_RoundingMode_FORCE_EQUAL_SIZE = SAL_MAX_ENUM
00117 };
00118 
00122 enum rtl_math_DecimalPlaces
00123 {
00126     rtl_math_DecimalPlaces_Max = 0x7ffffff,
00127 
00132     rtl_math_DecimalPlaces_DefaultSignificance = rtl_math_DecimalPlaces_Max
00133 };
00134 
00135 
00200 SAL_DLLPUBLIC void SAL_CALL rtl_math_doubleToString(rtl_String ** pResult,
00201                                       sal_Int32 * pResultCapacity,
00202                                       sal_Int32 nResultOffset, double fValue,
00203                                       enum rtl_math_StringFormat eFormat,
00204                                       sal_Int32 nDecPlaces,
00205                                       sal_Char cDecSeparator,
00206                                       sal_Int32 const * pGroups,
00207                                       sal_Char cGroupSeparator,
00208                                       sal_Bool bEraseTrailingDecZeros)
00209     SAL_THROW_EXTERN_C();
00210 
00275 SAL_DLLPUBLIC void SAL_CALL rtl_math_doubleToUString(rtl_uString ** pResult,
00276                                        sal_Int32 * pResultCapacity,
00277                                        sal_Int32 nResultOffset, double fValue,
00278                                        enum rtl_math_StringFormat eFormat,
00279                                        sal_Int32 nDecPlaces,
00280                                        sal_Unicode cDecSeparator,
00281                                        sal_Int32 const * pGroups,
00282                                        sal_Unicode cGroupSeparator,
00283                                        sal_Bool bEraseTrailingDecZeros)
00284     SAL_THROW_EXTERN_C();
00285 
00321 SAL_DLLPUBLIC double SAL_CALL rtl_math_stringToDouble(
00322     sal_Char const * pBegin, sal_Char const * pEnd, sal_Char cDecSeparator,
00323     sal_Char cGroupSeparator, enum rtl_math_ConversionStatus * pStatus,
00324     sal_Char const ** pParsedEnd) SAL_THROW_EXTERN_C();
00325 
00361 SAL_DLLPUBLIC double SAL_CALL rtl_math_uStringToDouble(
00362     sal_Unicode const * pBegin, sal_Unicode const * pEnd,
00363     sal_Unicode cDecSeparator, sal_Unicode cGroupSeparator,
00364     enum rtl_math_ConversionStatus * pStatus, sal_Unicode const ** pParsedEnd)
00365     SAL_THROW_EXTERN_C();
00366 
00380 SAL_DLLPUBLIC double SAL_CALL rtl_math_round(double fValue, int nDecPlaces,
00381                                enum rtl_math_RoundingMode eMode)
00382     SAL_THROW_EXTERN_C();
00383 
00396 SAL_DLLPUBLIC double SAL_CALL rtl_math_pow10Exp(double fValue, int nExp) SAL_THROW_EXTERN_C();
00397 
00403 SAL_DLLPUBLIC double SAL_CALL rtl_math_approxValue(double fValue) SAL_THROW_EXTERN_C();
00404 
00412 SAL_DLLPUBLIC double SAL_CALL rtl_math_expm1(double fValue) SAL_THROW_EXTERN_C();
00413 
00421 SAL_DLLPUBLIC double SAL_CALL rtl_math_log1p(double fValue) SAL_THROW_EXTERN_C();
00422 
00431 SAL_DLLPUBLIC double SAL_CALL rtl_math_atanh(double fValue) SAL_THROW_EXTERN_C();
00432 
00440 SAL_DLLPUBLIC double SAL_CALL rtl_math_erf(double fValue) SAL_THROW_EXTERN_C();
00441 
00449 SAL_DLLPUBLIC double SAL_CALL rtl_math_erfc(double fValue) SAL_THROW_EXTERN_C();
00450 
00458 SAL_DLLPUBLIC double SAL_CALL rtl_math_asinh(double fValue) SAL_THROW_EXTERN_C();
00459 
00467 SAL_DLLPUBLIC double SAL_CALL rtl_math_acosh(double fValue) SAL_THROW_EXTERN_C();
00468 
00469 #if defined __cplusplus
00470 }
00471 #endif /* __cplusplus */
00472 
00473 #endif /* INCLUDED_RTL_MATH_H */
00474 
00475 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines