mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-26 13:29:12 +00:00
gen_dev: Implement builtins Num.isNan, Num.isFinite, Num.isInfinite
This commit is contained in:
parent
d8b658da5d
commit
9a2afbb09b
3 changed files with 137 additions and 3 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue