Project

Profile

Help

Bug #1545

closed

Basic Arithmetic goes wrong

Added by Manfred Staudinger almost 12 years ago. Updated about 11 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Sprint/Milestone:
Start date:
2012-05-31
Due date:
% Done:

100%

Estimated time:
Platforms:

Description

Consider:

      (546 * 1552.244) + 175917.984  = 10234432.07 wrong
round((546 * 1552.244) + 175917.984) =  1023443    correct

Files

test.xsl (735 Bytes) test.xsl Manfred Staudinger, 2012-05-31 11:55
test.xhtml (11.6 KB) test.xhtml Manfred Staudinger, 2012-05-31 11:55
test.svg (640 Bytes) test.svg Manfred Staudinger, 2012-05-31 11:55
svg-t5-011.svg (640 Bytes) svg-t5-011.svg Manfred Staudinger, 2012-06-19 07:55
svg-t5-011.xhtml (11.5 KB) svg-t5-011.xhtml Manfred Staudinger, 2012-06-19 07:55
svg-t5-011.xml (44.6 KB) svg-t5-011.xml Manfred Staudinger, 2012-06-19 07:55
svg-t5-browser-v2.xsl (18 KB) svg-t5-browser-v2.xsl Manfred Staudinger, 2012-06-19 07:55
svg-t5-browser-v2-test.xsl (7.59 KB) svg-t5-browser-v2-test.xsl Manfred Staudinger, 2012-06-19 07:55
svg-t5-tab.xml (2.04 KB) svg-t5-tab.xml Manfred Staudinger, 2012-06-19 10:16
svg-t5.css (562 Bytes) svg-t5.css Manfred Staudinger, 2012-06-19 10:16
html-hide.png (535 Bytes) html-hide.png Manfred Staudinger, 2012-06-19 10:16
html-show.png (523 Bytes) html-show.png Manfred Staudinger, 2012-06-19 10:16
Actions #1

Updated by Philip Fearon almost 12 years ago

Thanks for reporting this, I'm looking at it now...

Actions #2

Updated by Philip Fearon almost 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.

Actions #3

Updated by Philip Fearon almost 12 years ago

  • Assignee set to Philip Fearon
  • Priority changed from Low to Normal
  • Sprint/Milestone set to Release 1.0
Actions #4

Updated by Philip Fearon almost 12 years ago

  • % Done changed from 0 to 100
Actions #5

Updated by Manfred Staudinger almost 12 years ago

Original test case was maybe too simple. If I click on no. 27 the error still shows up.

Actions #6

Updated by Philip Fearon almost 12 years ago

  • Status changed from Resolved to In Progress

Ok thanks, I'll check this out

Actions #7

Updated by Philip Fearon almost 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.

Actions #8

Updated by Manfred Staudinger almost 12 years ago

Sorry, but now it should be complete.

Actions #9

Updated by Philip Fearon almost 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?

Actions #10

Updated by Manfred Staudinger almost 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.

Actions #11

Updated by Philip Fearon almost 12 years ago

  • Status changed from In Progress to Resolved

No problem - I'll revert the ticket status to Resolved.

Actions #12

Updated by O'Neil Delpratt about 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

Also available in: Atom PDF