bugVmgen - Bugs: bug #48644, Bug in example

 
 

bug #48644: Bug in example

Submitted by:  None
Submitted on:  Wed 27 Jul 2016 06:19:05 AM UTC  
 
Category: NoneSeverity: 3 - Normal
Item Group: NoneStatus: Fixed
Privacy: PublicAssigned to: Anton Ertl <anton>
Open/Closed: Closed

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Wed 27 Jul 2016 05:24:38 PM UTC, comment #2:

Fixed in git patch a391365..d40f7f2

Anton Ertl <anton>
Project AdministratorIn charge of this item.
Wed 27 Jul 2016 05:11:00 PM UTC, comment #1:

Yes, fib.mini has an off-by-one error (the same as fib.fs). This error is so traditional that I am not sure if I should fix it (probably not for fib.fs, because that is used as a benchmark; fib.mini is different, though).

Anton Ertl <anton>
Project AdministratorIn charge of this item.
Wed 27 Jul 2016 06:19:05 AM UTC, original submission:

>./mini fib.mini

result = 9227465

fib.c:

#include <stdio.h>
long fib(long n) {
if (n < 2) return n;
return fib(n - 1) + fib(n - 2);
}

int main(int argc, char *argv[]) {
printf("%ld\n",fib(34));
return 0;
}

>gcc -o fib fib.c
>./fib

5702887

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by anton (Posted a comment)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 4 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Wed 27 Jul 2016 05:24:38 PM UTCantonStatusConfirmed=>Fixed
      Open/ClosedOpen=>Closed
    Wed 27 Jul 2016 05:11:00 PM UTCantonStatusNone=>Confirmed
      Assigned toNone=>anton

    Back to the top


    Powered by Savane 3.1-cleanup1