# MATH TLO idea

#### PumpThump

##### Member
Is it possible to have an addition to the Math TLO? Here's what I'm thinking...

\${Math.Max[#A, #B]} and the value would return the higher of either A and B?

And possibly the flipside...

\${Math.Min[#A, #B]} where it would return the lower of either A and B?

#### htw

##### Developer

Max: \${If[\$Math.Calc[A>=B]},A,B]}
Min: \${If[Math.Calc[A<b]},a,b]}
<b]},a,b]} <b]},a,b]}
< B]},A,B]}<b]},a,b}

</b]},a,b}></b]},a,b]}></b]},a,b]}

Last edited:

#### PumpThump

##### Member
Interesting...

So, what \${If[\$Math.Calc[A>=B]},A,B]} is doing is saying that "If A is greater than or equal to B, then return A. Otherwise return B."

And what \${If[Math.Calc[A < B]},A,B]} is doing is saying that "If A is less than B, then return A. Otherwise return B."

Just want to make sure I understand the meaning behind the syntax.

#### Xeniaz

##### MQ2 Guru
Code:
``\${Math.Min[1 2 3]}``
returns 1

Min Max and Average is available as part of the Math TLO
The same is also available in the Group TLO to return the ID of the group member that has the least or most hps. Average returns the average health of the group.

#### PumpThump

##### Member
Code:
``\${Math.Min[1 2 3]}``
returns 1

Min Max and Average is available as part of the Math TLO
The same is also available in the Group TLO to return the ID of the group member that has the least or most hps. Average returns the average health of the group.
Excellent, that's even better than what I was looking for!