Exetools  

Go Back   Exetools > General > General Discussion

Notices

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #16  
Old 11-26-2004, 22:56
Mkz Mkz is offline
Friend
 
Join Date: Jan 2002
Posts: 98
Rept. Given: 0
Rept. Rcvd 2 Times in 2 Posts
Thanks Given: 5
Thanks Rcvd at 25 Times in 17 Posts
Mkz Reputation: 2
Quote:
Originally Posted by volodya

while(carac2!=0)
{
carac2 = carac2 + resultat[cpt3] ; (1)
resultat[cpt3] = carac2 % 100 ; (2)
carac2 = carac2 div 100 ; (3)
cpt3++ ;
}


Are you sure you did it well?
carac2 = carac2 div 100 - I'm assuming I see the division, rigth? Then go study math - the division will never give you 0 (in the integers ring) - and you check for 0 in while loop - endless cycle.
There's something here I don't understand...
Let's assume carac2 enters the loop with 1000.
After line 1, let's say 1050.
Line 2 will produce 50, line 3 will produce 10.
In the second iteration, line 1 might give 67 (added 57 this time), line 2 = 57, line 3 = ..... 0.

Each iteration adds a (small) amount to carac2, then shifts it right by 2 decimal places, eventually resulting in 0. Does it not?
Reply With Quote
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Help identify crypto The Old Pirate General Discussion 5 12-27-2014 04:15


All times are GMT +8. The time now is 03:34.


Always Your Best Friend: Aaron, JMI, ahmadmansoor, ZeNiX, chessgod101
( Since 1998 )