[m-rev.] for review: mercury implementation of float_to_string

Fergus Henderson fjh at cs.mu.OZ.AU
Tue Nov 26 02:28:21 AEDT 2002


On 25-Nov-2002, Peter Ross <pro at missioncriticalit.com> wrote:
> @@ -96,9 +96,13 @@
>  :- pred string__float_to_string(float, string).
>  :- mode string__float_to_string(in, uo) is det.
>  %	Convert an float to a string.
> -%	The resulting float will be in the form that it was printed using
> -%	the format string "%#.<prec>g" where <prec> is the required precision
> -%	needed to represent the string.
> +%	In the current implementation the resulting float will be in the
> +%	form that it was printed using the format string "%#.<prec>g" where
> +%	<prec> is in the range p to (p+2) where
> +%	p = floor(mantissa_digits * log2(base_radix) / log2(10)) and
> +%	the precision is sufficient to allow a successful decimal -> binary
> +%	conversion of the float.

Pete, please try saying that aloud.
No pauses for breath until you get to a comma! ;-)

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
The University of Melbourne         |  of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- the last words of T. S. Garp.
--------------------------------------------------------------------------
mercury-reviews mailing list
post:  mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the reviews mailing list