944,120 Members | Top Members by Rank

Ad:
  • C Discussion Thread
  • Unsolved
  • Views: 1235
  • C RSS
Feb 11th, 2006
0

Newmember with big problem!!!

Expand Post »
Hi everybody. I have a problem with my program.
I want to make a program that can display the Fibonacci, but the number of term i must display is 2147483647. So there is a float number problem. How can i do it with fast speed.
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
thinhbk1802 is offline Offline
2 posts
since Feb 2006
Feb 11th, 2006
0

Re: Newmember with big problem!!!

Quote originally posted by thinhbk1802 ...
Hi everybody. I have a problem with my program.
I want to make a program that can display the Fibonacci, but the number of term i must display is 2147483647. So there is a float number problem. How can i do it with fast speed.
>number of term i must display is 2147483647

Short answer is yes you can - but you need a big number library. If this is homework, as i suspect, the object of the assinement wud probably be to use strings to get that term.

So you have to think back to basic school arithmetic and addition on paper, i.e adding it column by column and carrying the surplus to the preceeding column.

Simple as pie.


>Speed

hmm, dunno about that. I'd say the speed would be the constant since you're adding rather than multiplying. multiplying can lend itself to varying speeds - Karatsuba etc.I'd imagine addition to be constant. But I cud be wrong. I'm sure sumone will prove this to be so. :rolleyes:

[Edit] Gotta love google, it would seem an efficient method does exist, he he [/Edit]

http://www.everything2.com/index.pl?node_id=1328208
Featured Poster
Reputation Points: 1536
Solved Threads: 431
Posting Expert
iamthwee is offline Offline
5,865 posts
since Aug 2005
Feb 11th, 2006
0

Re: Newmember with big problem!!!

Quote originally posted by thinhbk1802 ...
So there is a float number problem.
What do you mean by this.??
SpS
Reputation Points: 70
Solved Threads: 32
Posting Pro
SpS is offline Offline
598 posts
since Aug 2005

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C Forum Timeline: pointer problems
Next Thread in C Forum Timeline: liner error





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC