| ... | @@ -763,8 +763,8 @@ pub const Mutable = struct { | ... | @@ -763,8 +763,8 @@ pub const Mutable = struct { |
| 763 | /// q may alias with a or b. | 763 | /// q may alias with a or b. |
| 764 | /// | 764 | /// |
| 765 | /// Asserts there is enough memory to store q and r. | 765 | /// Asserts there is enough memory to store q and r. |
| 766 | /// The upper bound for r limb count is b.limbs.len. | 766 | /// The upper bound for r limb count is `b.limbs.len`. |
| 767 | /// The upper bound for q limb count is given by `a.limbs.len + b.limbs.len`. | 767 | /// The upper bound for q limb count is given by `a.limbs`. |
| 768 | /// | 768 | /// |
| 769 | /// If `allocator` is provided, it will be used for temporary storage to improve | 769 | /// If `allocator` is provided, it will be used for temporary storage to improve |
| 770 | /// multiplication performance. `error.OutOfMemory` is handled with a fallback algorithm. | 770 | /// multiplication performance. `error.OutOfMemory` is handled with a fallback algorithm. |
| ... | @@ -893,9 +893,8 @@ pub const Mutable = struct { | ... | @@ -893,9 +893,8 @@ pub const Mutable = struct { |
| 893 | /// q may alias with a or b. | 893 | /// q may alias with a or b. |
| 894 | /// | 894 | /// |
| 895 | /// Asserts there is enough memory to store q and r. | 895 | /// Asserts there is enough memory to store q and r. |
| 896 | /// The upper bound for r limb count is a.limbs.len. | 896 | /// The upper bound for r limb count is `b.limbs.len`. |
| 897 | /// The upper bound for q limb count is given by `calcQuotientLimbLen`. This accounts | 897 | /// The upper bound for q limb count is given by `a.limbs.len`. |
| 898 | /// for temporary space used by the division algorithm. | | |
| 899 | /// | 898 | /// |
| 900 | /// If `allocator` is provided, it will be used for temporary storage to improve | 899 | /// If `allocator` is provided, it will be used for temporary storage to improve |
| 901 | /// multiplication performance. `error.OutOfMemory` is handled with a fallback algorithm. | 900 | /// multiplication performance. `error.OutOfMemory` is handled with a fallback algorithm. |
| ... | @@ -2569,7 +2568,7 @@ pub const Managed = struct { | ... | @@ -2569,7 +2568,7 @@ pub const Managed = struct { |
| 2569 | /// | 2568 | /// |
| 2570 | /// Returns an error if memory could not be allocated. | 2569 | /// Returns an error if memory could not be allocated. |
| 2571 | pub fn divFloor(q: *Managed, r: *Managed, a: Const, b: Const) !void { | 2570 | pub fn divFloor(q: *Managed, r: *Managed, a: Const, b: Const) !void { |
| 2572 | try q.ensureCapacity(a.limbs.len + b.limbs.len); | 2571 | try q.ensureCapacity(a.limbs.len); |
| 2573 | try r.ensureCapacity(b.limbs.len); | 2572 | try r.ensureCapacity(b.limbs.len); |
| 2574 | var mq = q.toMutable(); | 2573 | var mq = q.toMutable(); |
| 2575 | var mr = r.toMutable(); | 2574 | var mr = r.toMutable(); |
| ... | @@ -2586,7 +2585,7 @@ pub const Managed = struct { | ... | @@ -2586,7 +2585,7 @@ pub const Managed = struct { |
| 2586 | /// | 2585 | /// |
| 2587 | /// Returns an error if memory could not be allocated. | 2586 | /// Returns an error if memory could not be allocated. |
| 2588 | pub fn divTrunc(q: *Managed, r: *Managed, a: Const, b: Const) !void { | 2587 | pub fn divTrunc(q: *Managed, r: *Managed, a: Const, b: Const) !void { |
| 2589 | try q.ensureCapacity(a.limbs.len + b.limbs.len); | 2588 | try q.ensureCapacity(a.limbs.len); |
| 2590 | try r.ensureCapacity(b.limbs.len); | 2589 | try r.ensureCapacity(b.limbs.len); |
| 2591 | var mq = q.toMutable(); | 2590 | var mq = q.toMutable(); |
| 2592 | var mr = r.toMutable(); | 2591 | var mr = r.toMutable(); |