reversing [toggle] output
hello!
is there a more elegant way to reverse my [toggle] output? my attempt does the job using [if $i1 > 0 then 0 else 1]. so, what else is there? :)
cheers,
jonas
that I like.
thanks!
shorter: [if $i1 then 1 else 0].
or just [== 0].
or why not [!= 1]?
[expr ($f1+1)%1] should also work. :)
:)
do like the equal/not equal alternative. and thanks for pointing out that my [if] can be further reduced...
I agree [== 0] is the way to go. the most readable one.
Two others ways, just for fun : [expr $i1^1] [expr !$i1]
The old classic [expr int($i1*pow(2,3)/ln(9)*-1/3+1)] is the best! ;)
laugh my f ass right OFF
Only because getting Euler's identity into the [expr] object looked like a bit of a challenge!
transcendental.......
I'm all about the [!- 1]
@Roman
you meant [if $i1 then 0 else 1]
[!- 1], yeah :) can't get any slimmer.
also thanks for the insight into [expr]. endless potential, the fella...
[!- 1] or [== 0] ?
I think it just depends whether you consider 0 1 as numbers or booleans.
[!- 1] is branchless. Wins every time.