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.
'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
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..