With the following example
\documentclass{article}
\begin{document}
\dimen0=1sp \dimen1=0.5\dimen0 \dimen2=0.99999\dimen0
\dimen3=0.999992\dimen0 \dimen4=0.999993\dimen0
\count255=\dimen0 \the\count255 sp ~
\count255=\dimen1 \the\count255 sp ~
\count255=\dimen2 \the\count255 sp ~
\count255=\dimen3 \the\count255 sp ~
\count255=\dimen4 \the\count255 sp ~
\end{document}
I got the following result
1sp 0sp 0sp 0sp 1sp
I cound not understand how TeX does its arithmetic calculation.
1spis the smallest unit of length in TeX. Everything smaller than that is defined by rounding and 0.999993 is apparently rounded to 1. – Henri Menke Jun 30 '18 at 03:340.999993into binary, start witha = 0, then for each digit3,9, ... etc, seta = (a + d * 131072) div 10. So: in case of0.999993,atakes the values 39321, …, 131071, after whicha = (a + 1) div 2results ina = 65536, i.e. 1. In the case of0.999992we end up with a = 131070, so 0. – ShreevatsaR Jun 30 '18 at 04:02