Ejemplo n.º 1
0
        public static mpf GetBiasedRandomBits(randstate state, long maxSize, long exp)
        {
            var f = new mpf(precision: DefaultPrecision);

            mpir.mpf_rrandomb(f, state, maxSize, exp);
            return(f);
        }
Ejemplo n.º 2
0
        public static mpf GetUniformlyDistributedRandomBits(randstate state, ulong nbits)
        {
            var f = new mpf(precision: Math.Max(DefaultPrecision, nbits));

            mpir.mpf_urandomb(f, state, nbits);
            return(f);
        }
Ejemplo n.º 3
0
        public static mpc GetUniformlyDistributedRandom(randstate state, long?precision = null)
        {
            var c = new mpc(precision: precision.GetValueOrDefault(DefaultPrecision));

            mpir.mpc_urandom(c, state);
            return(c);
        }
Ejemplo n.º 4
0
 public override mpz NextPrimeCandidate(randstate state)
 {
     mpir.mpz_next_prime_candidate(this, this, state);
     return(this);
 }
Ejemplo n.º 5
0
 public randstate(randstate op)
 {
     Val = mpir.gmp_randinit_set(op);
 }