Bug #1545
closedBasic Arithmetic goes wrong
100%
Description
Consider:
(546 * 1552.244) + 175917.984 = 10234432.07 wrong
round((546 * 1552.244) + 175917.984) = 1023443 correct
Files
Updated by Philip Fearon over 12 years ago
Thanks for reporting this, I'm looking at it now...
Updated by Philip Fearon over 12 years ago
- Status changed from New to Resolved
- Found in version set to Beta 0.2
This has now been resolved. The issue affected the conversion of Double to string values for numbers between 1.0E6 and 1.0E7 and was due to a disparity between GWT number handling in developer and production modes in this particular case.
Updated by Philip Fearon over 12 years ago
- Assignee set to Philip Fearon
- Priority changed from Low to Normal
- Sprint/Milestone set to Release 1.0
Updated by Manfred Staudinger over 12 years ago
- File svg-t5-011.svg svg-t5-011.svg added
- File svg-t5-011.xhtml svg-t5-011.xhtml added
- File svg-t5-011.xml svg-t5-011.xml added
- File svg-t5-browser-v2.xsl svg-t5-browser-v2.xsl added
- File svg-t5-browser-v2-test.xsl svg-t5-browser-v2-test.xsl added
Original test case was maybe too simple. If I click on no. 27 the error still shows up.
Updated by Philip Fearon over 12 years ago
- Status changed from Resolved to In Progress
Ok thanks, I'll check this out
Updated by Philip Fearon over 12 years ago
Almost there, but the transform won't run because we're missing the file: svg-t5-tab.xml (from the parent directory) - could you send this also please? I've also had to create a dummy 'html-hide.png' file - but hopefully this doesn't adversely affect the UI for the test.
Updated by Manfred Staudinger over 12 years ago
- File svg-t5-tab.xml svg-t5-tab.xml added
- File svg-t5.css svg-t5.css added
- File html-hide.png html-hide.png added
- File html-show.png html-show.png added
Sorry, but now it should be complete.
Updated by Philip Fearon over 12 years ago
Thanks, the XSLT runs fine now - this is the output (from Saxon-CE 1.0 in Chrome) I get when clicking 27:
SaxonCE.Message 11:29:17.753
INFO: wrong? 1.493757383E6 correct: 1493757
SaxonCE.Message 11:29:17.754
INFO: wrong: 1.023443208E6 correct: 1023443
The part you've marked wrong? is actually the expected result according to the XSLT 2.0 specification (the initial problem in beta 0.2 with the wrong value was with the order of magnitude being out by 1). In this case, the only difference between the 2 numbers is due to the effect of rounding. There is a difference in formatting but this is because the XSLT 2.0 formatting rules for xs:double requires the use of the exponent E for numbers greater than 1 million - whereas for xs:integer (which you get after rounding) the rule doesn't apply. If you want to format an xs:double another way you can use the format-number() function.
Is that Ok, are you seeing the same result as this - or am I missing something else?
Updated by Manfred Staudinger over 12 years ago
Sorry for the noise: I forgot to update the server! I now get the same messages as you and this is what I expected.
Updated by Philip Fearon over 12 years ago
- Status changed from In Progress to Resolved
No problem - I'll revert the ticket status to Resolved.
Updated by O'Neil Delpratt over 11 years ago
- Status changed from Resolved to Closed
- Sprint/Milestone changed from Release 1.0 to Release 1.1
- Found in version changed from Beta 0.2 to 1.0
- Fixed in version set to 1.1
Bug fixed for Saxon-CE version 1.1 release
Please register to edit this issue