Where 19.36 lands on a tape measure
Enter 19.36 in mark at. The pink line sits at 0.36 within the drawn inch, and the readout keeps the 19 whole inches separate. The nearest sixteenth is 19 inches plus 3/8 inch.
That's close, but not exact. Three-eighths is 0.375, so the difference is 0.36 - 0.375 = -0.015 inches. The negative sign means the original measurement falls before the chosen tick. A positive difference means it falls after.
The drawing isn't a calibrated screen ruler. It stretches to fit the page. Don't hold an object against the screen to measure it; the numbers and relative positions are what matter here.
The marks between the marks
Turn on thirds to see red lines at one-third and two-thirds of an inch. Neither lands on a sixteenth. One-third is nearest to 5/16, which falls short by 1/48 inch. Two-thirds is nearest to 11/16, which goes past it by 1/48 inch.
Tenths adds blue lines from 0.1 to 0.9. Some land between ticks, but 0.5 is exactly 1/2. The tables show each decimal value, its nearest sixteenth, and the signed difference labeled Ξ.
You can compare those with a custom value such as 0.333. That's already an approximation of one-third, and it still falls between 5/16 and 3/8. Clear removes the custom marker.
Choosing the nearest tick
The code separates whole inches from the fractional part, multiplies that fraction by 16, rounds to a whole number, then divides by 16. It reduces the fraction for the readout, so six sixteenths becomes three eighths.
If rounding reaches a full inch, it carries into the whole-inch total. For the nonnegative inputs here, an exact halfway point rounds up. Ξ is always the original fractional position minus the selected mark.
The displayed decimals are rounded for readability. Selecting the nearest tick doesn't make the original length equal to it, or make the input measurement more accurate. Whether that difference is small enough depends on what you're making.