Skip to content

[decimal] Rename floor_divide to truncate_divide to avoid ambiguity#52

Merged
forfudan merged 1 commit intomainfrom
work
Mar 23, 2025
Merged

[decimal] Rename floor_divide to truncate_divide to avoid ambiguity#52
forfudan merged 1 commit intomainfrom
work

Conversation

@forfudan
Copy link
Copy Markdown
Owner

This pull request involves renaming the floor_divide function and all related references to truncate_divide across multiple files. The changes ensure consistency in the naming convention and update the logic accordingly.

Renaming and Updating Functions:

  • benches/decimal/bench.mojo: Renamed bench_floor_divide to bench_truncate_divide in the import statements and function calls.
  • benches/decimal/bench_truncate_divide.mojo: Renamed from bench_floor_divide.mojo and updated all instances of run_benchmark_floor_divide to run_benchmark_truncate_divide.
  • src/decimojo/__init__.mojo: Updated import statement from floor_divide to truncate_divide.
  • src/decimojo/decimal/arithmetics.mojo: Renamed floor_divide function to truncate_divide and updated the corresponding logic in the modulo function.

Updating Decimal Struct:

  • src/decimojo/decimal/decimal.mojo: Updated all instances of floor_divide to truncate_divide in the __floordiv__, __mod__, __rfloordiv__, __rmod__, __ifloordiv__, and __imod__ methods. Added docstrings to reflect the changes.

@forfudan forfudan merged commit 9a4cdee into main Mar 23, 2025
1 check passed
@forfudan forfudan deleted the work branch March 23, 2025 22:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant