mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-27 05:49:08 +00:00
add decimal comparisons and conversions to wasm backend
This commit is contained in:
parent
d7bc03c589
commit
5bcfd91f3a
4 changed files with 134 additions and 7 deletions
|
@ -20,7 +20,6 @@ const dec = @import("dec.zig");
|
|||
comptime {
|
||||
exportDecFn(dec.fromStr, "from_str");
|
||||
exportDecFn(dec.toStr, "to_str");
|
||||
exportDecFn(dec.fromF64C, "from_f64");
|
||||
exportDecFn(dec.fromU64C, "from_u64");
|
||||
exportDecFn(dec.toI128, "to_i128");
|
||||
exportDecFn(dec.eqC, "eq");
|
||||
|
@ -43,6 +42,9 @@ comptime {
|
|||
inline for (INTEGERS) |T| {
|
||||
dec.exportFromInt(T, ROC_BUILTINS ++ ".dec.from_int.");
|
||||
}
|
||||
|
||||
exportDecFn(dec.fromF32C, "from_float.f32");
|
||||
exportDecFn(dec.fromF64C, "from_float.f64");
|
||||
}
|
||||
|
||||
// List Module
|
||||
|
@ -100,6 +102,19 @@ comptime {
|
|||
exportNumFn(num.greaterThanU128, "greater_than.u128");
|
||||
exportNumFn(num.greaterThanOrEqualU128, "greater_than_or_equal.u128");
|
||||
|
||||
exportNumFn(num.compareI128, "compare.i128");
|
||||
exportNumFn(num.compareU128, "compare.u128");
|
||||
|
||||
exportNumFn(num.lessThanI128, "less_than.i128");
|
||||
exportNumFn(num.lessThanOrEqualI128, "less_than_or_equal.i128");
|
||||
exportNumFn(num.greaterThanI128, "greater_than.i128");
|
||||
exportNumFn(num.greaterThanOrEqualI128, "greater_than_or_equal.i128");
|
||||
|
||||
exportNumFn(num.lessThanU128, "less_than.u128");
|
||||
exportNumFn(num.lessThanOrEqualU128, "less_than_or_equal.u128");
|
||||
exportNumFn(num.greaterThanU128, "greater_than.u128");
|
||||
exportNumFn(num.greaterThanOrEqualU128, "greater_than_or_equal.u128");
|
||||
|
||||
inline for (INTEGERS) |T, i| {
|
||||
num.exportPow(T, ROC_BUILTINS ++ "." ++ NUM ++ ".pow_int.");
|
||||
num.exportDivCeil(T, ROC_BUILTINS ++ "." ++ NUM ++ ".div_ceil.");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue