public void tobiginteger() { BigFraction a = new BigFraction(new BigInteger(1000), new BigInteger(100)); BigInteger aint = a.ToBigInteger(); BigInteger expected = new BigInteger(10); Assert.Equal(expected, aint); }
private BigInteger Encode(BigFraction a) { if (a < 0) { a = a + KeyStruct.MaxRawPlaintext + 1; } a = a * KeyStruct.PlaintextExp; return(a.ToBigInteger()); }