Conversation
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## main #293 +/- ##
==========================================
- Coverage 82.85% 82.59% -0.27%
==========================================
Files 53 53
Lines 5681 5704 +23
==========================================
+ Hits 4707 4711 +4
- Misses 974 993 +19
☔ View full report in Codecov by Sentry. |
|
approach is good, i think we still disagree on the behavior wrt infinite iterators |
|
This is mostly orthogonal to how long iterators are handled and should make things strictly better. Ready for review. I mostly wrote it because abusing the stack to reverse a list seemed like a bad idea. |
src/algorithms/mul.rs
Outdated
| /// Computes `lhs *= a` and returns the carry. | ||
| pub fn mul_nx1(lhs: &mut [u64], a: u64) -> u64 { | ||
| let mut carry = 0; | ||
| for lhs in lhs.iter_mut() { |
There was a problem hiding this comment.
if lhs is empty this will return 0. is this intended, or should it return a? my belief is that a 0-byte uint always represents the number 0, so carry on a mul is always 0.
There was a problem hiding this comment.
my belief is that a 0-byte uint always represents the number 0
This is correct. See for example U0::ZERO. (This is also the reason why no Uint::ONE can exits)
Motivation
Solution
PR Checklist