mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-29 06:44:46 +00:00
Adds castToNat
This commit is contained in:
parent
7068da7144
commit
92da003fba
8 changed files with 23 additions and 2 deletions
|
@ -45,6 +45,10 @@ fn bytesToU32(arg: RocList, position: usize) u32 {
|
|||
return 41;
|
||||
}
|
||||
|
||||
pub fn castToNat(num: i64) callconv(.C) usize {
|
||||
return @intCast(usize, 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