math.modf

The following piece of code is printing 32 instead of 31 on ipad 2. Do you know why ? Is there a work around ? I am planning to use codea for visualizing numerical data. With such bugs it doesn’t seem that useful for me.

function setup()
x = 19981231
print( math.fmod(x,100) )
end

For speed, the engine currently only does around 6 significant digits.

@vrk Codea uses 32 bit floats rather than 64 bit. As they perform much better on iPad hardware.

Not the first time precision has come up - maybe consider including the BigNum and BigRat packages for those desiring higher precision at the expense of speed? (I am not sure they’ll work unmodified due to the 32 bit precision we use…)

Hmm… alternatives for those who understand the consequences and are are willing to accept a trade-off between precision and speed on a per project basis?

Excuse my ignorance but could here lie a solution for the problem with os.time()? (Though obviously running slower would rule out its use for benchmarking…)