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
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);
        }
Example #2
0
        public static int elapsed_days(int year)
        {
            int num = CCMath.div(235 * year - 234, 19);
            int num3;
            int num2 = CCMath.div_mod(out num3, num, 1080);
            int x    = 204 + 793 * num3;
            int x2   = 11 + 12 * num + 793 * num2 + CCMath.div(x, 1080);
            int num4 = 29 * num + CCMath.div(x2, 24);

            if (CCMath.mod(3 * (num4 + 1), 7) < 3)
            {
                num4++;
            }
            return(num4);
        }
Example #3
0
 public static DayOfWeek day_of_week(int date)
 {
     return((DayOfWeek)CCMath.mod(date, 7));
 }
Example #4
0
        public static int amod(int x, int y)
        {
            int num = CCMath.mod(x, y);

            return((num != 0) ? num : y);
        }
Example #5
0
        public static double amod(double x, double y)
        {
            double num = CCMath.mod(x, y);

            return((num != 0.0) ? num : y);
        }
 public static bool is_leap_year(int year)
 {
     return(CCMath.mod(14 + 11 * year, 30) < 11);
 }
 public static bool is_leap_year(int year)
 {
     return(CCMath.mod(year, 4) == ((year <= 0) ? 3 : 0));
 }
Example #8
0
 public static bool long_heshvan(int year)
 {
     return(CCMath.mod(CCHebrewCalendar.days_in_year(year), 10) == 5);
 }
Example #9
0
 public static bool is_leap_year(int year)
 {
     return(CCMath.mod(7 * year + 1, 19) < 7);
 }
Example #10
0
 public static bool short_kislev(int year)
 {
     return(CCMath.mod(CCHebrewCalendar.days_in_year(year), 10) == 3);
 }