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

Fergus Henderson fjh at cs.mu.OZ.AU
Wed Nov 20 03:32:28 AEDT 2002


On 19-Nov-2002, Peter Ross <pro at missioncriticalit.com> wrote:
> > > tests/general/string_format_f.exp2:
> > > We will only get the 15 most significant digits when printing
> > > float__max using mercury, this means the output is different
> > > to using sprintf which prints all the digits.
> >
> > There should be some tests that writing out floats with 17 digits
> > precision and reading them back in again results in the same values.
>
> I am working on a change to do that.  Do you have an example of a float
> which requires 17 digits of precision.  We also need one that requires 9
> digits of precision for the case where we are using single
> precision floats.

I have attached a small C program which will produce numerous such examples.
The first ones that it came up with are 0.14987720966295234
and 0.123573124.

-- 
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.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: tricky_floats.c
Type: text/x-csrc
Size: 564 bytes
Desc: not available
URL: <http://lists.mercurylang.org/archives/reviews/attachments/20021120/4a309d68/attachment.c>


More information about the reviews mailing list