gen_dev: Implement builtins Num.isNan, Num.isFinite, Num.isInfinite

This commit is contained in:
Basile Henry 2023-05-03 11:11:42 +01:00
parent d8b658da5d
commit 9a2afbb09b
3 changed files with 137 additions and 3 deletions

View file

@ -1706,7 +1706,7 @@ fn float_to_float() {
}
#[test]
#[cfg(any(feature = "gen-llvm", feature = "gen-wasm"))]
#[cfg(any(feature = "gen-llvm", feature = "gen-wasm", feature = "gen-dev"))]
fn frac_is_nan() {
assert_evals_to!("Num.isNaN (0 / 0)", true, bool);
assert_evals_to!("Num.isNaN (1 / 0)", false, bool);
@ -1714,7 +1714,7 @@ fn frac_is_nan() {
}
#[test]
#[cfg(any(feature = "gen-llvm", feature = "gen-wasm"))]
#[cfg(any(feature = "gen-llvm", feature = "gen-wasm", feature = "gen-dev"))]
fn frac_is_infinite() {
assert_evals_to!("Num.isInfinite (1 / 0)", true, bool);
assert_evals_to!("Num.isInfinite (-1 / 0)", true, bool);
@ -1723,7 +1723,7 @@ fn frac_is_infinite() {
}
#[test]
#[cfg(any(feature = "gen-llvm", feature = "gen-wasm"))]
#[cfg(any(feature = "gen-llvm", feature = "gen-wasm", feature = "gen-dev"))]
fn frac_is_finite() {
assert_evals_to!("Num.isFinite 42", true, bool);
assert_evals_to!("Num.isFinite (1 / 0)", false, bool);