This here is causing serious issues again and again.
Please fix this for Rhino 9.
Nothing minus x is ideally nothing. I could understand the argument that it’s -x. But it’s not +x.
Null & Empty Branches and basic arithmetic functions - Grasshopper - McNeel Forum
Arithmetic operators and nulls don’t play well together. : RH-44502
i think it might be correct as is.
if you have a variable A the result has to represent plus or minus. but when you set a definite number 0 then you get an actual result based of this value.
so 0 - 2 = -2
but A - 2 = |2|
This is a bug. Null is not nothing. Null is an alias for a missing reference. The only good solution is to add an error. But just as David Rutten answered it in the referenced discussion , it was supposed to handle optional input, and therefore no error was returned. If A is optional, then only B is passed as an output, then it is expected to return 2. I don’t think GH1 will be patched. As always it is good practice to prevent and add logic to detect null states. It’s also good to add sanity checks, because from time to time you encounter a function which works slightly different as expected.