Get the integral and fractional parts of the given number in Corona

By | November 29, 2011

math.modf is used to get the integral and fractional part of a given number in corona.

Return the integral and fractional parts of the given number.

 math.modf(7)
7       0
 math.modf(7.5)
7       0.5
math.modf(-7.5)
-7      -0.5

Leave a Reply

Your email address will not be published. Required fields are marked *