mirror of
https://codeberg.org/ziglang/zig.git
synced 2026-04-26 13:01:34 +03:00
484cc15366
If the float can store all possible values of the integer without rounding, coercion is allowed. The integer's precision must be less than or equal to the float's significand precision. Closes #18614
9 lines
161 B
Zig
9 lines
161 B
Zig
test "integer type is too large for implicit cast to float" {
|
|
var int: u25 = 123;
|
|
_ = ∫
|
|
const float: f32 = int;
|
|
_ = float;
|
|
}
|
|
|
|
// test_error=
|