Mathlib round corrections

This commit is contained in:
2025-09-22 20:03:17 +10:00
parent 7e76d473e7
commit 5e7de482e7
3 changed files with 5 additions and 5 deletions

View File

@@ -30,17 +30,17 @@ GroundValue modVal(GroundValue* args, int arg_count) {
GroundValue floorVal(GroundValue* args, int arg_count) {
VALIDATE_ARGS_1(GROUND_DOUBLE);
return GROUND_DOUBLE_VAL(floor(GET_DOUBLE(args[0])));
return GROUND_INT_VAL(int(floor(GET_DOUBLE(args[0]))));
}
GroundValue ceilVal(GroundValue* args, int arg_count) {
VALIDATE_ARGS_1(GROUND_DOUBLE);
return GROUND_DOUBLE_VAL(ceil(GET_DOUBLE(args[0])));
return GROUND_INT_VAL(int(ceil(GET_DOUBLE(args[0]))));
}
GroundValue roundVal(GroundValue* args, int arg_count) {
VALIDATE_ARGS_1(GROUND_DOUBLE);
return GROUND_DOUBLE_VAL(round(GET_DOUBLE(args[0])));
return GROUND_INT_VAL(int(round(GET_DOUBLE(args[0]))));
}
GroundValue randomInt(GroundValue* args, int arg_count) {

BIN
math/math.so Executable file

Binary file not shown.