Exetools  

Go Back   Exetools > General > General Discussion

Notices

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #17  
Old 11-27-2004, 00:05
volodya
 
Posts: n/a
In the second iteration, line 1 might give 67 (added 57 this time), line 2 = 57, line 3 = ..... 0.

DAMN... DAMN... DAMN ONE MORE TIME. It is me who should go and study comp.sci. This is the integer arithmetic... Fuck.

OK,
carac2 = carac2 + resultat[cpt3] ; (1) - you say, for example, carac2 will be 67. OK. Fine.
Then:
resultat[cpt3] = carac2 % 100 ; (2)
the operation "%" in C/C++ is the same as mod in number theory.
So, 67 mod 100 = 67 - not 57 as you are trying to say if I understood you properly, of course...
Then:
carac2 = carac2 div 100 -> carac2 = 67/100 - this is normally not 0, of course, BUT this is computer arithmetic and the result is rounded up, so it will be floor(67/100) which is 0 indeed. So you are partially right and I'm wrong. My bad.
Reply With Quote
 

Thread Tools
Display Modes

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 08:12.


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