chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Chicken-users] [PATCH] Make library tests compare numbers within epsilo


From: Peter Bex
Subject: [Chicken-users] [PATCH] Make library tests compare numbers within epsilon [Was Re: Is chicken supported on 32 bit Linux?]
Date: Wed, 29 May 2013 19:06:26 +0200
User-agent: Mutt/1.4.2.3i

On Wed, May 29, 2013 at 08:34:57AM +0200, Sven Hartrumpf wrote:
> Tue, 28 May 2013 23:25:35 +0200, Peter.Bex wrote:
> > For now I'd say this is a problem with your particular gcc version.
> > If you or someone else can reproduce this and come up with a patch
> > that would be great.
> 
> I know this problem for a year or so (gcc 4.7.N, gcc 4.8.N; C optimization -O2
> or higher; 32bit build on 64bit Linux boxes).
> I attach a simple patch to this mail (five tests must be made via 
> number->string).
> I feel better now because I can test with "make check" again :-)

This patch should fix it, but it does in a roundabout way: converting
the number to a string causes it to lose precision because of the default
value of (flonum-print-precision).  It's more explicit to check whether
the two values lie within an epsilon of eachother, like the test egg does.

Could you try whether "make check" on a -O3-compiled CHICKEN succeeds
with the attached patch?

Cheers,
Peter
-- 
http://www.more-magic.net

Attachment: 0001-Use-inexact-comparison-for-flonum-tests.patch
Description: Text document


reply via email to

[Prev in Thread] Current Thread [Next in Thread]