Project

Profile

Help

Bug #5690

closed

incorrect result of bin:unpack-integer when using 'little-endian' option

Added by Olivier XILLO over 1 year ago. Updated about 1 year ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
-
Sprint/Milestone:
-
Start date:
2022-09-17
Due date:
% Done:

100%

Estimated time:
Legacy ID:
Applies to branch:
10, 11, trunk
Fix Committed on Branch:
10, 11, trunk
Fixed in Maintenance Release:
Platforms:
.NET, Java

Description

the expath bin extension unpack-integer return an incorrect result when used with the 'little endian' option

  • bin:unpack-unsigned-integer(bin:hex('8008'),0,2,'BE') returns 32776 as expected
  • bin:unpack-unsigned-integer(bin:hex('8008'),0,2,'LE') returns 2176 as expected
  • bin:unpack-integer(bin:hex('8008'),0,2,'BE') returns -32760 as expected
  • bin:unpack-integer(bin:hex('8008'),0,2,'LE') returns -63360 when 2176 is expected.

For information, I've noticed that

Saxon result = Expected result - 65536

Seen in Saxon PE 11.4, Saxon EE 10.6 integrated in OxygenXML


Files

binUnpack_bug.xsl (1001 Bytes) binUnpack_bug.xsl stylesheet to reproduce Olivier XILLO, 2022-09-17 16:03

Please register to edit this issue

Also available in: Atom PDF