Class: GMP::Z

Inherits:
Integer
  • Object
show all
Defined in:
ext/gmp.c

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(*args) ⇒ Object



154
155
156
157
158
159
160
161
162
163
# File 'ext/gmp.c', line 154

static VALUE r_gmpz_initialize(int argc, VALUE *argv, VALUE self)
{
  MP_INT *self_val;

  if (argc != 0) {
    mpz_get_struct(self,self_val);
    mpz_set_value (self_val, argv[0]);
  }
  return Qnil;
}

Class Method Details

.facObject

.fibObject

.new(*args) ⇒ Object



85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
# File 'ext/gmp.c', line 85

static VALUE r_gmpzsg_new(int argc, VALUE *argv, VALUE klass)
{
  MP_INT *res_val;
  VALUE res;

  (void)klass;

  if (argc > 1)
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0 or 1)", argc);

  mpz_make_struct (res, res_val);
  mpz_init (res_val);

  rb_obj_call_init(res, argc, argv);

  return res;
}

.powObject

Instance Method Details

#&Object

#*Object

#**Object

#+Object

#-Object

#-@Object

#/Object

#<Object

#<<Object

#<=Object

#<=>Object

#==Object

#>Object

#>=Object

#>>Object

#[]Object

#[]=Object

#^Object

#absObject

#abs!Object

#add!Object

#cdivObject

#cmodObject

#cmpabsObject

#coerce(arg) ⇒ Object



322
323
324
325
# File 'ext/gmp.c', line 322

static VALUE r_gmpz_coerce(VALUE self, VALUE arg)
{
  return rb_assoc_new(r_gmpzsg_new(1, &arg, cGMP_Z), self);
}

#comObject

#com!Object

#even?Boolean

Returns:

  • (Boolean)

#fdivObject

#fmodObject

#jacobiObject

#lastbits_posObject

#lastbits_sgnObject

#legendreObject

#negObject

#neg!Object

#nextprimeObject

#nextprime!Object

#odd?Boolean

Returns:

  • (Boolean)

#popcountObject

#power?Boolean

Returns:

  • (Boolean)

#powmodObject

#probab_prime?Boolean

Returns:

  • (Boolean)

#removeObject

#rootObject

#scan0Object

#scan1Object

#sgnObject

#sqrtObject

#sqrt!Object

#sqrtremObject

#square?Boolean

Returns:

  • (Boolean)

#sub!Object

#swapObject

#tdivObject

#tmodObject

#to_dObject

#to_iObject

#to_sObject

#tshrObject

#|Object