• equality or approximately equal?
    4 replies, posted
I am currently working on a script of mine for my server, and being new to lua and horrible at math I can't seem to figure out which of these to use. equality [CODE]if ply:Team() ~= TEAM_MAYOR or ply:GetUserGroup() ~= "superadmin" then[/CODE] or approximately equal [CODE]if ply:Team() == TEAM_MAYOR or ply:GetUserGroup() == "superadmin" then[/CODE] If you could please explain when to use equality and when to use approximately equal I would really appreciate it!
The "~=" operator checks for inequality, not approximation.
So which one would be used in my situation?
You use "==" if you want to test that the values are equal. Otherwise, you use "~=" to make sure they're not equal.
Alright, and while I have your attention, may I ask a few more questions? (2 more after this question) [editline]3rd February 2016[/editline] Nevermind, found a great site with this information. Mathematical, but understandable coding wise. [url]https://en.wikipedia.org/wiki/List_of_mathematical_symbols[/url]
Sorry, you need to Log In to post a reply to this thread.