mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-28 06:14:46 +00:00
Add Num.round to dev backend
This commit is contained in:
parent
b25862a93b
commit
1c6ac84f2f
7 changed files with 589 additions and 564 deletions
|
@ -79,6 +79,7 @@ comptime {
|
|||
exportNumFn(num.powInt, "pow_int");
|
||||
exportNumFn(num.acos, "acos");
|
||||
exportNumFn(num.asin, "asin");
|
||||
exportNumFn(num.round, "round");
|
||||
}
|
||||
|
||||
// Str Module
|
||||
|
|
|
@ -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)));
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue