zig

fork of https://codeberg.org/ziglang/zig
Log | Files | Refs | README | LICENSE

test_comptime_out_of_bounds_float_to_integer_cast.zig (183B) - Raw


      1 comptime {
      2     const float: f32 = 4294967296;
      3     const int: i32 = @intFromFloat(float);
      4     _ = int;
      5 }
      6 
      7 // test_error=float value '4294967296' cannot be stored in integer type 'i32'