mirror of
https://codeberg.org/ziglang/zig.git
synced 2025-12-09 15:19:07 +00:00
Simplify half_ctlr
This commit is contained in:
parent
bb4def62df
commit
16cf4b0dc6
1 changed files with 1 additions and 1 deletions
|
|
@ -40,8 +40,8 @@ pub fn egcd(a: anytype, b: anytype) ExtendedGreatestCommonDivisor(@TypeOf(a, b))
|
|||
};
|
||||
const toinv = @shrExact(other, @intCast(shift));
|
||||
const ctrl = @shrExact(odd, @intCast(shift)); // Invariant: |s|, |t|, |ctrl| < |MIN_OF(S)|
|
||||
const half_ctrl = 1 + @shrExact(ctrl - 1, 1);
|
||||
const abs_ctrl = @abs(ctrl);
|
||||
const half_ctrl: S = @intCast(1 + abs_ctrl >> 1);
|
||||
|
||||
var s: S = std.math.sign(toinv);
|
||||
var t: S = 0;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue