Issue
I know that there is already a way to find if a number is even or odd using the modulus (What is the fastest way to find if a number is even or odd?). However, I was wondering if there is a C# function like Math.Even or Math.Odd. Is the only way to do this by using a modulus?
Solution
It may count as cheating, but if you use BigInteger, it has an IsEven method.
As stated in MSDN, calling this method is equivalent to:
value % 2 == 0;
Reference:
Answered By - Victor Zakharov Answer Checked By - Senaida (PHPFixing Volunteer)
0 Comments:
Post a Comment
Note: Only a member of this blog may post a comment.