Nearest-neighbor ordering does not need square-root values. Squared distance keeps every displayed value as an exact integer.
Distance without square roots
For query (1, 1), the surface computes d^2=(delta x)^2+(delta y)^2.
d2=(Δx)2+(Δy)2
Why squared distance is enough
Ordering by d^2 gives the same neighbor order as distance while staying in exact integer arithmetic.
order by d2
Summary
The squared distances are 2, 2, 2, 8, 4, and 4. No square-root value is rendered.
d2=[2,2,2,8,4,4]