I just recently figured out the easy way to make a number negative. Before, I did this in an expression: A-A2. Now I figured out you can do this: A(-1). A*-1 doesn’t work because the program sees it as trying to execute two different math commands. Have fun with your newfound knowledge, all the people who didn’t know that already.
That’s 7th grade math lol
I was going to say something like but I didn’t have an actual grade in mind. That is in fact incredibly simple math…
Ik… but it was just to help the people that didn’t know
I thought it this as incredibly helpful.
Which I know it’s simple math, but it took me almost two hours to figure out that the * was multiplication, lol. I tried using parenthesis like (-1)(A) or something and it wouldn’t work. I can actually see this being very helpful for new users.
Hey @hihilogic - thanks for posting this tip, but I think you reversed the expressions in the original post.
A * -1
Should work fine, it gets parsed as “A times -1”, which produces the result we want.
This expression, while valid on paper parses as “Call function ‘A’ with parameter -1” which won’t normally do what you want.
That normally doesn’t work for me. Do I have to use spaces?
A*-1 and A(-1) should both work.
Hmmmm… I’ve tried it and it says “invalid expression”
Welp, guess I’ll die.
Send a screenshot of the behaviours
Do the other one, then. A(-1)
Okay, yeah. I just needed to add a space.
That one works for me. I used it on some player movement stuff.
Ah, okay. Weird - it usually isn’t very picky for me. Glad you got it figured out!
For some reason I tried doing that earlier and it didn’t work, lol. I ended up resorting to (-1)*(A) and that seemed to work. Which on my calculator it says different, but the expression is a little confusing.
(-1) * (A) , A(-1) , A*-1 , -1*A and the flipped version of each of those are all the same. Some calculators are picky, though