Choose float closest to zero

I know that we have MIN and MAX nodes for float, but is there a node to choose the number closest to zero?
Or do I have to make my own macro to do so?

For example, I have the numbers 5.2 and 3.1, it will output 3.1
Also, I have the numbers -1.4 and -0.3, it will output -0.3
Again, I have the numbers -8.0 and 2.3, it will output 2.3

I dont know about a standalone node for this. But the MIN node should be working. If negative numbers are a problem use ABS to make them positive for the calculation.

Regards

Use a Select node.

put both floats(floatA and floatB) into the Select node.

Into “Pick A”,
put
Abs(floatA) <= Abs(floatB)

1 Like