You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
a number not being comptime_int does not mean it's necessarily not comptime-known. it is a u7 because that is what is returned from std.math.IntFittingRange(0, 64)
a number not being comptime_int does not mean it's necessarily not comptime-known. it is a u7 because that is what is returned from std.math.IntFittingRange(0, 64)
This current compiler behavior makes sense to me, but following sentence is included in the docs of all three builtins:
If operand is a comptime-known integer, the return type is comptime_int.
Zig Version
0.10.0, 0.10.1, 0.11.0, 0.12.0, 0.13.0, 0.14.0-dev.541+2e8acdf6f
Steps to Reproduce and Observed Behavior
Execute this code:
The comptime log is:
Expected Behavior
According to the docs of
@clz
,@ctz
and@popCount
the comptime log should be this because@as(u64, 0xabc)
is a comptime known integer:In zig 0.9.0 and 0.9.1 this seems to work
the output of
is this:
In my option the current behaviour is good and this is a documentation error.
The text was updated successfully, but these errors were encountered: