#include <stdlib.h>
#include <math.h>
#include <gmp.h>
#include <R.h>
#include <Rdefines.h>
Functions | |
isprime (char **nbrein, int *val, int *reps) | |
Check if nbrein is prime, Use mpz_probab_prime_p from libgmp return 2 if prime, 0 if not, 1 if don't know. | |
int | gmp_div (char **a, char **b, double *res) |
division as a double. res = (doulbe) a / b | |
SEXP | nextprime (SEXP nbrein, SEXP nbreout) |
Give next prime number. | |
SEXP | gmp_add (SEXP a, SEXP b) |
Addition of a & b. | |
SEXP | gmp_sub (SEXP a, SEXP b) |
Substraction of a & b. | |
SEXP | gmp_mul (SEXP a, SEXP b) |
Multiplication of a & b. | |
SEXP | gmp_fdivq (SEXP a, SEXP b) |
Quotient of a / b. | |
SEXP | gmp_fdivr (SEXP a, SEXP b) |
Reminder of a / b (a = bq +r). | |
SEXP | gmp_gcd (SEXP a, SEXP b) |
Great common divisor of a & b. | |
SEXP | gmp_lcm (SEXP a, SEXP b) |
Lower common multiple of a & b. | |
SEXP | gmp_invert (SEXP a, SEXP b) |
Invert of a in [b/bZ]. | |
SEXP | gmp_powm (SEXP a, SEXP exp, SEXP m) |
Power of a ^ exp [m]. | |
SEXP | gmp_pow (SEXP a, SEXP exp) |
Power of a ^ exp. | |
SEXP | gmp_gcdex (SEXP a, SEXP b) |
Bezoult coefficients: compute g,s and t as as + bt = g. | |
SEXP | gmp_rand_u (SEXP length, SEXP newseed, SEXP ok) |
Random number generation. | |
Variables | |
gmp_randstate_t | seed_state |
int | seed_init = 0 |
Last modified: Time-stamp: <2004-09-27 16:21:42 lucas>
|
Addition of a & b.
|
|
division as a double. res = (doulbe) a / b
|
|
Quotient of a / b.
|
|
Reminder of a / b (a = bq +r).
|
|
Great common divisor of a & b.
|
|
Bezoult coefficients: compute g,s and t as as + bt = g.
|
|
Invert of a in [b/bZ].
|
|
Lower common multiple of a & b.
|
|
Multiplication of a & b.
|
|
Power of a ^ exp.
|
|
Power of a ^ exp [m].
|
|
Random number generation.
|
|
Substraction of a & b.
|
|
Check if nbrein is prime, Use mpz_probab_prime_p from libgmp return 2 if prime, 0 if not, 1 if don't know.
|
|
Give next prime number.
|
|
|
|
|