mirror of
https://github.com/ziglang/zig.git
synced 2024-11-28 16:12:33 +00:00
e7b7088056
- This implements the float_to_int AIR instruction. - Lowering a decl_ref to a slice was previously assumed to contain a pointer to a slice, rather than an array. This is now fixed, making `@src()` work as well. - Some preliminary work on 128bit integers have been done to find out what needs to be done to implement 128bit arithmetic.
11 lines
241 B
Zig
11 lines
241 B
Zig
const std = @import("std");
|
|
const expect = std.testing.expect;
|
|
const maxInt = std.math.maxInt;
|
|
|
|
test "@intCast i32 to u7" {
|
|
var x: u128 = maxInt(u128);
|
|
var y: i32 = 120;
|
|
var z = x >> @intCast(u7, y);
|
|
try expect(z == 0xff);
|
|
}
|