VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Shows how the built-in Mod operator works out the remainder of a number.

by VB-Kung-Fu (19 Submissions)
Category: Math/Dates
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Thu 9th October 2003
Date Added: Mon 8th February 2021
Rating: (1 Votes)

Shows how the built-in Mod operator works out the remainder of a number.

Rate Shows how the built-in Mod operator works out the remainder of a number.



'this function just shows how Mod works. The mod operator finds the remainder
'when you divide Num1 by Num2 using integer division. If Num2 goes exactly into Num1 then
'the result is zero.
'FACT: doing x mod (2^n) returns the value of the lower n bits of x

MyMod = num1 - ((num1 \ num2) * num2)
End Function

Download this snippet    Add to My Saved Code

Shows how the built-in Mod operator works out the remainder of a number. Comments

No comments have been posted about Shows how the built-in Mod operator works out the remainder of a number.. Why not be the first to post a comment about Shows how the built-in Mod operator works out the remainder of a number..

Post your comment

Subject:
Message:
0/1000 characters