Add Num.round to dev backend

This commit is contained in:
Joshua Hoeflich 2021-08-15 17:50:07 -05:00
parent b25862a93b
commit 1c6ac84f2f
7 changed files with 589 additions and 564 deletions

View file

@ -79,6 +79,7 @@ comptime {
exportNumFn(num.powInt, "pow_int");
exportNumFn(num.acos, "acos");
exportNumFn(num.asin, "asin");
exportNumFn(num.round, "round");
}
// Str Module

View file

@ -21,3 +21,7 @@ pub fn acos(num: f64) callconv(.C) f64 {
pub fn asin(num: f64) callconv(.C) f64 {
return @call(.{ .modifier = always_inline }, math.asin, .{num});
}
pub fn round(num: f64) callconv(.C) i64 {
return @floatToInt(i32, (@round(num)));
}