WL#2934: Make/find library for doing float/double to string conversions and vice versa

Affects: Server-5.5   —   Status: Complete

We currently rely on the system sprintf() function to do conversions from 
doubles 
and floats to strings (and the reverse), which results in inconsistent results 
from system-to-system.

We need to find or write a library for doing these conversions.

There are papers describing the algorithms for floats <=> strings conversions:
- Guy L. Steele, Jr., Jon L. White. "How to print floating-point numbers 
accurately". 
http://portal.acm.org/citation.cfm?id=93559&coll=portal&dl=ACM&CFID=551188&CFTOKEN=64149307
- William D. Clinger. "How to read floating point numbers accurately" 
http://portal.acm.org/citation.cfm?id=93557&coll=portal&dl=ACM&CFID=1476301&CFTOKEN=64297675

There is also dtoa, a "float to/from string" conversion library which is 
loosely based on the above papers. We need to find out whether it is legally 
possible to include that implementation into MySQL code.

BUG#12860 is an example of a difference between Windows and most Unix 
systems.

BUG#21497 "DOUBLE truncated to unusable value" is an example where standard 
library functions do not provide the necessary precision in some cases (e.g. 
when a number is close to IEEE limits).

BUG#24541 is an example where we want to convert not to an exact string 
representation performed by the standard library functions, but rather to a 
shortest string that yields input floating point number when read in and 
rounded to nearest, such as by the "mode 0" in dtoa. 

BUG#26788 demostrates that as libc printf() doesn't have support the format 
we
need, we need to juggle with %g width, predicting whether it'll result in
scientific or decimal notation. And the latter is impossible to do in all 
cases.