CodePorting.Translator Cs2Cpp
CodePorting.Translator.Cs2Cpp.Framework
decimal.h
1
3#ifndef _aspose_system_decimal_h_
4#define _aspose_system_decimal_h_
5
6#include <system/object.h>
7#include <system/string.h>
8#include <system/midpoint_rounding.h>
9#include <system/globalization/number_styles.h>
10#include <system/globalization/culture_info.h>
11#include <system/boxable_traits.h>
12#include <system/type_code.h>
13
14#include <string>
15#include <limits>
16#include <cmath>
17#include <memory>
18#include <array>
19
20
21#ifdef ASPOSECPPLIB_BEING_BUILT
22#include <boost/multiprecision/cpp_dec_float.hpp>
23#endif
24
25
26namespace boost { namespace multiprecision {
27 namespace backends {
29 template <unsigned, class, class> class cpp_dec_float;
30 }
31 using backends::cpp_dec_float;
33 ASPOSECPP_3RD_PARTY_ENUM(expression_template_option);
35 template <class, expression_template_option> class number;
36} }
37
38
39namespace System {
40
41#ifndef ASPOSE_CPP_DECIMAL_DIGITS
43 #define ASPOSE_CPP_DECIMAL_DIGITS 28
44#endif
45
47#define DECIMAL_FROM_DOUBLE_SIGNIFICANT_DIGITS 15
48
50#define DECIMAL_FROM_FLOAT_SIGNIFICANT_DIGITS 7
51
52class IFormatProvider;
53
54namespace Detail {
55 template <typename I> class DecimalConverter;
56
58 typedef boost::multiprecision::number<boost::multiprecision::cpp_dec_float<ASPOSE_CPP_DECIMAL_DIGITS + 1, std::int32_t, void>, (boost::multiprecision::expression_template_option)1> decimal_number_type;
60 struct decimal_size_equivalent {
62 std::array<std::uint32_t, (ASPOSE_CPP_DECIMAL_DIGITS + 8) / 8 + 3> m_data;
64 std::int32_t m_exponent;
66 bool m_neg;
68 enum { e1, e2, e3 } m_class;
70 std::int32_t m_precision;
71 };
72
74 ASPOSECPP_3RD_PARTY_TYPE_HOLDER(decimal_number_type, number, sizeof(decimal_size_equivalent), std::uint32_t, DecimalHolder);
75}
76
77struct DecimalDotNetImpl;
78
106class ASPOSECPP_SHARED_CLASS Decimal
107{
108public:
109 template<typename I> friend class Detail::DecimalConverter;
110
112 typedef Detail::decimal_number_type number_type;
113
115 static const Decimal ASPOSECPP_SHARED_API MaxValue;
117 static const Decimal ASPOSECPP_SHARED_API MinValue;
119 static const Decimal ASPOSECPP_SHARED_API MinusOne;
121 static const Decimal ASPOSECPP_SHARED_API One;
123 static const Decimal ASPOSECPP_SHARED_API Zero;
124
125 // ctors
127 ASPOSECPP_SHARED_API Decimal();
130 ASPOSECPP_SHARED_API Decimal(std::int8_t i);
133 ASPOSECPP_SHARED_API Decimal(std::int16_t i);
136 ASPOSECPP_SHARED_API Decimal(std::int32_t i);
139 ASPOSECPP_SHARED_API Decimal(std::int64_t i);
142 ASPOSECPP_SHARED_API Decimal(std::uint8_t i);
145 ASPOSECPP_SHARED_API Decimal(std::uint16_t i);
148 ASPOSECPP_SHARED_API Decimal(std::uint32_t i);
151 ASPOSECPP_SHARED_API Decimal(std::uint64_t i);
152
155 ASPOSECPP_SHARED_API Decimal(float f);
158 ASPOSECPP_SHARED_API Decimal(double d);
159
161 ASPOSECPP_SHARED_API explicit Decimal(const std::string& str);
168 ASPOSECPP_SHARED_API Decimal(int32_t lo, int32_t mid, int32_t hi, bool isNegative, uint8_t scale);
171 ASPOSECPP_SHARED_API Decimal(const Decimal &d);
174 ASPOSECPP_SHARED_API Decimal(const ArrayPtr<int32_t>& bits);
176 ASPOSECPP_SHARED_API Decimal(std::nullptr_t bits);
178 ASPOSECPP_SHARED_API ~Decimal();
179
180 // operators
184 ASPOSECPP_SHARED_API Decimal& operator = (const Decimal &d);
185
187 ASPOSECPP_SHARED_API explicit operator std::int8_t() const;
189 ASPOSECPP_SHARED_API explicit operator std::int16_t() const;
191 ASPOSECPP_SHARED_API explicit operator std::int32_t() const;
193 ASPOSECPP_SHARED_API explicit operator std::int64_t() const;
195 ASPOSECPP_SHARED_API explicit operator std::uint8_t() const;
197 ASPOSECPP_SHARED_API explicit operator std::uint16_t() const;
199 ASPOSECPP_SHARED_API explicit operator std::uint32_t() const;
201 ASPOSECPP_SHARED_API explicit operator std::uint64_t() const;
203 ASPOSECPP_SHARED_API explicit operator float() const;
205 ASPOSECPP_SHARED_API explicit operator double() const;
206
209 ASPOSECPP_SHARED_API explicit operator bool() const;
210
214 ASPOSECPP_SHARED_API Decimal operator+(const Decimal& d) const;
218 ASPOSECPP_SHARED_API Decimal operator-(const Decimal& d) const;
222 ASPOSECPP_SHARED_API Decimal operator*(const Decimal& d) const;
226 ASPOSECPP_SHARED_API Decimal operator/(const Decimal& d) const;
230 ASPOSECPP_SHARED_API Decimal operator%(const Decimal& d) const;
232 ASPOSECPP_SHARED_API Decimal operator-() const;
233
237 ASPOSECPP_SHARED_API bool operator==(const Decimal& d) const;
241 ASPOSECPP_SHARED_API bool operator!=(const Decimal& d) const;
244 ASPOSECPP_SHARED_API bool operator==(std::nullptr_t) const;
247 ASPOSECPP_SHARED_API bool operator!=(std::nullptr_t) const;
251 ASPOSECPP_SHARED_API bool operator<(const Decimal& d) const;
255 ASPOSECPP_SHARED_API bool operator<=(const Decimal& d) const;
259 ASPOSECPP_SHARED_API bool operator>(const Decimal& d) const;
263 ASPOSECPP_SHARED_API bool operator>=(const Decimal& d) const;
264
267 ASPOSECPP_SHARED_API Decimal& operator++();
270 ASPOSECPP_SHARED_API Decimal& operator--();
271
275 ASPOSECPP_SHARED_API Decimal& operator+=(const Decimal& d);
279 ASPOSECPP_SHARED_API Decimal& operator-=(const Decimal& d);
283 ASPOSECPP_SHARED_API Decimal& operator*=(const Decimal& d);
287 ASPOSECPP_SHARED_API Decimal& operator/=(const Decimal& d);
291 ASPOSECPP_SHARED_API Decimal& operator%=(const Decimal& d);
292
294 ASPOSECPP_SHARED_API friend std::ostream& operator<<(std::ostream& os, const Decimal& d);
295 ASPOSECPP_SHARED_API friend std::wostream& operator<<(std::wostream& os, const Decimal& d);
297
298 // methods
302 ASPOSECPP_SHARED_API bool Equals(const Decimal& d) const;
306 ASPOSECPP_SHARED_API bool Equals(const SharedPtr<Object>& obj) const;
310 ASPOSECPP_SHARED_API int CompareTo(const Decimal& d) const;
312 ASPOSECPP_SHARED_API int GetHashCode() const;
314 ASPOSECPP_SHARED_API String ToString() const;
315
319 ASPOSECPP_SHARED_API String ToString(const SharedPtr<IFormatProvider>& provider) const;
320 // Optimized function overloads
321 ASPOSECPP_SHARED_API String ToString(const SharedPtr<Globalization::CultureInfo>& culture) const;
322 ASPOSECPP_SHARED_API String ToString(const SharedPtr<Globalization::NumberFormatInfo>& nfi) const;
323 String ToString(const Decimal& value, std::nullptr_t) const { ASPOSE_UNUSED(value); return ToString(); }
324
330 ASPOSECPP_SHARED_API String ToString(const String& format, const SharedPtr<IFormatProvider>& provider) const;
331 // Optimized function overloads
332 ASPOSECPP_SHARED_API String ToString(const String& format, const SharedPtr<Globalization::CultureInfo>& culture) const;
333 ASPOSECPP_SHARED_API String ToString(const String& format, const SharedPtr<Globalization::NumberFormatInfo>& nfi) const;
334 ASPOSECPP_SHARED_API String ToString(const String& format, std::nullptr_t = nullptr) const;
335
336 // static methods
342 static ASPOSECPP_SHARED_API Decimal Round(const Decimal& d, MidpointRounding mode = MidpointRounding::ToEven);
349 static ASPOSECPP_SHARED_API Decimal Round(const Decimal& d, int digits, MidpointRounding mode = MidpointRounding::ToEven);
355 static ASPOSECPP_SHARED_API Decimal Truncate(const Decimal& d);
359 static ASPOSECPP_SHARED_API Decimal Ceiling(const Decimal& d);
363 static ASPOSECPP_SHARED_API Decimal Floor(const Decimal& d);
364
369 static bool Equals(const Decimal& d1, const Decimal& d2) { return d1 == d2; }
374 static int Compare(const Decimal& d1, const Decimal& d2) { return d1.CompareTo(d2); }
378 static ASPOSECPP_SHARED_API Decimal Parse(const String& s);
383 static ASPOSECPP_SHARED_API Decimal Parse(const String& s, Globalization::NumberStyles styles);
388 static ASPOSECPP_SHARED_API Decimal Parse(const String& s, const SharedPtr<IFormatProvider>& provider);
394 static ASPOSECPP_SHARED_API Decimal Parse(const String& s, Globalization::NumberStyles styles, const SharedPtr<IFormatProvider>& provider);
399 static ASPOSECPP_SHARED_API bool TryParse(const String& value, Decimal& result);
406 static ASPOSECPP_SHARED_API bool TryParse(const String& value, Globalization::NumberStyles styles, const SharedPtr<IFormatProvider>& provider, Decimal& result);
407
409 static const TypeInfo& Type()
410 {
411 return *static_holder<ThisTypeInfo>();
412 }
413
415 ASPOSECPP_SHARED_API std::string ToStdString() const;
419 static ASPOSECPP_SHARED_API System::ArrayPtr<int> GetBits(const Decimal& d);
424 static ASPOSECPP_SHARED_API void GetBytes(const Decimal& value, const System::ArrayPtr<uint8_t>& buffer);
427 ASPOSECPP_SHARED_API Decimal(const number_type& value);
430 static ASPOSECPP_SHARED_API int64_t ToOACurrency(const Decimal& value);
433 static ASPOSECPP_SHARED_API Decimal FromOACurrency(int64_t currency);
435 TypeCode GetTypeCode() const { return TypeCode::Decimal; }
436
441 static Decimal Add(const Decimal& d1, const Decimal& d2) { return d1 + d2; }
446 static Decimal Subtract(const Decimal& d1, const Decimal& d2) { return d1 - d2; }
451 static Decimal Divide(const Decimal& d1, const Decimal& d2) { return d1 / d2; }
456 static Decimal Remainder(const Decimal& d1, const Decimal& d2) { return d1 % d2; }
461 static Decimal Multiply(const Decimal& d1, const Decimal& d2) { return d1 * d2; }
463 static Decimal Negate(const Decimal& d) { return -d; }
464
466 static uint8_t ToByte(Decimal value) { return static_cast<uint8_t>(value); }
468 static int8_t ToSByte(Decimal value) { return static_cast<int8_t>(value); }
470 static uint16_t ToUInt16(Decimal value) { return static_cast<uint16_t>(value); }
472 static int16_t ToInt16(Decimal value) { return static_cast<int16_t>(value); }
474 static uint32_t ToUInt32(Decimal value) { return static_cast<uint32_t>(value); }
476 static int32_t ToInt32(Decimal value) { return static_cast<int32_t>(value); }
478 static uint64_t ToUInt64(Decimal value) { return static_cast<uint64_t>(value); }
480 static int64_t ToInt64(Decimal value) { return static_cast<int64_t>(value); }
482 static float ToSingle(Decimal value) { return static_cast<float>(value); }
484 static double ToDouble(Decimal value) { return static_cast<double>(value); }
485
488
489protected:
493 static ASPOSECPP_SHARED_API void DecimalToDotNetImpl(const Decimal& value, DecimalDotNetImpl* impl);
495 Detail::DecimalHolder m_value;
496
497private:
506 static Decimal Round_unchecked(const Decimal& d, int digits, MidpointRounding mode = MidpointRounding::ToEven);
507
509 struct ThisTypeInfo : TypeInfoPtr
510 {
512 ThisTypeInfo()
513 : TypeInfoPtr(u"System::Decimal")
514 {}
515 };
516
518 template <class T>
519 inline void EliminateRoundError()
520 {
521 // This intends to limit fractional error when converting from double or float to Decimal.
522 // It is requires to put the behavior in line with original C# one which seems to consider only 15 digits for double when converting.
523 typedef std::numeric_limits<T> limits;
524 if (limits::is_integer)
525 return;
526
527 CutErroneousDigits(limits::digits10);
528 }
529
531 void CutErroneousDigits(int digits);
532
534 void DecimalInternal(int32_t lo, int32_t mid, int32_t hi, bool isNegative, uint8_t scale);
535};
536
541template <typename T, typename _ = typename std::enable_if<std::is_arithmetic<T>::value>::type>
542Decimal operator+(const T& x, const Decimal& d) { return Decimal(x) + d; }
543
548template <typename T, typename _ = typename std::enable_if<std::is_arithmetic<T>::value>::type>
549Decimal operator-(const T& x, const Decimal& d) { return Decimal(x) - d; }
550
555template <typename T, typename _ = typename std::enable_if<std::is_arithmetic<T>::value>::type>
556Decimal operator*(const T& x, const Decimal& d) { return Decimal(x) * d; }
557
562template <typename T, typename _ = typename std::enable_if<std::is_arithmetic<T>::value>::type>
563Decimal operator/(const T& x, const Decimal& d) { return Decimal(x) / d; }
564
568ASPOSECPP_SHARED_API void PrintTo(const Decimal& d, ::std::ostream* os);
569
574ASPOSECPP_SHARED_API std::ostream& operator<<(std::ostream& stream, const Decimal& decimal);
575
580ASPOSECPP_SHARED_API std::wostream& operator<<(std::wostream& stream, const Decimal& decimal);
581
584template<> struct IsBoxable<Decimal> : std::true_type {};
586
587} // namespace System
588
589namespace std
590{
592 template <>
593 struct hash<System::Decimal>
594 {
597 std::size_t operator()(const System::Decimal& val) const
598 {
599 return static_cast<std::size_t>(val.GetHashCode());
600 }
601 };
602}
603
604
605#endif // _aspose_system_decimal_h_
Represents a decimal number. This type should be allocated on stack and passed to functions by value ...
Definition: decimal.h:107
static int16_t ToInt16(Decimal value)
Converts the Decimal value to signed 16-bit integer value.
Definition: decimal.h:472
Decimal(std::int32_t i)
Constructs an instance that represents the specified value.
String ToString(const String &format, std::nullptr_t=nullptr) const
static Decimal Parse(const String &s, Globalization::NumberStyles styles)
Converts the string representation of a decimal number into an equivalent instance of Decimal class u...
static const Decimal MinusOne
Represents number -1.
Definition: decimal.h:119
Decimal(int32_t lo, int32_t mid, int32_t hi, bool isNegative, uint8_t scale)
Constructs a Decimal object from the specified from the specified components.
Decimal(std::uint16_t i)
Constructs an instance that represents the specified value.
Decimal operator*(const Decimal &d) const
Returns a new instance of Decimal class that represents a value that is a result of multiplication of...
static const Decimal MaxValue
Represents the largest number that can be represented by Decimal class.
Definition: decimal.h:115
bool operator<(const Decimal &d) const
Determines if the value represented by the current object is less than the value represented by the s...
std::string ToStdString() const
Returns an instance of std::string that contains the string representation of the value represented b...
static void DecimalToDotNetImpl(const Decimal &value, DecimalDotNetImpl *impl)
Converts Decimal value to equivalent C#-styled representation.
static Decimal Floor(const Decimal &d)
Returns the largest integral value that is less than or equal to the specified value.
bool operator==(std::nullptr_t) const
Determines if the value represented by the current object is 0.
static bool TryParse(const String &value, Globalization::NumberStyles styles, const SharedPtr< IFormatProvider > &provider, Decimal &result)
Converts the specified string containing the string representation of a number to the equivalent Deci...
Decimal(const Decimal &d)
Constructs an instance of Decimal class that represents the same number as the specified Decimal obje...
Decimal operator+(const Decimal &d) const
Returns a new instance of Decimal class that represents a value that is a sum of values represented b...
Decimal(std::uint8_t i)
Constructs an instance that represents the specified value.
String ToString(const Decimal &value, std::nullptr_t) const
Definition: decimal.h:323
bool operator>(const Decimal &d) const
Determines if the value represented by the current object is greater than the value represented by th...
static Decimal Ceiling(const Decimal &d)
Returns the smallest integral value that is greater than or equal to the specified value.
static uint32_t ToUInt32(Decimal value)
Converts the Decimal value to unsigned 32-bit integer value.
Definition: decimal.h:474
String ToString(const String &format, const SharedPtr< IFormatProvider > &provider) const
Converts current object to its string representation using the specified string format and culture-sp...
Detail::decimal_number_type number_type
An alias for Detail::decimal_number_type.
Definition: decimal.h:112
Detail::DecimalHolder m_value
The value represented by the current object.
Definition: decimal.h:495
String ToString(const SharedPtr< Globalization::CultureInfo > &culture) const
~Decimal()
Destructor.
static Decimal Round(const Decimal &d, MidpointRounding mode=MidpointRounding::ToEven)
Rounds the specified value to the nearest integral number. A parameter specifies the function's behav...
static Decimal Parse(const String &s)
Converts the string representation of a decimal number into an equivalent instance of Decimal class.
static Decimal Remainder(const Decimal &d1, const Decimal &d2)
Computes the remainder after dividing two Decimal values.
Definition: decimal.h:456
Decimal operator%(const Decimal &d) const
Returns a new instance of Decimal class that represents a value that is a result of modulo operation ...
bool operator<=(const Decimal &d) const
Determines if the value represented by the current object is less than or equal to the value represen...
Decimal & operator--()
Decrements the value represented by the current object.
static uint16_t ToUInt16(Decimal value)
Converts the Decimal value to unsigned 16-bit integer value.
Definition: decimal.h:470
static int32_t ToInt32(Decimal value)
Converts the Decimal value to signed 32-bit integer value.
Definition: decimal.h:476
bool operator!=(std::nullptr_t) const
Determines if the value represented by the current object is different from 0.
bool Equals(const SharedPtr< Object > &obj) const
Determines if the values represented by the current object and the specified object are equal.
static Decimal Add(const Decimal &d1, const Decimal &d2)
Adds two specified Decimal values.
Definition: decimal.h:441
Decimal & operator/=(const Decimal &d)
Assigns to the current object a new value that is the result of division of the value represented by ...
Decimal(float f)
Constructs an instance that represents the specified value.
static Decimal Divide(const Decimal &d1, const Decimal &d2)
Divides two specified Decimal values.
Definition: decimal.h:451
Decimal(const number_type &value)
Constructs an instance of Decimal class representing the specified value.
Decimal(std::uint64_t i)
Constructs an instance that represents the specified value.
static bool TryParse(const String &value, Decimal &result)
Converts the specified string containing the string representation of a number to the equivalent Deci...
static float ToSingle(Decimal value)
Converts the Decimal value to single precision floating-point number.
Definition: decimal.h:482
static void GetBytes(const Decimal &value, const System::ArrayPtr< uint8_t > &buffer)
Convert the specified Decimal value to an array of bytes.
String ToString(const SharedPtr< IFormatProvider > &provider) const
Converts current object to string using the culture-specific format information.
Decimal()
Constructs an instance that represents 0.
Decimal operator-(const Decimal &d) const
Returns a new instance of Decimal class that represents a value that is the result of subtraction of ...
static Decimal Parse(const String &s, Globalization::NumberStyles styles, const SharedPtr< IFormatProvider > &provider)
Converts the string representation of a decimal number into an equivalent instance of Decimal class u...
static uint8_t ToByte(Decimal value)
Converts the Decimal value to unsigned 8-bit integer value.
Definition: decimal.h:466
int GetHashCode() const
Returns a hash code for the current object.
Decimal & operator*=(const Decimal &d)
Assigns to the current object a new value that is the result of multiplication of values represented ...
TypeCode GetTypeCode() const
Gets object type code.
Definition: decimal.h:435
static Decimal Parse(const String &s, const SharedPtr< IFormatProvider > &provider)
Converts the string representation of a decimal number into an equivalent instance of Decimal class u...
Decimal(std::int64_t i)
Constructs an instance that represents the specified value.
static const Decimal One
Represents number 1.
Definition: decimal.h:121
String ToString() const
Returns the string representation of the value represented by the object.
Decimal & operator%=(const Decimal &d)
Assigns to the current object a new value that is the result of modulo operation with the values repr...
static Decimal Truncate(const Decimal &d)
Returns the Decimal object representing a value that has integral part equal to that of the value rep...
static int Compare(const Decimal &d1, const Decimal &d2)
Determines if the value represented by the first Decimal object is less than, equal to or greater tha...
Definition: decimal.h:374
int CompareTo(const Decimal &d) const
Determines if the value represented by the current object is less than, equal to or greater than the ...
String ToString(const String &format, const SharedPtr< Globalization::NumberFormatInfo > &nfi) const
Decimal(std::int8_t i)
Constructs an instance that represents the specified value.
bool Equals(const Decimal &d) const
Determines if the values represented by the current object and the specified object are equal.
static int64_t ToInt64(Decimal value)
Converts the Decimal value to signed 64-bit integer value.
Definition: decimal.h:480
String ToString(const SharedPtr< Globalization::NumberFormatInfo > &nfi) const
static Decimal FromOACurrency(int64_t currency)
Convert the specified OLE currency value to the equivalent Decimal value. NOT IMPLEMENTED.
Decimal(const std::string &str)
Constructs an instance that represents a value whose string representation is specified as an instanc...
static bool Equals(const Decimal &d1, const Decimal &d2)
Determines if the values represented by the specified objects are equal.
Definition: decimal.h:369
static Decimal Subtract(const Decimal &d1, const Decimal &d2)
Subtracts one specified Decimal value from another.
Definition: decimal.h:446
Decimal & operator+=(const Decimal &d)
Assigns to the current object a new value that is a sum of values represented by the current and spec...
Decimal(const ArrayPtr< int32_t > &bits)
Constructs an instance of Decimal class from integer array containing a binary representation.
String ToStringInternal() const
Returns the string representation of the value represented by the object. For internal use.
static int64_t ToOACurrency(const Decimal &value)
Convert the specified Decimal value to the equivalent OLE currency value. NOT IMPLEMENTED.
Decimal(double d)
Constructs an instance that represents the specified value.
Decimal & operator-=(const Decimal &d)
Assigns to the current object a new value that is the result of subtraction of the value represented ...
static Decimal Multiply(const Decimal &d1, const Decimal &d2)
Multiplies two specified Decimal values.
Definition: decimal.h:461
Decimal & operator++()
Increments the value represented by the current object.
static double ToDouble(Decimal value)
Converts the Decimal value to double precision floating-point number.
Definition: decimal.h:484
Decimal(std::int16_t i)
Constructs an instance that represents the specified value.
static uint64_t ToUInt64(Decimal value)
Converts the Decimal value to unsigned 64-bit integer value.
Definition: decimal.h:478
static Decimal Round(const Decimal &d, int digits, MidpointRounding mode=MidpointRounding::ToEven)
Rounds the specified value to the nearest value with the specified number of fractional digits....
static const Decimal Zero
Represents number 0.
Definition: decimal.h:123
static System::ArrayPtr< int > GetBits(const Decimal &d)
Converts the specified Decimal object into the binary representation of the value it represents.
Decimal(std::nullptr_t bits)
Always throws ArgumentNullException.
static const TypeInfo & Type()
Returns a reference to the TypeInfo object representing the Decimal class' type information.
Definition: decimal.h:409
Decimal(std::uint32_t i)
Constructs an instance that represents the specified value.
static int8_t ToSByte(Decimal value)
Converts the Decimal value to signed 8-bit integer value.
Definition: decimal.h:468
bool operator!=(const Decimal &d) const
Determines if the values represented by the current object and the specified object are not equal.
static Decimal Negate(const Decimal &d)
Returns a new instance of Decimal class that represents a value that results from negation of the val...
Definition: decimal.h:463
bool operator>=(const Decimal &d) const
Determines if the value represented by the current object is greater than or equal to the value repre...
Decimal operator/(const Decimal &d) const
Returns a new instance of Decimal class that represents a value that is a result of division of the v...
static const Decimal MinValue
Represents the smallest number that can be represented by Decimal class.
Definition: decimal.h:117
Decimal operator-() const
Returns a new instance of Decimal class that represents a value that results from negation of the val...
bool operator==(const Decimal &d) const
Determines if the values represented by the current object and the specified object are equal.
String ToString(const String &format, const SharedPtr< Globalization::CultureInfo > &culture) const
Pointer class to wrap types being allocated on heap. Use it to manage memory for classes inheriting O...
Definition: smart_ptr.h:180
String class used across the library. Is a substitute for C# System.String when translating code....
Definition: string.h:122
Represents a particular type and provides information about it.
Definition: type_info.h:109
NumberStyles
Number style allowed when parsing.
Definition: number_styles.h:12
Definition: db_command.h:9
void PrintTo(DateTime value, std::ostream *stream)
Prints value to ostream. Mostly used for debug.
Decimal operator/(const T &x, const Decimal &d)
Returns a new instance of Decimal class that represents a value that is a result of division of the s...
Definition: decimal.h:563
TypeCode
Represents the type of an object.
Definition: type_code.h:19
@ Decimal
A simple type representing values ranging from 1.0 x 10 -28 to approximately 7.9 x 10 28 with 28-29 s...
MidpointRounding
Specifies the behavior of rounding functions.
Definition: midpoint_rounding.h:10
Decimal operator*(const T &x, const Decimal &d)
Returns a new instance of Decimal class that represents a value that is a result of multiplication of...
Definition: decimal.h:556
auto operator-(DayOfWeek a, DayOfWeek b)
Calculates the number of days between two days of week.
Definition: day_of_week.h:25
Template predicate that checks if boxing of the specified type is supported.
Definition: boxable_traits.h:16
Wrapper for a pointer to an instance of TypeInfo class. This type should be allocated on stack and pa...
Definition: type_info.h:72