Everything else

There are a number of useful math-related functions Lua offers that do not fit into any of the preceding categories. These functions are listed here, in no particular order:

  • math.ceil(v): rounds v up to the nearest integer
  • math.floor(v): rounds v down to the nearest integer
  • math.fmod(x, y): returns the remainder of the division x / y
  • math.modf(v): returns two values, the integer part of v and the factoral part of v
  • math.sqrt(v): returns the square root of v
  • math.type(variable): returns the strings integer, float, or nil
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.117.76.204