1
2
3
4
5
6 #ifndef CMAJOR_RT_MULTIPRECISION_INCLUDED
7 #define CMAJOR_RT_MULTIPRECISION_INCLUDED
8 #include <cmajor/rt/RtApi.hpp>
9 #include <stdint.h>
10
11
12
13 extern "C" void* RtCreateDefaultBigInt(int32_t & errorStrHandle);
14 extern "C" void* RtCreateBigIntFromInt(int32_t v, int32_t & errorStrHandle);
15 extern "C" void* RtCreateBigIntFromUInt(uint32_t v, int32_t & errorStrHandle);
16 extern "C" void* RtCreateBigIntFromLong(int64_t v, int32_t & errorStrHandle);
17 extern "C" void* RtCreateBigIntFromULong(uint64_t v, int32_t & errorStrHandle);
18 extern "C" void* RtCreateBigIntFromStr(const char* v, int32_t & errorStrHandle);
19 extern "C" void* RtCreateBigIntFromCopy(void* handle, int32_t & errorStrHandle);
20 extern "C" void RtDestroyBigInt(void* handle);
21 extern "C" const char* RtBigIntToCharPtr(void* handle, int32_t & errorStrHandle);
22 extern "C" void RtDeleteCharPtr(const char* ptr);
23 extern "C" int32_t RtBigIntToInt(void* handle, int32_t & errorStrHandle);
24 extern "C" uint32_t RtBigIntToUInt(void* handle, int32_t & errorStrHandle);
25 extern "C" int64_t RtBigIntToLong(void* handle, int32_t & errorStrHandle);
26 extern "C" uint64_t RtBigIntToULong(void* handle, int32_t & errorStrHandle);
27 extern "C" void* RtNegBigInt(void* handle, int32_t & errorStrHandle);
28 extern "C" void* RtPosBigInt(void* handle, int32_t & errorStrHandle);
29 extern "C" void* RtCplBigInt(void* handle, int32_t & errorStrHandle);
30 extern "C" void* RtAddBigInt(void* left, void* right, int32_t & errorStrHandle);
31 extern "C" void* RtSubBigInt(void* left, void* right, int32_t & errorStrHandle);
32 extern "C" void* RtMulBigInt(void* left, void* right, int32_t & errorStrHandle);
33 extern "C" void* RtDivBigInt(void* left, void* right, int32_t & errorStrHandle);
34 extern "C" void* RtModBigInt(void* left, void* right, int32_t & errorStrHandle);
35 extern "C" void* RtAndBigInt(void* left, void* right, int32_t & errorStrHandle);
36 extern "C" void* RtOrBigInt(void* left, void* right, int32_t & errorStrHandle);
37 extern "C" void* RtXorBigInt(void* left, void* right, int32_t & errorStrHandle);
38 extern "C" void* RtShiftLeftBigInt(void* left, int32_t right, int32_t & errorStrHandle);
39 extern "C" void* RtShiftRightBigInt(void* left, int32_t right, int32_t & errorStrHandle);
40 extern "C" bool RtEqualBigInt(void* left, void* right, int32_t & errorStrHandle);
41 extern "C" bool RtNotEqualBigInt(void* left, void* right, int32_t & errorStrHandle);
42 extern "C" bool RtLessBigInt(void* left, void* right, int32_t & errorStrHandle);
43 extern "C" bool RtGreaterBigInt(void* left, void* right, int32_t & errorStrHandle);
44 extern "C" bool RtLessEqualBigInt(void* left, void* right, int32_t & errorStrHandle);
45 extern "C" bool RtGreaterEqualBigInt(void* left, void* right, int32_t & errorStrHandle);
46
47
48
49 extern "C" void* RtCreateDefaultBigRational(int32_t & errorStrHandle);
50 extern "C" void* RtCreateBigRationalFromInt(int32_t v, int32_t & errorStrHandle);
51 extern "C" void* RtCreateBigRationalFromUInt(uint32_t v, int32_t & errorStrHandle);
52 extern "C" void* RtCreateBigRationalFromLong(int64_t v, int32_t & errorStrHandle);
53 extern "C" void* RtCreateBigRationalFromULong(uint64_t v, int32_t & errorStrHandle);
54 extern "C" void* RtCreateBigRationalFromStr(const char* v, int32_t & errorStrHandle);
55 extern "C" void* RtCreateBigRationalFromCopy(void* handle, int32_t & errorStrHandle);
56 extern "C" void* RtCreateBigRationalFromBigInt(void* handle, int32_t & errorStrHandle);
57 extern "C" void* RtCreateBigRationalFromBigInts(void* numerator, void* denominator, int32_t & errorStrHandle);
58 extern "C" void RtDestroyBigRational(void* handle);
59 extern "C" const char* RtBigRationalToCharPtr(void* handle, int32_t & errorStrHandle);
60 extern "C" void* RtBigRationalToBigInt(void* handle, int32_t & errorStrHandle);
61 extern "C" void* RtNegBigRational(void* handle, int32_t & errorStrHandle);
62 extern "C" void* RtPosBigRational(void* handle, int32_t & errorStrHandle);
63 extern "C" void* RtAddBigRational(void* left, void* right, int32_t & errorStrHandle);
64 extern "C" void* RtSubBigRational(void* left, void* right, int32_t & errorStrHandle);
65 extern "C" void* RtMulBigRational(void* left, void* right, int32_t & errorStrHandle);
66 extern "C" void* RtDivBigRational(void* left, void* right, int32_t & errorStrHandle);
67 extern "C" bool RtEqualBigRational(void* left, void* right, int32_t & errorStrHandle);
68 extern "C" bool RtNotEqualBigRational(void* left, void* right, int32_t & errorStrHandle);
69 extern "C" bool RtLessBigRational(void* left, void* right, int32_t & errorStrHandle);
70 extern "C" bool RtGreaterBigRational(void* left, void* right, int32_t & errorStrHandle);
71 extern "C" bool RtLessEqualBigRational(void* left, void* right, int32_t & errorStrHandle);
72 extern "C" bool RtGreaterEqualBigRational(void* left, void* right, int32_t & errorStrHandle);
73 extern "C" void* RtNumeratorBigRational(void* handle, int32_t & errorStrHandle);
74 extern "C" void* RtDenominatorBigRational(void* handle, int32_t & errorStrHandle);
75
76
77
78 extern "C" void* RtCreateDefaultBigFloat(int32_t & errorStrHandle);
79 extern "C" void* RtCreateBigFloatFromInt(int32_t v, int32_t & errorStrHandle);
80 extern "C" void* RtCreateBigFloatFromUInt(uint32_t v, int32_t & errorStrHandle);
81 extern "C" void* RtCreateBigFloatFromLong(int64_t v, int32_t & errorStrHandle);
82 extern "C" void* RtCreateBigFloatFromULong(uint64_t v, int32_t & errorStrHandle);
83 extern "C" void* RtCreateBigFloatFromDouble(double v, int32_t & errorStrHandle);
84 extern "C" void* RtCreateBigFloatFromStr(const char* v, int32_t & errorStrHandle);
85 extern "C" void* RtCreateBigFloatFromCopy(void* handle, int32_t & errorStrHandle);
86 extern "C" void* RtCreateBigFloatFromBigInt(void* handle, int32_t & errorStrHandle);
87 extern "C" void* RtCreateBigFloatFromBigRational(void* handle, int32_t & errorStrHandle);
88 extern "C" void RtDestroyBigFloat(void* handle);
89 extern "C" const char* RtBigFloatToCharPtr(void* handle, int32_t & errorStrHandle);
90 extern "C" double RtBigFloatToDouble(void* handle, int32_t & errorStrHandle);
91 extern "C" void* RtBigFloatToBigInt(void* handle, int32_t & errorStrHandle);
92 extern "C" void* RtBigFloatToBigRational(void* handle, int32_t & errorStrHandle);
93 extern "C" void* RtNegBigFloat(void* handle, int32_t & errorStrHandle);
94 extern "C" void* RtPosBigFloat(void* handle, int32_t & errorStrHandle);
95 extern "C" void* RtAddBigFloat(void* left, void* right, int32_t & errorStrHandle);
96 extern "C" void* RtSubBigFloat(void* left, void* right, int32_t & errorStrHandle);
97 extern "C" void* RtMulBigFloat(void* left, void* right, int32_t & errorStrHandle);
98 extern "C" void* RtDivBigFloat(void* left, void* right, int32_t & errorStrHandle);
99 extern "C" bool RtEqualBigFloat(void* left, void* right, int32_t & errorStrHandle);
100 extern "C" bool RtNotEqualBigFloat(void* left, void* right, int32_t & errorStrHandle);
101 extern "C" bool RtLessBigFloat(void* left, void* right, int32_t & errorStrHandle);
102 extern "C" bool RtGreaterBigFloat(void* left, void* right, int32_t & errorStrHandle);
103 extern "C" bool RtLessEqualBigFloat(void* left, void* right, int32_t & errorStrHandle);
104 extern "C" bool RtGreaterEqualBigFloat(void* left, void* right, int32_t & errorStrHandle);
105
106 #endif // CMAJOR_RT_MULTIPRECISION_INCLUDED