public static FractionValue Root(BigInteger principal, FractionValue radical) { if (principal == 0) { throw new Exception("n.a"); } else if (radical == (FractionValue)0) { return(0); } else { //TODO throw new NotImplementedException(); } }
//Copy pasta https://stackoverflow.com/questions/20593755/why-do-i-have-to-overload-operators-when-implementing-compareto private static int CompareTo(FractionValue x, FractionValue y) => x.CompareTo(y);
public static FractionValue Root(FractionValue principal, FractionValue radical) => Root(principal.N, radical ^ principal.Z);