20 lines
375 B
Plaintext
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 |