View Issue Details [ Jump to Notes ] | [ Issue History ] [ Print ] | ||||||||
ID | Project | Category | View Status | Date Submitted | Last Update | ||||
---|---|---|---|---|---|---|---|---|---|
0000312 | mercury | Bug | public | 2014-01-26 14:49 | 2014-01-27 11:58 | ||||
Reporter | lpimmes | ||||||||
Assigned To | pbone | ||||||||
Priority | high | Severity | major | Reproducibility | always | ||||
Status | closed | Resolution | no change required | ||||||
Platform | OS | MAC | OS Version | 10.9.1 | |||||
Product Version | |||||||||
Target Version | Fixed in Version | ||||||||
Summary | 0000312: Fibonacci using pragma, fails at 93, and other larger integers. | ||||||||
Description | In order to speed up fibonacci algorithm pragma was employed. If not employ, code is very slow at 40. | ||||||||
Steps To Reproduce | Compile, and run file. See comments in attached file. | ||||||||
Tags | No tags attached. | ||||||||
Attached Files |
|
![]() |
|
pbone (administrator) 2014-01-26 19:25 |
Please explain what you mean by "fails at 93". What are the symptoms of your problem. Please also include the Mercury version, the OS version, TCC's version and the options you used to build the Fibonacci program. |
pbone (administrator) 2014-01-26 19:29 |
My apologies some of this information is provided in the attached file. However we still need to know what "fails at 93" means. |
zs (developer) 2014-01-27 02:17 |
I am guessing that "fails at 93" means that fib(93) returns a negative number, since a comment in the source code says so. However, since this version of fib uses int, not integer, OF COURSE you get overflow when the fibonacci numbers exceed what can be represented as a 64 bit two's complement integer. In other words, this is NOT a bug; this is a misunderstanding. |
lpimmes (reporter) 2014-01-27 09:31 |
Thank you so much for the tip. Code works now. See working code, fibonacci.m. |
pbone (administrator) 2014-01-27 11:58 |
Closed as this is not a bug and the reporter is happy with the result. Thanks for contacting us in any case and thanks Zoltan for investigating further. |
![]() |
|||
Date Modified | Username | Field | Change |
---|---|---|---|
2014-01-26 14:49 | lpimmes | New Issue | |
2014-01-26 14:49 | lpimmes | File Added: fibonacciSa.m | |
2014-01-26 19:25 | pbone | Note Added: 0000610 | |
2014-01-26 19:29 | pbone | Note Added: 0000611 | |
2014-01-27 02:17 | zs | Note Added: 0000612 | |
2014-01-27 09:30 | lpimmes | File Added: fibonacci.m | |
2014-01-27 09:31 | lpimmes | Note Added: 0000613 | |
2014-01-27 11:58 | pbone | Note Added: 0000614 | |
2014-01-27 11:58 | pbone | Status | new => closed |
2014-01-27 11:58 | pbone | Assigned To | => pbone |
2014-01-27 11:58 | pbone | Resolution | open => no change required |