I’ve confirmed similar results for 2015.2610, using this variation on your test.
local function round(val, n) if (n) then return math.floor( (val \* 10^n) + 0.5) / (10^n) else return math.floor(val+0.5) end end function string:rpad(len, char) local theStr = self if char == nil then char = ' ' end return theStr .. string.rep(char, len - #theStr) end --converting 90 degrees to radians local radOut = math.rad( 90 ) print( "math.rad( 90 ) ", radOut) for i = 13, 2, -1 do local tmp = round(radOut, i) print( i, " ----------------------------------------------------- ") print( string.rpad("math.sin(" .. tmp .. ")", 30, "." ), math.sin(tmp) ) print( string.rpad("math.cos(" .. tmp .. ")", 30, "." ), math.cos(tmp) ) end
This produced this output running in the Windows Simulator (2015.2610) on a Windows 7 machine.
math.rad( 90 ) 1.5707963267949 13 ----------------------------------------------------- math.sin(1.5707963267949)..... 1 math.cos(1.5707963267949)..... -3.4914813388431e-015 12 ----------------------------------------------------- math.sin(1.570796326795)...... 1 math.cos(1.570796326795)...... -1.0341155355511e-013 11 ----------------------------------------------------- math.sin(1.57079632679)....... 1 math.cos(1.57079632679)....... 4.8965888601467e-012 10 ----------------------------------------------------- math.sin(1.5707963268)........ 1 math.cos(1.5707963268)........ -5.103411967257e-012 9 ----------------------------------------------------- math.sin(1.570796327)......... 1 math.cos(1.570796327)......... -2.0510342851533e-010 8 ----------------------------------------------------- math.sin(1.57079633).......... 1 math.cos(1.57079633).......... -3.2051034546918e-009 7 ----------------------------------------------------- math.sin(1.5707963)........... 1 math.cos(1.5707963)........... 2.6794896585029e-008 6 ----------------------------------------------------- math.sin(1.570796)............ 0.99999999999995 math.cos(1.570796)............ 3.2679489653814e-007 5 ----------------------------------------------------- math.sin(1.5708).............. 0.99999999999325 math.cos(1.5708).............. -3.6732051033466e-006 4 ----------------------------------------------------- math.sin(1.5708).............. 0.99999999999325 math.cos(1.5708).............. -3.6732051033466e-006 3 ----------------------------------------------------- math.sin(1.571)............... 0.99999997925861 math.cos(1.571)............... -0.00020367320369518 2 ----------------------------------------------------- math.sin(1.57)................ 0.99999968293183 math.cos(1.57)................ 0.00079632671073326
Looks like you should file a bug.
Note: You can work around this for now with the above rounding code.
Similar results found running Corona Simulator (2015.2605) on OS X 10.10.2:
math.rad( 90 ) 1.5707963267949 ... 6 ----------------------------------------------------- math.sin(1.570796)............ 0.99999999999995 math.cos(1.570796)............ 3.2679489653814e-07 5 ----------------------------------------------------- math.sin(1.5708).............. 0.99999999999325 math.cos(1.5708).............. -3.6732051033466e-06 4 ----------------------------------------------------- math.sin(1.5708).............. 0.99999999999325 math.cos(1.5708).............. -3.6732051033466e-06 3 ----------------------------------------------------- math.sin(1.571)............... 0.99999997925861 math.cos(1.571)............... -0.00020367320369518 2 ----------------------------------------------------- math.sin(1.57)................ 0.99999968293183 math.cos(1.57)................ 0.00079632671073326
Finally, similar results see on iPad Air (Corona 2015.2605) running iOS 8.2:
math.rad( 90 ) 1.5707963267949 ... 6 ----------------------------------------------------- math.sin(1.570796)............ 0.99999999999995 math.cos(1.570796)............ 3.2679489653814e-07 5 ----------------------------------------------------- math.sin(1.5708).............. 0.99999999999325 math.cos(1.5708).............. -3.6732051033466e-06 4 ----------------------------------------------------- math.sin(1.5708).............. 0.99999999999325 math.cos(1.5708).............. -3.6732051033466e-06 3 ----------------------------------------------------- math.sin(1.571)............... 0.99999997925861 math.cos(1.571)............... -0.00020367320369518 2 ----------------------------------------------------- math.sin(1.57)................ 0.99999968293183 math.cos(1.57)................ 0.00079632671073326