absolute value of a variable

Hi,

Is there a way to take the absolute value of a scalar, or array variable ?

Thanks a lot,
j

Hi,

Is there a way to take the absolute value of a scalar, or array variable ?

how about:

sqrt(v_val*v_val)

or

(v_val<0)*-v_val+(v_val>0)*v_val

axel.

1 Like

Just posted a patch that adds an abs() function to the variable
command.

Steve