public void Implicit_operators_reuse_one() { Fp a = 1; Fp b = 1U; Fp c = 1L; Fp d = 1UL; Fp e = new BigInteger(1); Assert.True(ReferenceEquals(a, Fp.One), a.GetType().Name); Assert.True(ReferenceEquals(b, Fp.One), a.GetType().Name); Assert.True(ReferenceEquals(c, Fp.One), a.GetType().Name); Assert.True(ReferenceEquals(d, Fp.One), a.GetType().Name); Assert.True(ReferenceEquals(e, Fp.One), a.GetType().Name); }
public void Implicit_operators_reuse_zero() { Fp a = 0; Fp b = 0U; Fp c = 0L; Fp d = 0UL; Fp e = new BigInteger(0); Assert.True(ReferenceEquals(a, Fp.Zero), a.GetType().Name); Assert.True(ReferenceEquals(b, Fp.Zero), a.GetType().Name); Assert.True(ReferenceEquals(c, Fp.Zero), a.GetType().Name); Assert.True(ReferenceEquals(d, Fp.Zero), a.GetType().Name); Assert.True(ReferenceEquals(e, Fp.Zero), a.GetType().Name); }