Files
compiler-old/tests/float_f32_arithmetic.test
T
2026-04-22 22:24:48 +02:00

20 lines
375 B
Plaintext

[code]
fn test_f32(x: f32, y: f32) -> f32 {
let z: f32 = 1.5;
// (4.0 + 2.0) * 1.5 - (4.0 / 2.0) = 6.0 * 1.5 - 2.0 = 9.0 - 2.0 = 7.0
return (x + y) * z - (x / y);
}
[harness]
extern float test_f32(float x, float y);
int main() {
float result = test_f32(4.0f, 2.0f);
if (result == 7.0f) {
return 0;
}
return 1;
}
[expected_return_code]
0