I am trying to evaluate the expression where I need to have the absolute value of operator. My expression, after evaluation, looks like this:
((-4.0 - 3.0)/-4.0) * 100
I want absolute value of denominator to be substituted there.
I have tried using Math.abs() but it throws an exception while evaluating expression having abs() in it. Here are the expressions that I have tried (and failed):
((-4.0 - 3.0)/${#java.lang.Math.abs(-4.0)}) * 100
((-4.0 - 3.0)/#java.lang.Math.abs(-4.0)) * 100
((-4.0 - 3.0)/${java.lang.Math.abs(-4.0)}) * 100
Can anyone please let me know the correct syntax for this? Also, can we use bars to get absolute value (like |-4.0| or something)?
update
I have tried using bars (e.g. |-4.0| but even that hasn't worked.
Use the T operator to invoke static methods...
T(java.lang.Math).abs(...)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With