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

Peter Ross pro at missioncriticalit.com
Wed Nov 27 00:57:34 AEDT 2002


fjh wrote:

> 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.
>
If I didn't have a cold, no problem, big lungs ;)

In the current implementation the resulting float will be in the
form that it was printed using the format string "%#.<prec>g".
<prec> will be in the range p to (p+2) where
p = floor(mantissa_digits * log2(base_radix) / log2(10)).
The precision chosen from this range will be such 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! ;-)
>



---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.419 / Virus Database: 235 - Release Date: 11/18/2002

--------------------------------------------------------------------------
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