public static double ceiling(double n, double s) {if (n>0 && s<0) {return Double.NaN;} else {return (n == 0 || s == 0) ? 0 : Math.ceil(n/s) * s;}}
public static double Ceiling(double n, double s){double c;if ((n < 0 && s > 0) || (n > 0 && s < 0)){c = double.NaN;}else{c = (n == 0 || s == 0) ? 0 : Math.Ceiling(n / s) * s;}return c;}