Avoid crashing on floating point nonsense.

Reported by Marco.