![]() |
#1 | ||
Join Date: Oct 2004
Location: Opole, Poland
Posts: 14,276
|
![]() Simple. What are the commands in C++ equivalent in function to Pascal MOD and DIV commands? I need this little detail for a program of mine...
|
||
![]() ![]() |
|
![]() |
#2 | ||
![]() ![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jun 2005
Location: Bicester, England
Posts: 45
|
![]() Mod is the percentage sign - %
I don't know if there is one for div, but you can just use the / operator, then disregard the fractional part.
__________________
Let teh phantasy rule your mind |
||
![]() ![]() |
|
![]() |
#3 | ||
![]() ![]() ![]() Join Date: Sep 2004
Location: Dentergem, Belgium
Posts: 1,811
|
![]() If DIV is division (I don't know Pascal, so I'm just going on the shape of the word), you just use / for divisions.
E.G. x = 10; x = x/5; print x; OUTPUT: 2 |
||
![]() ![]() |
|
![]() |
#4 | ||
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jan 2005
Location: ,
Posts: 454
|
![]() Operator / concerning two integers returns an integer.
Expresions: 19/5=3; 19/(5.0)= 3.8;
__________________
Never mess with me when I have a cougar, Never! |
||
![]() ![]() |
|
![]() |
#5 | ||
![]() ![]() ![]() ![]() ![]() Join Date: Jun 2004
Location: Jan Mayen, Svalbard and Jan Mayen
Posts: 2,167
|
![]() yeps
Code:
19/5 = 3 19%5 = 4
__________________
Flowing with the stream of life |
||
![]() ![]() |
|
![]() |
#6 | ||
Join Date: Oct 2004
Location: Opole, Poland
Posts: 14,276
|
![]() Thanks people. You're real lifesavers...
|
||
![]() ![]() |
|
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Free Virtual Pc Equivalents? | The Fifth Horseman | Tech Corner | 14 | 18-05-2005 09:40 AM |
|
|
||
  |