Speed up i256 division and remainder operations#4303
Speed up i256 division and remainder operations#4303tustvold merged 11 commits intoapache:masterfrom
Conversation
|
tustvold
left a comment
There was a problem hiding this comment.
Thank you for this, left some comments
| /// [`i256`] operations return this error type. | ||
| #[derive(Debug)] | ||
| pub struct ParseI256Error {} | ||
| pub enum I256Error { |
There was a problem hiding this comment.
This is a breaking change (which is fine)
There was a problem hiding this comment.
I've filed #4318 to remove this breaking change, PTAL
| if me < you { | ||
| return Ok((Self::from_le_bytes(ret), self)); | ||
| } | ||
|
|
There was a problem hiding this comment.
I wonder if at this point we could fallback to 128-bit division if both the high components are zero?
There was a problem hiding this comment.
The low component is u128. If the high component is zero, it might be possibly over i128 range, no?
There was a problem hiding this comment.
Is that a problem, we have already taken the absolute value, so it is an unsigned division operation?
There was a problem hiding this comment.
Oh, got your idea. You meant to do it in u128.
Which issue does this PR close?
Closes #4302.
Rationale for this change
What changes are included in this PR?
Are there any user-facing changes?