Newmember with big problem!!!

Reply

Join Date: Feb 2006
Posts: 2
Reputation: thinhbk1802 is an unknown quantity at this point 
Solved Threads: 0
thinhbk1802 thinhbk1802 is offline Offline
Newbie Poster

Newmember with big problem!!!

 
0
  #1
Feb 11th, 2006
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.
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 5,264
Reputation: iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold 
Solved Threads: 377
Featured Poster
iamthwee's Avatar
iamthwee iamthwee is offline Offline
Posting Expert

Re: Newmember with big problem!!!

 
0
  #2
Feb 11th, 2006
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
*Voted best profile in the world*
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 598
Reputation: SpS is on a distinguished road 
Solved Threads: 32
SpS's Avatar
SpS SpS is offline Offline
Posting Pro

Re: Newmember with big problem!!!

 
0
  #3
Feb 11th, 2006
Originally Posted by thinhbk1802
So there is a float number problem.
What do you mean by this.??
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the C Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC