Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the Convert-ASN1 CPAN distribution.

Report information
The Basics
Id: 4958
Status: resolved
Priority: 0/
Queue: Convert-ASN1

People
Owner: Nobody in particular
Requestors: long+rtcpan [...] kestrel.cc.ku.edu
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 0.18
Fixed in: (no value)



Subject: Convert::ASN1 bug with perl long doubles?
Hi, Not sure if this is a problem or not, but when I built perl 5.8.2 with long double support on Tru64 5.1B I get the following errors when trying to make test Convert::ASN1 0.18: #17: expecting 6.78 #17: got 6.78000000000000024868995751603507 #line 58 t/02seq.t not ok 17 #18: expecting 12.34 #18: got 12.33999999999999985789145284798 #line 59 t/02seq.t not ok 18 FAILED tests 17-18 Failed 2/18 tests, 88.89% okay Also not sure if this is a perl problem or not but make test for perl passed everything. Let me know if I can provide any additional information. If I build perl 5.8.2 without long double support then Convert::ASN1 0.18 builds fine. Jeff Long
From: Graham Barr <gbarr [...] pobox.com>
Subject: Re: [cpan #4958] Convert::ASN1 bug with perl long doubles?
Date: Fri, 16 Jan 2004 19:29:21 +0000
To: bug-Convert-ASN1 [...] rt.cpan.org
RT-Send-Cc:
On 16 Jan 2004, at 17:51, Guest via RT wrote: Show quoted text
> Hi, > Not sure if this is a problem or not, but when I built perl 5.8.2 > with long double support on Tru64 5.1B I get the following errors when > trying to make test Convert::ASN1 0.18: > > #17: expecting 6.78 > #17: got 6.78000000000000024868995751603507 > #line 58 t/02seq.t > not ok 17 > #18: expecting 12.34 > #18: got 12.33999999999999985789145284798 > #line 59 t/02seq.t > not ok 18 > FAILED tests 17-18 > Failed 2/18 tests, 88.89% okay > > Also not sure if this is a perl problem or not but make test for perl > passed everything. > > Let me know if I can provide any additional information. > > If I build perl 5.8.2 without long double support then Convert::ASN1 > 0.18 builds fine.
I would say that this is actually a testcase issue. Comparing floating point numbers is not an exact science as many numbers cannot be represented acurately, eg $ perl -e 'printf "%.30f\n", 6.78' 6.780000000000000248689957516035 $ perl -e 'printf "%.30f\n", 12.34' 12.339999999999999857891452847980 this is not a perl problem, but a computing problem in general. I will probably change the testcase to test with abs($expect - $got) < 0.0001 instead of equality Thanks, Graham.