Class: Numeric

Inherits:
Object
  • Object
show all
Defined in:
lib/carray/base/basic.rb,
lib/carray/base/obsolete.rb

Direct Known Subclasses

Rational

Instance Method Summary collapse

Instance Method Details

#deg_180Object



93
94
95
96
97
98
99
# File 'ext/mathfunc/carray_mathfunc.c', line 93

static VALUE
rb_num_deg_180 (VALUE self)
{
  double v0, v1 = NUM2DBL(self);
  mathfunc_deg_180(&v0, &v1);
  return rb_float_new(v0);
}

#deg_360Object



51
52
53
54
55
56
57
# File 'ext/mathfunc/carray_mathfunc.c', line 51

static VALUE
rb_num_deg_360 (VALUE self)
{
  double v0, v1 = NUM2DBL(self);
  mathfunc_deg_360(&v0, &v1);
  return rb_float_new(v0);
}

#eq(other) ⇒ Object



1047
1048
1049
1050
1051
1052
1053
1054
# File 'lib/carray/base/basic.rb', line 1047

def eq (other)
  case other
  when CArray
    return other.eq(self)
  else
    return send(:eq, *other.coerce(self))
  end
end

#ne(other) ⇒ Object



1056
1057
1058
1059
1060
1061
1062
1063
# File 'lib/carray/base/basic.rb', line 1056

def ne (other)
  case other
  when CArray
    return other.ne(self)
  else
    return send(:ne, *other.coerce(self))
  end
end

#rad_2piObject



131
132
133
134
135
136
137
# File 'ext/mathfunc/carray_mathfunc.c', line 131

static VALUE
rb_num_rad_2pi (VALUE self)
{
  double v0, v1 = NUM2DBL(self);
  mathfunc_rad_2pi(&v0, &v1);
  return rb_float_new(v0);
}

#rad_piObject



173
174
175
176
177
178
179
# File 'ext/mathfunc/carray_mathfunc.c', line 173

static VALUE
rb_num_rad_pi (VALUE self)
{
  double v0, v1 = NUM2DBL(self);
  mathfunc_rad_pi(&v0, &v1);
  return rb_float_new(v0);
}