-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Casting to bool #2841
Comments
For bool to int use @boolToInt. For int to bool, use It's intentional that implicit casting an integer to boolean does not work, otherwise this would work: test "aaa" {
if (0) {
// ...
}
} |
Hey, what happended to @boolToInt? |
It has been renamed to |
Nope, now you have to use @bitCast const number : u1 = @bitCast(boolean); |
@tuket that is not true -- the comment you replied to is easily verified to be accurate. Please check before commenting incorrect information. |
I would expect
bool(0)
to befalse
andbool(1)
to betrue
.The text was updated successfully, but these errors were encountered: