diff options
| author | Jacob Young <jacobly0@users.noreply.github.com> | 2025-01-02 03:10:19 -0500 |
|---|---|---|
| committer | Jacob Young <jacobly0@users.noreply.github.com> | 2025-01-16 20:42:08 -0500 |
| commit | e5d5a8bc4ea6b27dc3540ad4800a1231ff50b33d (patch) | |
| tree | 114481f7bbf4d5e6a4703a7606f654dabb5df330 /lib/std/math | |
| parent | ac1a975f9b5a7d939663fa90556a2f038250c531 (diff) | |
| download | zig-e5d5a8bc4ea6b27dc3540ad4800a1231ff50b33d.tar.gz zig-e5d5a8bc4ea6b27dc3540ad4800a1231ff50b33d.zip | |
x86_64: implement switch jump tables
Diffstat (limited to 'lib/std/math')
| -rw-r--r-- | lib/std/math/big/int.zig | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/std/math/big/int.zig b/lib/std/math/big/int.zig index 98d37d8994..2549644dbc 100644 --- a/lib/std/math/big/int.zig +++ b/lib/std/math/big/int.zig @@ -2523,7 +2523,7 @@ pub const Const = struct { /// Returns the number of leading zeros in twos-complement form. pub fn clz(a: Const, bits: Limb) Limb { // Limbs are stored in little-endian order but we need to iterate big-endian. - if (!a.positive) return 0; + if (!a.positive and !a.eqlZero()) return 0; var total_limb_lz: Limb = 0; var i: usize = a.limbs.len; const bits_per_limb = @bitSizeOf(Limb); |
