Just be careful in the definition of "nearest". As with almost everything in IEEE floating point, such mathematical concepts are somewhat imprecise when realized within the constraints of the encoding. Is +0.0 "nearer" to 0u64 than -0.0? Is rounding "down" toward zero nearer than rounding "up"?
3 Likes