develooper Front page | perl.perl5.porters | Postings from April 2001

Re: what happens next?

Thread Previous | Thread Next
From:
Tim Jenness
Date:
April 10, 2001 12:18
Subject:
Re: what happens next?
Message ID:
Pine.LNX.4.30.0104100914230.2332-100000@lapaki.jach.hawaii.edu


The test looks like this:

# limited precision
ok( sprintf("%6.3f",T_FLOAT(52.345)), 52.345);

Both these failures are on 64-bit systems. The strange thing is that AIX
fails because the second arg can not be passed into the sub without losing
precision and the linux failure is because the output of sprintf
did not seem to match the %6.3f formatting (or within the sub when it was
converted to  a number for comparison.

I can patch the test by either changing the float to something that will
be easier to represent on these systems but will that simply paper over
the cracks? Note that the floats are converted to NV's and then formatted
so this should work fine in general [the test passes on 32bit AIX].

Tim

On Tue, 10 Apr 2001, H.Merijn Brand wrote:

> On Tue, 10 Apr 2001 09:07:32 -0400, "John P. Linderman" <jpl@research.att.com> wrote:
> > ok 38
> > # T_DOUBLE
> > not ok 39
> > # Test 39 got: '52.3449999999999989' (lib/xs-typemap.t at line 175)
> > #    Expected: '52.345'
> > # T_PV
> > ok 40
>
> On second thought, it's just a little bit different. This is from AIX 4.3
> bleadper -DDEBUGGING -Duseperlio -Duselongdouble
>
> ok 35
> ok 36
> # T_FLOAT
> not ok 37
> # Test 37 got: '52.345' (lib/xs-typemap.t at line 161)
> #    Expected: '52.344999999999999'
> # T_NV
> ok 38
>
>

-- 
Tim Jenness
JAC software
http://www.jach.hawaii.edu/~timj



Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About