Jump to content

or...


qaisjp

Recommended Posts

Would the following work instead of its respective other?

  
if (type(t1) or type(y2)) ~= "table" then 
  
--instead of... 
  
if type(t1) ~= "table" or type(y2)~="table" then 
  
--be the same? 
  

and..

  
if method ==("ceil" or "floor") 
--instead of... 
if (method == "ceil" or method == "floor") 
--be the same? 

Link to comment

The LUA users wiki states it pretty well:

If the first argument is not false or nil it is returned, otherwise the second argument is returned. So, a boolean is only returned if the first argument is true or the second argument is a boolean.

So as far as your first snippet of code goes, only the second one would work properly.

Also, for your second snippet of code, only the second would work properly.

Link to comment

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