This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 3365 - casthcds10
Summary: casthcds10
Status: RESOLVED FIXED
Alias: None
Product: XML Query Test Suite
Classification: Unclassified
Component: XML Query Test Suite (show other bugs)
Version: 0.9.4
Hardware: PC Windows XP
: P2 normal
Target Milestone: ---
Assignee: Andrew Eisenberg
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-06-19 18:13 UTC by Michael Kay
Modified: 2006-06-19 20:36 UTC (History)
0 users

See Also:


Attachments

Description Michael Kay 2006-06-19 18:13:13 UTC
Expected results for casthcds10: true
Actual results: false

The test produces true if

xs:double(xs:float('1267.43233E12')) eq xs:double('1267.43233E12')

But there is no intrinsic reason to believe that this should be true. Intuitively, converting a string to a float loses precision, which cannot be regained when the float is converted to a double.

A more reliable test might be

xs:float((($input-context1/atomic:root/atomic:float) cast as xs:double)) eq xs:float(1267.43233E12)
Comment 1 Carmelo Montanez 2006-06-19 20:36:31 UTC
Michael:

Your suggestion seems quite reasonable and given the sources/time constraints, I will follow up on it.  Changed as suggested.  I am not sure, but
other tests may benefit from this same approach.

Thanks,
Carmelo