For all yall who don't know how to convert to negative

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.

9 Likes

That’s 7th grade math lol

5 Likes

I was going to say something like but I didn’t have an actual grade in mind. That is in fact incredibly simple math…

2 Likes

Ik… but it was just to help the people that didn’t know

2 Likes

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.

3 Likes

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.

A(-1)

This expression, while valid on paper parses as “Call function ‘A’ with parameter -1” which won’t normally do what you want.

6 Likes

That normally doesn’t work for me. Do I have to use spaces?

A*-1 and A(-1) should both work.

1 Like

Hmmmm… I’ve tried it and it says “invalid expression”
Welp, guess I’ll die.

Send a screenshot of the behaviours

1 Like

image

Do the other one, then. A(-1)

1 Like

Okay, yeah. I just needed to add a space.
image

1 Like

That one works for me. I used it on some player movement stuff.

1 Like

Ah, okay. Weird - it usually isn’t very picky for me. Glad you got it figured out!

1 Like

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.

2 Likes

(-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

2 Likes