Hey there, could anyone tell me what the ! is for in the expr within the title...?
-
expr if(!$f1 && $f2 , 1, 0)
Dont eat slugs!!! unless you soak em in porridge!!!
-
@slippycurb Hello there... I have no idea where you found that, but in logical notation it should probably mean "not".............
That is "not" by any means certain though. It can mean that the function is predicative. If you google "exclamation mark logic" you will find other definitions.Try it and see what it does?
David. -
i found it in a patch posted here....http://www.danpprince.com/engineering/lp_util/
if you look at the last image on the page its used quite alot....ive been tring to get my head around his launchpad utils....iv managed to create my own patch based on his but demo (the last image) but not using the same expr he uses at it was just confusing me.....(although it looks quite 3lite )expr if(!$f1 == 1, 1, 0,) piping a number box to the input of this will output a 1 ONLY when $f1 is 0......so it is a kind of NOT...:-)
it is kind of the opposite to expr if($f1 != 1, 1, 0)Dont eat slugs!!! unless you soak em in porridge!!!
-
At first glance, it seems to compare in1 against in2.
if $f1 && $f2 == 0 output is 0
if $f1 == 0 && $f2 != 0 output is 1 -
well i like learning something new everyday
Dont eat slugs!!! unless you soak em in porridge!!!
-
If in1 is 0 and in2 is non-zero, the output is one, else it's zero, because the exclamation mark makes any non-zero value a 0, and turns a 0 to a 1. The && is the Boolean AND, which is true only if both sides are true. So in1 will be true if it's zero (because of the exclamation mark) and in2 will be true if it's not zero (a non-zero value is considered true in C), and then you'll get a 1, else you'll get a 0.
-
Yep! What @alexandros said.
-
@ricky ...........as I said... "not" true = false / "not" false = true.........
hmm.... "arguably"... -
!now that makes sense
Dont eat slugs!!! unless you soak em in porridge!!!