Changing numbers

Sometimes, it's useful to convert numbers, and for this there are four conversion functions. There are functions to convert between degrees and radians, to get the absolute value of an integer, and to round a floating point number to an integer.

  • math.deg(v) converts a number from radians to degrees
  • math.rad(v) converts a number from degrees to radians
  • math.abs(v) returns the absolute value of the provided number
  • math.tointeger(v): if v is convertible to an integer, an integer is returned, otherwise nil
..................Content has been hidden....................

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