Comparing C and Pascal results, all seems ok. I have preferred to use trunc because AFAIK it should be faster than round, at least on delphi/win32. On fpc/arm it should be faster too, I suppose :think: