How to compare values with NULL without getting an error? #3129
Unanswered
MaasterAndrey
asked this question in
Q&A
Replies: 2 comments
-
I don't think there is an easy way to alter the behavior of null. It may be interesting to look into implementing explicit support for |
Beta Was this translation helpful? Give feedback.
0 replies
-
You could also import the new signatures to the function larger in your local instance. math.import({
'larger': math.typed('larger',{
'undefined | null | any, undefined | null | any' : () => false
})
}) After that you could evaluate [null, 13, 2, undefined, NaN] > 3 # [false, true, false, false, false] The current functions can deal with NaN, you could also use that to your benefit for edge cases. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi!
We use expressions to compare a variable with a value ( a > 10). The value of a variable may be Null or undefined. At the same time, the formula breaks down and an error occurs; I would like Null > 10 to result in False.
Is it possible to define your own constant in the library that will work in accordance with the desired result?
Beta Was this translation helpful? Give feedback.
All reactions