The exactness comes from two choices: compare squared distances and update with rational means. That keeps this one step in the exact register.
highlighted = computed this step
Why squared distance
Squared distance preserves the same nearest-centroid order as distance, but it avoids square roots. In this dataset the shown d^2 values are integers.
d2 comparison is exact
Why the mean stays exact
Each updated coordinate is a sum divided by the assigned count. That gives 2/3 on the left and 20/3 on the right.
new coordinates=2/3,20/3
Summary
The distance comparison and centroid update are both exact arithmetic. No decimal approximation is needed for this step.
integer d2 and rational means