diff options
| author | Andrew Kelley <superjoe30@gmail.com> | 2017-08-17 17:14:35 -0400 |
|---|---|---|
| committer | Andrew Kelley <superjoe30@gmail.com> | 2017-08-17 17:14:35 -0400 |
| commit | 0d117bb0a993b2a0a290f99255c5bf1bf05f187f (patch) | |
| tree | 54abbc90bb6c31746eb0d9b1c8a3269395190900 /test | |
| parent | 6a98bf3dba6f3ed5b40fe7899899e2a792028be4 (diff) | |
| download | zig-0d117bb0a993b2a0a290f99255c5bf1bf05f187f.tar.gz zig-0d117bb0a993b2a0a290f99255c5bf1bf05f187f.zip | |
fix wrong value for clz, ctz at compile time
closes #418
also make clz, ctz return smaller integer bit widths
and use smaller integer bit widths for enum tag types
Diffstat (limited to 'test')
| -rw-r--r-- | test/cases/math.zig | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/test/cases/math.zig b/test/cases/math.zig index 82773f077a..5707e40607 100644 --- a/test/cases/math.zig +++ b/test/cases/math.zig @@ -66,6 +66,8 @@ fn testClz() { assert(clz(u8(0b00001010)) == 4); assert(clz(u8(0b10001010)) == 0); assert(clz(u8(0b00000000)) == 8); + assert(clz(u128(0xffffffffffffffff)) == 64); + assert(clz(u128(0x10000000000000000)) == 63); } fn clz(x: var) -> usize { |
