mod and div

# Thread: mod and div

1. Senior Member
Join Date
Dec 1969
Posts
373

## mod and div

if anyone here knows pascal, there are the math operation like mod and div:<BR><BR>5 mod 2 = 1<BR>5 div 2 = 2<BR><BR>it can only be applied on integers.<BR><BR>these are division operations and if the number can be divided to an integer number mod will equal 0 and div will equal the divions result, if the number can&#039;t be divided to an integer then mod will equall the remaining part of the number that without it the number can be fully divided to an integer.

2. God
Senior Member
Join Date
Dec 1969
Posts
18,177

## Thanks for the Pascal..

.. lesson.<BR><BR>But this is an ASP Message Board, so you might not get many Pascal fans.

3. Senior Member
Join Date
Dec 1969
Posts
1,424

## And in VB (script )....

&#062; Pascal:<BR>&#062; 5 mod 2 = 1<BR>&#062; 5 div 2 = 2<BR><BR>In VBScript, you&#039;d do:<BR><BR>5 Mod 2 = 1<BR>5 2 = 2<BR><BR>In Javascript, you&#039;d do:<BR><BR>5 % 2 = 1<BR>Math.floor( 5 / 2 ) = 2

4. Senior Member
Join Date
Dec 1969
Posts
373

## any suggestions on where i should look for this

.

5. Senior Member
Join Date
Dec 1969
Posts
373

## 10x alot :)

.

6. Senior Member
Join Date
Dec 1969
Posts
96,118

## Or...

Digory wrote:<BR><BR>In Javascript, you&#039;d do:<BR><BR>5 % 2 = 1<BR>Math.floor( 5 / 2 ) = 2<BR><BR>*****************<BR><BR>Just to be anal retentive about it, you could also do:<BR><BR>5 % 2 --&#062;&#062; 1<BR>and<BR>( 5 - 5 % 2 ) / 2 --&#062;&#062; 2<BR><BR>

7. Senior Member
Join Date
Dec 1969
Posts
96,118

## If you insist:

alot alot alot alot alot alot alot alot alot alot <BR><BR>Now why did you ask us to multiply alot by 10???<BR><BR><BR>

8. Senior Member
Join Date
Dec 1969
Posts
102

## RE: mod and div

X = mod(5/2)

9. Senior Member
Join Date
Dec 1969
Posts
102

## RE: And in VB (script )....

In ASP:<BR>mod(5/2) = 2

10. Senior Member
Join Date
Dec 1969
Location
Los Angeles, CA
Posts
21,192

## Nope....wrong

&#062;Now why did you ask us to multiply alot by 10<BR>he actually asked you to multiply 10 by alot<BR><BR><BR>And the value of alot is......<BR><BR>Sorry Billy but you are wrong about this one<BR><BR><BR>tell me not to post in the Advanced forum will you...hmph<BR><BR><BR>:p<BR>

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•