More > Media Center 17
Math() : available functions list...
Matt:
A few more:
Power: x^y
Min: x<y
Max: x>y
Absolute value max: x}y
Absolute value min: x{y
Not: !x
And: x&y
Or: x|y
MrC:
--- Quote from: Matt on November 22, 2011, 12:53:04 pm ---A few more:
Power: x^y
Min: x<y
Max: x>y
--- End quote ---
These seem more than described:
3^2 returns 1.4601391553878784
2^3 returns 1.4464412927627563
11>4 returns 7
11<4 returns -7
so it seems these are not min/max but rather abs. distance functions, with sign indicating if less than/greater than is true.
Matt:
--- Quote from: MrC on November 22, 2011, 01:19:40 pm ---These seem more than described:
3^2 returns 1.4601391553878784
2^3 returns 1.4464412927627563
--- End quote ---
It was missing a break in a case statement, so you got an extra atan(...) as a bonus.
--- Quote ---11>4 returns 7
11<4 returns -7
--- End quote ---
If(t,a,b) uses (t > 0) to evaluate conditionals, so functionally it should be the same.
MrC:
Ok, the new build fixes the ^ operator.
I don't get how If() works:
math( if(0,5,2) ) returns 2, correct
math( if(1,5,2) ) returns 5, correct
math( if(1+1,5,2) ) returns 5, correct
math( if(1-1,5,2) ) returns 5, not so correct
Matt:
The if statements are probably being evaluated by the expression language, not the math language. I suppose we'll need to special case this (or just not support it).
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version