1
votes

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.

1

1 Answers

3
votes

Use the T operator to invoke static methods...

T(java.lang.Math).abs(...)