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:
Richard Feldman 2023-05-05 06:15:18 -04:00 committed by GitHub
commit df0ab01128
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
80 changed files with 697 additions and 258 deletions

View file

@ -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,

View file

@ -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