Jump to content

Useful function: math.neg


KrSoFA

Recommended Posts

Guest Guest4401
Posted

I guess using "-" before the number is pretty much better rather than using a function to make it negative.

Posted

. . .

Useless function.

  
local a = 10 
local b = -10 
  
a, b = -a, -b -- a = -10, b = 10. 
  

 #define if while#define TRUE FALSE// problems?
Posted

I now have to agree with you, this is very useless. Just write "-" before the number and it's done.

"[...] If you don’t love it, if you’re not having fun doing it, you don’t really love it, you’re going to give up." - Steve Jobs, 2007

Posted

To be fair, simple negation is not what it does. However, it can be written more succinctly as "-math.abs(x)"

Do NOT PM ME for help unless invited. - New MTA Script Editor

Scripting help "etiquette": understandable language, relevant code (ALL code if unsure), [Lua] tags, error messages with line numbers. Super simple stuff.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...