XBinder  Version 2.6.x
rtxBigFloat.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2003-2018 Objective Systems, Inc.
3  *
4  * This software is furnished under a license and may be used and copied
5  * only in accordance with the terms of such license and with the
6  * inclusion of the above copyright notice. This software or any other
7  * copies thereof may not be provided or otherwise made available to any
8  * other person. No title to and ownership of the software is hereby
9  * transferred.
10  *
11  * The information in this software is subject to change without notice
12  * and should not be construed as a commitment by Objective Systems, Inc.
13  *
14  * PROPRIETARY NOTICE
15  *
16  * This software is an unpublished work subject to a confidentiality agreement
17  * and is protected by copyright and trade secret law. Unauthorized copying,
18  * redistribution or other use of this work is prohibited.
19  *
20  * The above notice of copyright on this source code product does not indicate
21  * any actual or intended publication of such source code.
22  *
23  *****************************************************************************/
28 #ifndef _RTXBIGFLOAT_H_
29 #define _RTXBIGFLOAT_H_
30 
31 #include "rtxsrc/rtxBigInt.h"
32 
33 /* Big Float
34 The value represented is given by:
35  mantissa * 10**exponent if (base10)
36  OR mantissa * 2**exponent otherwise
37  */
38 
39 typedef struct OSBigFloat
40 {
41  OSBigInt mantissa;
42  OSINT64 exponent;
43  OSBOOL base10;
44 } OSBigFloat;
45 
46 
47 #ifdef __cplusplus
48 extern "C" {
49 #endif
50 
51 /* BigFloat functions */
52 
59 EXTERNRT void rtxBigFloatInit (OSBigFloat* pFloat);
60 
61 
69 EXTERNRT void rtxBigFloatFree (OSCTXT* pctxt, OSBigFloat* pFloat);
70 
87 EXTERNRT int rtxBigFloatSetStr
88 (OSCTXT* pctxt, OSBigFloat* pFloat, const char* value);
89 
108 EXTERNRT int rtxBigFloatSetStrn
109 (OSCTXT* pctxt, OSBigFloat* pFloat, const char* value, OSSIZE len);
110 
111 
112 
118 EXTERNRT OSSIZE rtxBigFloatStringSize(OSBigFloat* pFloat);
119 
126 EXTERNRT OSBOOL rtxBigFloatToReal(const OSBigFloat* pFloat, OSREAL* pvalue);
127 
148 EXTERNRT int rtxBigFloatToString
149 (OSCTXT* pctxt, const OSBigFloat* pFloat, char* str, OSSIZE strSize);
150 
151 
152 
153 #ifdef __cplusplus
154 }
155 #endif
156 
157 #endif /* _RTXBIGFLOAT_H_ */
158 
EXTERNRT int rtxBigFloatSetStrn(OSCTXT *pctxt, OSBigFloat *pFloat, const char *value, OSSIZE len)
This function sets an OSBigFloat from a character string using the given number of characters...
EXTERNRT void rtxBigFloatInit(OSBigFloat *pFloat)
This function initializes a big float structure.
EXTERNRT int rtxBigFloatSetStr(OSCTXT *pctxt, OSBigFloat *pFloat, const char *value)
This function sets an OSBigFloat from a null-terminated decimal string.
EXTERNRT OSBOOL rtxBigFloatToReal(const OSBigFloat *pFloat, OSREAL *pvalue)
This function converts the given floating point number, which must be base 2, into an OSREAL...
EXTERNRT void rtxBigFloatFree(OSCTXT *pctxt, OSBigFloat *pFloat)
This function frees internal memory within the big float structure.
Run-time context structure.
Definition: rtxContext.h:185
EXTERNRT OSSIZE rtxBigFloatStringSize(OSBigFloat *pFloat)
Return an approximate size for the string returned by rtxBigFloatToString.
EXTERNRT int rtxBigFloatToString(OSCTXT *pctxt, const OSBigFloat *pFloat, char *str, OSSIZE strSize)
This function is used to convert a floating point number to a string.