big unsignedInts doesn't work on 32bit
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Zorba |
Fix Released
|
Undecided
|
Paul J. Lucas |
Bug Description
On a 32Bit machine, the handling of big unsinged ints is broken. Because on 32Bit, max unsigned int is bigger then max long. It doesn't matter if Zorba is compile with bugnum support or not.
Example query:
xs:decimal(
Result without bignum support:
./bin/zorba -q test.xq -f
<?xml version="1.0" encoding="UTF-8"?>
184467440737095
Result with bignum support:
./bin/zorba -q test.xq -f
<?xml version="1.0" encoding="UTF-8"?>
-1
I know why it doesn't work with bignum support. Because when constructing the MAPM nummer in the background, the constructor MAPM(long l) is used. This cannot work because max is smaller then max unsigned int. I guess the issue can be fixed by treating unsigned ints similar to unsigned longs.
Why the first example doesn't work, I don't know. But I guess it's something similar.
Related branches
- Matthias Brantner: Needs Fixing
- David Graf (community): Approve
- Paul J. Lucas: Approve
-
Diff: 58 lines (+20/-4)2 files modifiedsrc/zorbatypes/integer.cpp (+8/-0)
src/zorbatypes/integer.h (+12/-4)
Changed in zorba: | |
status: | New → In Progress |
Changed in zorba: | |
status: | In Progress → Fix Committed |
Changed in zorba: | |
status: | Fix Committed → Fix Released |
Is there some 32bit machine I can ssh into?