System.Globalization.CCMath.mod C# (CSharp) Method

mod() public static method

A static method that computes the remainder of the division of two doubles.
public static mod ( double x, double y ) : double
x double The double value which is divided.
y double The divisor.
return double
	public static double mod(double x, double y) {
		return x - y * System.Math.Floor(x/y);
	}

Same methods

CCMath::mod ( int x, int y ) : int

Usage Example

Example #1
0
        public static bool is_leap_year(int year)
        {
            if (CCMath.mod(year, 4) != 0)
            {
                return(false);
            }
            int num = CCMath.mod(year, 400);

            return(num != 100 && num != 200 && num != 300);
        }
All Usage Examples Of System.Globalization.CCMath::mod