Omnimaga
Calculator Community => TI Calculators => Axe => Topic started by: Derf321 on November 20, 2012, 03:17:31 pm
-
Is there a way I can make it so "If EXP1 = true, 1→Z, else, -1→Z"? Or some variation of this? I need a negative number to use in a formula (as in the output eventually will not be negative)
-
EXP1=true*2-1→Z
That's not optimized at all, but it's easy enough to see why it works.
-
...that's actually pretty optimized actually :P
-
(2*(EXP1=1)-1)→Z should do the job, if (EXP1=1) returns either 0 or 1 as in TI-BASIC.
EDIT: Ninja'd. But you should understand the point.
-
couldn't you leave the parentheses
1=EXP1*2-1→Z
or if the "true" isn't always 1
0<EXP1*2-1→Z
-
couldn't you leave the parentheses
1=EXP1*2-1→Z
or if the "true" isn't always 1
0<EXP1*2-1→Z
Hmm, this didn't seem to work for me in my program. I guess Axe really doesn't support negative numbers in equasions. I figured out a different way to do it, and it works fine. Thanks for the help all!
-
couldn't you leave the parentheses
1=EXP1*2-1→Z
or if the "true" isn't always 1
0<EXP1*2-1→Z
Hmm, this didn't seem to work for me in my program. I guess Axe really doesn't support negative numbers in equasions. I figured out a different way to do it, and it works fine. Thanks for the help all!
What doesn't Axe support for negative numbers? Keep in mind that the normal, unsigned comparison operators mostly don't work for signed numbers, but there are the signed comparison operators: ==, ≠≠, <<, ≤≤, >>, and ≥≥.
-
Nevermind, I was using an older version of axe that probably didn't support it.