Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Binary test EXPath-binary-unpack-unsigned-integer-012 #116

Open
michaelhkay opened this issue Sep 9, 2018 · 5 comments
Open

Binary test EXPath-binary-unpack-unsigned-integer-012 #116

michaelhkay opened this issue Sep 9, 2018 · 5 comments
Assignees

Comments

@michaelhkay
Copy link
Member

The test is

bin:unpack-unsigned-integer(xs:base64Binary(xs:hexBinary('ffffffffffffffff')),0,8,'most-significant-first')

and the expected result is -1.

We are getting the result 18 446 744 073 709 551 615 which seems correct to me.

@adamretter
Copy link
Member

adamretter commented Sep 10, 2018

I also interpret the EXPath Binary spec to mean that the result should be 18 446 744 073 709 551 615.

I note that BaseX (8.6.7) returns -1.

In Java 0xffffffffffffffffl == -1, but that is a signed representation!

@johnlumley
Copy link
Member

johnlumley commented Sep 10, 2018 via email

@michaelhkay
Copy link
Member Author

Saxon 9.8 and 9.9 are returning 18 446 744 073 709 551 615 and therefore failing the test...

@johnlumley
Copy link
Member

johnlumley commented Sep 10, 2018 via email

@ChristianGruen
Copy link
Member

Hi all, I agree, BaseX returns the wrong result here.

As @johnlumley already guessed (thanks), it is because items of type xs:integer are limited to long values in BaseX. Maybe the specification would need to be enhanced to handle numeric overflows/underflows and to allow errors similar to FOAR0002?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants