aboutsummaryrefslogtreecommitdiff
path: root/g_fmt.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Fix string length returned by g_fmt.c for |x|<1Mark Pulford2012-03-041-0/+1
| | | | | Fix string length returned by built in fpconv_g_fmt() so it doesn't include the trailing null when converting numbers |x|<1.
* Use internal dtoa/strtod for double conversionMark Pulford2012-03-041-10/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | The internal Lua CJSON dtoa/strtod routines have locale support disabled. This avoids problems under locales with comma decimal separators. Build changes: - CMake: Check for big endian architectures - Makefile: Provide option to build with dtoa.c Modifications to dtoa.c: - Include locale dtoa_config.h configuration - Rename Infinity/NaN to inf/nan to match common C libraries - Rename strtod() -> internal_strtod() to prevent conflict with libc function Modifications to g_fmt.c: - Return output string length (instead of original buffer pointer) - Provide precision as an argument to g_fmt() - Silence compilations warnings from vendor source - while(a = b) - Unused label "done:" - Only swap to scientific notation when once the number of decimal digits required exceeds the precision available. This matches standard printf format %g. - Display a "0" in front of numbers < 1.
* Added Netlib dtoa.c/g_fmt.c routines (20110428)Mark Pulford2011-12-291-0/+104
See "www.netlib.org/fp/changes" for details.