@@ -11,32 +11,94 @@ package aws.smithy.kotlin.runtime.content
1111public expect class BigDecimal (value : String ) :
1212 Number ,
1313 Comparable <BigDecimal > {
14+
1415 /* *
1516 * Create an instance of [BigDecimal] from a mantissa and exponent.
16- * @param mantissa a [BigInteger] representing the mantissa of this big decimal
17- * @param exponent an [Int] representing the exponent of this big decimal
17+ * @param mantissa a [BigInteger] representing the [significant digits](https://en.wikipedia.org/wiki/Significand)
18+ * of this decimal value
19+ * @param exponent an [Int] representing the exponent of this decimal value
1820 */
1921 public constructor (mantissa: BigInteger , exponent: Int )
2022
2123 /* *
22- * The mantissa of this decimal number
24+ * The [significant digits](https://en.wikipedia.org/wiki/Significand) of this decimal value
2325 */
2426 public val mantissa: BigInteger
2527
2628 /* *
27- * The exponent of this decimal number.
28- * If zero or positive, this represents the number of digits to the right of the decimal point.
29- * If negative, the mantissa is multiplied by ten to the power of the negation of the scale.
29+ * The exponent of this decimal number. If zero or positive, this represents the number of digits to the right of
30+ * the decimal point. If negative, the [mantissa] is multiplied by ten to the power of the negation of the scale.
3031 */
3132 public val exponent: Int
3233
34+ /* *
35+ * Converts this value to a [Byte], which may involve rounding or truncation
36+ */
3337 override fun toByte (): Byte
38+
39+ /* *
40+ * Converts this value to a [Double], which may involve rounding or truncation
41+ */
3442 override fun toDouble (): Double
43+
44+ /* *
45+ * Converts this value to a [Float], which may involve rounding or truncation
46+ */
3547 override fun toFloat (): Float
48+
49+ /* *
50+ * Converts this value to a [Short], which may involve rounding or truncation
51+ */
3652 override fun toShort (): Short
53+
54+ /* *
55+ * Converts this value to an [Int], which may involve rounding or truncation
56+ */
3757 override fun toInt (): Int
58+
59+ /* *
60+ * Converts this value to a [Long], which may involve rounding or truncation
61+ */
3862 override fun toLong (): Long
63+
64+ /* *
65+ * Returns the decimal (i.e., radix-10) string representation of this value in long-form (i.e., _not_ scientific)
66+ * notation
67+ */
3968 public fun toPlainString (): String
69+
70+ /* *
71+ * Returns the decimal (i.e., radix-10) string representation of this value using scientific notation if an exponent
72+ * is needed
73+ */
74+ override fun toString (): String
75+
76+ /* *
77+ * Returns a hash code for this value
78+ */
79+ override fun hashCode (): Int
80+
81+ /* *
82+ * Checks if this value is equal to the given object
83+ * @param other The other value to compare against
84+ */
4085 override fun equals (other : Any? ): Boolean
86+
87+ /* *
88+ * Returns the sum of this value and the given value
89+ * @param other The other value to add (i.e., the addend)
90+ */
91+ public operator fun plus (other : BigDecimal ): BigDecimal
92+
93+ /* *
94+ * Returns the difference of this value and the given value
95+ * @param other The value to subtract (i.e., the subtrahend)
96+ */
97+ public operator fun minus (other : BigDecimal ): BigDecimal
98+
99+ /* *
100+ * Compare this value to the given value for in/equality
101+ * @param other The value to compare against
102+ */
41103 public override operator fun compareTo (other : BigDecimal ): Int
42104}
0 commit comments