Skip to content

Commit 782f5f1

Browse files
authored
[decimal] Updates to the Decimal type (#38)
This PR brings some changes to the `Decimal` type: - Add augmented arithmetic operations, e.g., `__iadd__`, `__isub__`, etc. - Add `repr_components` method. - Change the trait `Intable` to `IntableRaising`.
1 parent 467be20 commit 782f5f1

File tree

3 files changed

+271
-259
lines changed

3 files changed

+271
-259
lines changed

src/decimojo/constants.mojo

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -481,15 +481,15 @@ fn E0D25() -> Decimal:
481481
# The repr of the magic numbers can be obtained by the following code:
482482
#
483483
# ```mojo
484-
# fn print_repr_from_words(value: String, ln_value: String) raises:
484+
# fn print_repr_words(value: String, ln_value: String) raises:
485485
# """
486486
# Prints the hex representation of a logarithm value.
487487
# Args:
488488
# value: The original value (for display purposes).
489489
# ln_value: The natural logarithm as a String.
490490
# """
491491
# var log_decimal = Decimal(ln_value)
492-
# print("ln(" + value + "): " + log_decimal.repr_from_words())
492+
# print("ln(" + value + "): " + log_decimal.repr_words())
493493
# ```
494494

495495

0 commit comments

Comments
 (0)