HaxeFoundation/haxe — pull request #2209 by deltaluca (2013-09-29 11:23:52+00:00)
Title: Change all uses of string_of_float to float_repres.

float_repres taken from OCaml source typing/oprint.ml. This is a
better implementation of string_of_float which does seem to be used
in the very latest versions of OCaml to implement string_of_float also
which does not lose precision so that float_of_string (float_repres x)
is always x for any valid float x.

The main thing this resolves, is macro issues again where previously things like:

macro $v{Math.PI} and macro $v{Math.exp(1)} and macro $v{1 + 1e-14} would not actually give us
expressions which return exactly Math.PI, Math.exp(1) or 1 + 1e-14 due to precision loss in conversion
to string using string_of_float.