My understanding is that the function should work for infinities (not sure about NaNs). This is based on the fact that only MySQL checks for them explicitly because it can't store them as doubles. But the other backends do not -- so I assumed that they can store them and so do need to use these functions to translate between them.

Again, this can be changed, and certainly should be clarified, later, but I don't think it should be necessarily done in this commit, it just preserves the existing behaviour but makes it works the same in all locales.