feat: add floats
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
[code]
|
||||
fn is_less_f64(x: f64, y: f64) -> bool {
|
||||
return x < y;
|
||||
}
|
||||
|
||||
fn is_greater_eq_f32(x: f32, y: f32) -> bool {
|
||||
return x >= y;
|
||||
}
|
||||
|
||||
[harness]
|
||||
#include <stdbool.h>
|
||||
|
||||
extern bool is_less_f64(double x, double y);
|
||||
extern bool is_greater_eq_f32(float x, float y);
|
||||
|
||||
int main() {
|
||||
if (!is_less_f64(3.14, 5.0)) return 1;
|
||||
if (is_less_f64(5.0, 3.14)) return 2;
|
||||
if (!is_greater_eq_f32(2.5f, 2.5f)) return 3;
|
||||
return 0;
|
||||
}
|
||||
|
||||
[expected_return_code]
|
||||
0
|
||||
Reference in New Issue
Block a user