diff options
| author | gingerBill <bill@gingerbill.org> | 2024-06-29 19:50:51 +0100 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2024-06-29 19:50:51 +0100 |
| commit | e296d6fb902083fac534bdd4c804e6dbad2fc458 (patch) | |
| tree | 18e0875791d202dc4dde1d148c0786494e2b2b14 /core/math/big/private.odin | |
| parent | 90244a0849afe9f17e011dc8c3bae571c9f5bb26 (diff) | |
Fix loads of indentation issues with mixing spaces and tabs
Diffstat (limited to 'core/math/big/private.odin')
| -rw-r--r-- | core/math/big/private.odin | 46 |
1 files changed, 23 insertions, 23 deletions
diff --git a/core/math/big/private.odin b/core/math/big/private.odin index 2ee6cfafa..220f39871 100644 --- a/core/math/big/private.odin +++ b/core/math/big/private.odin @@ -787,8 +787,8 @@ _private_int_sqr_comba :: proc(dest, src: ^Int, allocator := context.allocator) /* Karatsuba squaring, computes `dest` = `src` * `src` using three half-size squarings. - See comments of `_private_int_mul_karatsuba` for details. - It is essentially the same algorithm but merely tuned to perform recursive squarings. + See comments of `_private_int_mul_karatsuba` for details. + It is essentially the same algorithm but merely tuned to perform recursive squarings. */ _private_int_sqr_karatsuba :: proc(dest, src: ^Int, allocator := context.allocator) -> (err: Error) { context.allocator = allocator @@ -967,7 +967,7 @@ _private_int_div_3 :: proc(quotient, numerator: ^Int, allocator := context.alloc /* b = 2^_DIGIT_BITS / 3 */ - b := _WORD(1) << _WORD(_DIGIT_BITS) / _WORD(3) + b := _WORD(1) << _WORD(_DIGIT_BITS) / _WORD(3) q := &Int{} internal_grow(q, numerator.used) or_return @@ -1007,8 +1007,8 @@ _private_int_div_3 :: proc(quotient, numerator: ^Int, allocator := context.alloc */ if quotient != nil { err = clamp(q) - internal_swap(q, quotient) - } + internal_swap(q, quotient) + } internal_destroy(q) return remainder, nil } @@ -1555,24 +1555,24 @@ _private_int_gcd_lcm :: proc(res_gcd, res_lcm, a, b: ^Int, allocator := context. /* If neither `a` or `b` was zero, we need to compute `gcd`. - Get copies of `a` and `b` we can modify. - */ + Get copies of `a` and `b` we can modify. + */ u, v := &Int{}, &Int{} defer internal_destroy(u, v) internal_copy(u, a) or_return internal_copy(v, b) or_return - /* - Must be positive for the remainder of the algorithm. - */ + /* + Must be positive for the remainder of the algorithm. + */ u.sign = .Zero_or_Positive; v.sign = .Zero_or_Positive - /* - B1. Find the common power of two for `u` and `v`. - */ - u_lsb, _ := internal_count_lsb(u) - v_lsb, _ := internal_count_lsb(v) - k := min(u_lsb, v_lsb) + /* + B1. Find the common power of two for `u` and `v`. + */ + u_lsb, _ := internal_count_lsb(u) + v_lsb, _ := internal_count_lsb(v) + k := min(u_lsb, v_lsb) if k > 0 { /* @@ -1615,11 +1615,11 @@ _private_int_gcd_lcm :: proc(res_gcd, res_lcm, a, b: ^Int, allocator := context. internal_shr(v, v, b) or_return } - /* - Multiply by 2**k which we divided out at the beginning. - */ - internal_shl(temp_gcd_res, u, k) or_return - temp_gcd_res.sign = .Zero_or_Positive + /* + Multiply by 2**k which we divided out at the beginning. + */ + internal_shl(temp_gcd_res, u, k) or_return + temp_gcd_res.sign = .Zero_or_Positive /* We've computed `gcd`, either the long way, or because one of the inputs was zero. @@ -1786,8 +1786,8 @@ _private_montgomery_reduce_comba :: proc(x, n: ^Int, rho: DIGIT, allocator := co `a = a + mu * m * b**i` This is computed in place and on the fly. The multiplication - by b**i is handled by offseting which columns the results - are added to. + by b**i is handled by offseting which columns the results + are added to. Note the comba method normally doesn't handle carries in the inner loop In this case we fix the carry from the previous |