#How to cast u64 to i64?
1 messages · Page 1 of 1 (latest)
nope, that's kinda how you have to do it, either create separate variables or use @as
you could also do
const x: i64 = @bitCast(u64_val)
if you're certain that it will fit in an i64
make a helper function, you can make it a single character if thats what you want.
fn a(in: u64) i64 {
return @intCast(in);
}
Now using only 3 characters you can cast anything you want. Cant get much shorter than that. a(...)
80 character column lengths saved, hundreds of hours wasted in key strokes prevented, world peace achieved, or something like that idk.