Module: GMP
- Defined in:
- ext/gmp.c,
ext/gmpf.c,
ext/gmpq.c,
ext/gmpz.c,
ext/mprnd.c,
ext/gmpbench_timing.c
Defined Under Namespace
Classes: F, Q, RandState, Rnd, Z
Constant Summary collapse
- GMP_VERSION =
rb_str_new2(gmp_version)
- GMP_CC =
rb_str_new2(__GMP_CC)
- GMP_CFLAGS =
rb_str_new2(__GMP_CFLAGS)
- GMP_BITS_PER_LIMB =
INT2FIX(mp_bits_per_limb)
- GMP_NUMB_MAX =
ULONG2NUM(GMP_NUMB_MAX)
- MPFR_VERSION =
rb_str_new2(MPFR_VERSION_STRING)
- MPFR_PREC_MIN =
INT2FIX(MPFR_PREC_MIN)
- MPFR_PREC_MAX =
INT2FIX(MPFR_PREC_MAX)
- GMP_RNDN =
rb_funcall (cGMP_Rnd, new_id, 1, INT2FIX(0))
- GMP_RNDZ =
rb_funcall (cGMP_Rnd, new_id, 1, INT2FIX(1))
- GMP_RNDU =
rb_funcall (cGMP_Rnd, new_id, 1, INT2FIX(2))
- GMP_RNDD =
rb_funcall (cGMP_Rnd, new_id, 1, INT2FIX(3))
- MPFR_RNDN =
MPFR 3.0.0
rb_funcall (cGMP_Rnd, new_id, 1, INT2FIX(0))
- MPFR_RNDZ =
rb_funcall (cGMP_Rnd, new_id, 1, INT2FIX(1))
- MPFR_RNDU =
rb_funcall (cGMP_Rnd, new_id, 1, INT2FIX(2))
- MPFR_RNDD =
rb_funcall (cGMP_Rnd, new_id, 1, INT2FIX(3))
- MPFR_RNDA =
rb_funcall (cGMP_Rnd, new_id, 1, INT2FIX(4))
Class Method Summary collapse
- .cputime ⇒ Object
-
.F ⇒ Object
GMP Multiple Precision floating point numbers.
-
.GMP::Q(arg) ⇒ Object
A convenience method for GMP::Q.new(arg).
- .time ⇒ Object
-
.GMP::Z(value) ⇒ Object
A convenience method for GMP::Z.new(value).
Class Method Details
.cputime ⇒ Object
48 49 50 51 52 53 |
# File 'ext/gmpbench_timing.c', line 48
VALUE
r_gmpmod_cputime (VALUE self)
{
(void)self;
return INT2FIX (cputime ());
}
|
.F ⇒ Object
GMP Multiple Precision floating point numbers.
Instances of this class can store variables of the type mpf_t. This class also contains many methods that act as the functions for mpf_t variables, as well as a few methods that attempt to make this library more Ruby-ish.
.GMP::Q(arg) ⇒ Object
A convenience method for GMP::Q.new(arg).
99 100 101 102 103 |
# File 'ext/gmpq.c', line 99
VALUE r_gmpmod_q(int argc, VALUE *argv, VALUE module)
{
(void)module;
return r_gmpqsg_new(argc, argv, cGMP_Q);
}
|
.time ⇒ Object
55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 |
# File 'ext/gmpbench_timing.c', line 55
VALUE
r_gmpmod_time (VALUE self)
{
(void)self;
long int __t0, __times, __t, __tmp;
__times = 1;
rb_need_block();
rb_yield (Qnil);
do {
__times <<= 1;
__t0 = cputime ();
for (__t = 0; __t < __times; __t++)
{rb_yield (Qnil);}
__tmp = cputime () - __t0;
} while (__tmp < 250);
return rb_float_new ((double) __tmp / __times);
}
|
.GMP::Z(value) ⇒ Object
A convenience method for GMP::Z.new(value).
545 546 547 548 549 |
# File 'ext/gmpz.c', line 545
VALUE r_gmpmod_z(int argc, VALUE *argv, VALUE module)
{
(void)module;
return r_gmpzsg_new(argc, argv, cGMP_Z);
}
|