negative result for fib(95)

Bug #984031 reported by Matthias Brantner
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Zorba
Invalid
Critical
Paul J. Lucas

Bug Description

declare function local:fib($n as xs:integer) as xs:integer
{
 if ($n eq 0) then 0
 else if ($n eq 1) then 1
 else local:fib($n - 1) + local:fib($n - 2)
};

local:fib(95)

gives -4953053512429003327 but should return 31940434634990099905. This seems to be a overflow in numerics. fib(90) gives the correct result.

Revision history for this message
Paul J. Lucas (paul-lucas) wrote :

I thought we agreed a long time ago neither not to check for either overflows or underflows when ZORBA_WITH_BIG_INTEGER=OFF.

Revision history for this message
Paul J. Lucas (paul-lucas) wrote :

Since there's apparently no way to edit a comment, the previous comment should read:

I thought we agreed a long time ago not to check for either overflows or underflows when ZORBA_WITH_BIG_INTEGER=OFF.

Revision history for this message
Matthias Brantner (matthias-brantner) wrote :

Yes, you are absolutely right. It's because I had Zorba compiled without big number support.

Changed in zorba:
status: New → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.