rebol/r3 — pull request #73 by ladislav (2013-01-24 19:15:54+00:00)
Title: Use David M. Gay's dtoa for molding decimals

Currently, R3 uses platform-specific code for molding decimal numbers.
This increases the effort necessary to port to new platforms like
android-arm or linux-arm

Porting R3 to android-arm we found none of the system-specific methods
currently used by R3 were available. Instead of adding another
system-specific method specifically for android-arm, we decided to
replace the system-specific methods using the dtoa function
implementation by David M. Gay.

David M. Gay's original code is available at:
http://www.netlib.org/fp/dtoa.c

This implementation brings the following advantages:

- MOLD and MOLD/ALL results will be accurate (solving cc#897).
- MOLD results will be consistent across wide range of platforms
(solving cc#1633).
- MOLD results will be optimal: yielding the shortest string that can be
used to reproduce the number (i.e. a string that is accurate enough).
- Makes porting to new platforms easier.
- Battle-tested solution, as this is the way how the problem was solved
in e.g. Java, Javascript, Python, Firefox, Chrome.

The commit makes the following changes:

- David M. Gay's implementation is added as src/core/f-dtoa.c. The
source is unmodified except for an #include of Rebol-specific
configuration and a reference to where the source was downloaded from.
- An attribution notice is added to NOTICE.
- Configuration for f-dtoa.c is contained in src/include/reb-dtoa.h.
- The additional source is listed in src/tools/file-base.r.
- make/makefile is re-generated to accommodate the additional source.
- The HAS_ECVT, HAS_LOG10L, HAS_LONG_DOUBLE Rebol configuration defines
are removed as they are no longer necessary.
- HAS_LL_CONSTS was previously implied by HAS_LONG_DOUBLE; it is now
defined explicitly for the respective platforms.
- Functions for decimal conversion are modified to use dtoa.

This resolves CureCode issues 897, 1633, 1942.