Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- bool IsWholeNumber(int TestNum, int DividedBy)
- {
- int EndResult = 0, Quotient = 0;
- Quotient = TestNum / DividedBy;
- EndResult = Quotient * DividedBy;
- if(EndResult == TestNum)
- {
- return true;
- }
- else
- {
- return false;
- }
- }
- bool IsWholeNumberFloat(float TestNum, float DividedBy)
- {
- float Quotient = 0;
- int EndResult = 0;
- Quotient = TestNum / DividedBy;
- EndResult = ( ( (int)Quotient ) * ( (int)DividedBy ) );
- if(EndResult == ((int)TestNum))
- {
- return true;
- }
- else
- {
- return false;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement