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

20 lines
380 B
Plaintext

[code]
fn test_f64(x: f64, y: f64) -> f64 {
let z: f64 = 2.5;
// (7.0 - 2.0) / 2.5 + (7.0 * 2.0) = 5.0 / 2.5 + 14.0 = 2.0 + 14.0 = 16.0
return (x - y) / z + (x * y);
}
[harness]
extern double test_f64(double x, double y);
int main() {
double result = test_f64(7.0, 2.0);
if (result == 16.0) {
return 0;
}
return 1;
}
[expected_return_code]
0