public static SqlNumber Remainder(SqlNumber a, SqlNumber b) { if (SqlNumber.IsNumber(a)) { if (SqlNumber.IsNumber(b)) { BigDecimal divBy = b.innerValue; if (divBy.CompareTo(BigDecimal.Zero) != 0) { var remainder = BigMath.Remainder(a.innerValue, divBy); return(new SqlNumber(SqlNumber.NumericState.None, remainder)); } } } return(SqlNumber.NaN); }