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:35
Subject:
Re: what happens next?
Message ID:
Pine.LNX.4.30.0104100929320.2332-100000@lapaki.jach.hawaii.edu

Okay. Now that I'm awake (it's only 9.30am!) I realise that the AIX is
failing on T_FLOAT but the ia64 is failing on T_DOUBLE.

The T_DOUBLE test is:

ok( T_DOUBLE(52.345), 52.345);

so maybe this needs a sprintf too? T_DOUBLE should be returning an NV in
the same way that the second argument will so I'm not sure how they can
be different. I assume the 'double' in C is different to the NV on this
platform?

The AIX test can be fixed by adding a sprintf to the second argument if
that is what is wanted.

On Tue, 10 Apr 2001, Tim Jenness wrote:

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