mirror of
https://github.com/roc-lang/roc.git
synced 2025-08-03 19:58:18 +00:00
Merge pull request #5348 from basile-henry/basile/num-is-nan
Implement builtins for Num.isNan, Num.isInfinite, and Num.isFinite
This commit is contained in:
commit
df0ab01128
80 changed files with 697 additions and 258 deletions
|
@ -86,6 +86,8 @@ pub enum LowLevel {
|
|||
NumCeiling,
|
||||
NumPowInt,
|
||||
NumFloor,
|
||||
NumIsNan,
|
||||
NumIsInfinite,
|
||||
NumIsFinite,
|
||||
NumAtan,
|
||||
NumAcos,
|
||||
|
@ -234,7 +236,6 @@ macro_rules! map_symbol_to_lowlevel {
|
|||
// these are not implemented, not sure why
|
||||
LowLevel::StrFromInt => unimplemented!(),
|
||||
LowLevel::StrFromFloat => unimplemented!(),
|
||||
LowLevel::NumIsFinite => unimplemented!(),
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -314,6 +315,9 @@ map_symbol_to_lowlevel! {
|
|||
NumLogUnchecked <= NUM_LOG,
|
||||
NumRound <= NUM_ROUND,
|
||||
NumToFrac <= NUM_TO_FRAC,
|
||||
NumIsNan <= NUM_IS_NAN,
|
||||
NumIsInfinite <= NUM_IS_INFINITE,
|
||||
NumIsFinite <= NUM_IS_FINITE,
|
||||
NumPow <= NUM_POW,
|
||||
NumCeiling <= NUM_CEILING,
|
||||
NumPowInt <= NUM_POW_INT,
|
||||
|
|
|
@ -1259,6 +1259,9 @@ define_builtins! {
|
|||
153 NUM_COUNT_TRAILING_ZERO_BITS: "countTrailingZeroBits"
|
||||
154 NUM_COUNT_ONE_BITS: "countOneBits"
|
||||
155 NUM_ABS_DIFF: "absDiff"
|
||||
156 NUM_IS_NAN: "isNaN"
|
||||
157 NUM_IS_INFINITE: "isInfinite"
|
||||
158 NUM_IS_FINITE: "isFinite"
|
||||
}
|
||||
4 BOOL: "Bool" => {
|
||||
0 BOOL_BOOL: "Bool" exposed_type=true // the Bool.Bool type alias
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue