private static BigPointNumber Div(BigPointNumber A, BigPointNumber B) { BigPointNumber a = A; BigPointNumber b = B; RemoveFractionalParts(ref a, ref b); BigNumber a_ = new BigNumber(a.ToString()); BigNumber b_ = new BigNumber(b.ToString()); return(new BigPointNumber(BigNumber.Div(a_, b_).ToString())); }
/// <summary> /// Получение целой части числа из str /// </summary> /// <param name="str"></param> /// <returns></returns> private static string GetDiv(string str) { try { string rez = BigNumber.Div(str); foreach (char ch in rez) { if (ch < '0' || ch > '9') { throw new Exception(); } } return(rez); } catch { return("-1"); } }