Commit 96b5a01
authored
This pull request introduces several new features and improvements to
the `decimojo` library, focusing on arithmetic operations, benchmarking,
and rounding modes. The most important changes include adding new
arithmetic functions, updating benchmarks, and refining the rounding
mode implementation.
### New Arithmetic Functions:
* Added `floor_divide` and `modulo` functions to the `arithmetics.mojo`
file. These functions provide integral division and remainder operations
for `Decimal` types.
### Benchmark Updates:
* Updated `benches/bench.mojo` to include new benchmarks for
`floor_divide` and `modulo` operations.
* Updated `mojoproject.toml` to include test and benchmark commands for
`floor_divide` and `modulo`.
### Rounding Mode Improvements:
* Refined the `RoundingMode` struct by renaming methods and aliases to
use lowercase names, improving code readability and consistency.
### Code Simplification:
* Simplified the `Decimal` struct by removing unnecessary exception
handling in arithmetic dunder methods.
* Removed redundant scientific exponent calculation method from the
`Decimal` struct.
### Miscellaneous:
* Updated the `__init__.mojo` file to import the new `divide`,
`floor_divide`, and `modulo` functions.
* Fixed the rounding mode in the `Decimal` struct to use the correct
constant names.
1 parent 2f1bdb3 commit 96b5a01
11 files changed
Lines changed: 1564 additions & 67 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
| 6 | + | |
5 | 7 | | |
6 | 8 | | |
7 | 9 | | |
| |||
21 | 23 | | |
22 | 24 | | |
23 | 25 | | |
| 26 | + | |
| 27 | + | |
24 | 28 | | |
25 | 29 | | |
26 | 30 | | |
| |||
0 commit comments