Skip to content

minor improvements#148

Closed
mikem8891 wants to merge 1 commit intorust-num:masterfrom
mikem8891:minor-improvements
Closed

minor improvements#148
mikem8891 wants to merge 1 commit intorust-num:masterfrom
mikem8891:minor-improvements

Conversation

@mikem8891
Copy link

In the fn round I changed one from a Ratio<T> to T because addition with a integer is quicker, avoids a lcm call, and some clone calls.

In Neg::neg for Ratio<T>, the value is changed in place. I think this might prevent some memory from being moved or allocated.

In Inv::inv, I changed recip to into_recip to prevent a clone operation. This is in the spirit of #110.

In the `fn round` I changed `one` from a `Ratio<t>` to `T` because addition with a integer is quicker.

In `Neg::neg` for `Ratio<T>`, the value is changed in place. I think this might prevent some memory from being moved or allocated.

In `Inv::inv`, I changed `recip` to `into_recip` to prevent a clone operation.
mikem8891 added a commit to mikem8891/num-rational that referenced this pull request Mar 13, 2026
@mikem8891
Copy link
Author

Superseded by #150

@mikem8891 mikem8891 closed this Mar 13, 2026
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