feat: add floats
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
[code]
|
||||
fn negate_f32(x: f32) -> f32 {
|
||||
return -x;
|
||||
}
|
||||
|
||||
fn negate_f64(x: f64) -> f64 {
|
||||
return -x;
|
||||
}
|
||||
|
||||
[harness]
|
||||
extern float negate_f32(float x);
|
||||
extern double negate_f64(double x);
|
||||
|
||||
int main() {
|
||||
if (negate_f32(3.5f) != -3.5f) return 1;
|
||||
if (negate_f64(-4.2) != 4.2) return 2;
|
||||
return 0;
|
||||
}
|
||||
|
||||
[expected_return_code]
|
||||
0
|
||||
Reference in New Issue
Block a user