Adds castToNat

This commit is contained in:
Joshua Hoeflich 2021-08-18 11:02:20 -05:00
parent 7068da7144
commit 92da003fba
8 changed files with 23 additions and 2 deletions

View file

@ -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)));
}