Class: Integer

Inherits:
Object show all
Includes:
Numeric::FloatFunction
Defined in:
(unknown)

Instance Method Summary collapse

Methods included from Numeric::FloatFunction

#acos, #acosh, #asin, #asinh, #atan, #atanh, #cos, #cosh, #deg, #distance, #exp, #log, #log10, #rad, #sin, #sinh, #sqrt, #tan, #tanh

Instance Method Details

#&Object



59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
# File 'ext/carray_numeric.c', line 59

static VALUE
rb_hack_and (VALUE x, VALUE y)
{
  if ( rb_obj_is_carray(y) ) {
    if ( rb_ca_is_boolean_type(y) ) {
      return rb_funcall(y, rb_intern("bit_and"), 1, x);
    }
    else {
#if RUBY_VERSION_CODE >= 190
      return rb_num_coerce_bin(x, y, '&');
#else
      return rb_num_coerce_bin(x, y);
#endif
    }
  }
  else {
    return rb_funcall(x, id___and__, 1, y);
  }
}

#<<Object



99
100
101
102
103
104
105
106
107
108
109
110
111
112
# File 'ext/carray_numeric.c', line 99

static VALUE
rb_hack_lshift (VALUE x, VALUE y)
{
  if ( rb_obj_is_carray(y) ) {
#if RUBY_VERSION_CODE >= 190
      return rb_num_coerce_bin(x, y, rb_intern("<<"));
#else
      return rb_num_coerce_bin(x, y);
#endif
  }
  else {
    return rb_funcall(x, id___lshift__, 1, y);
  }
}

#>>Object



114
115
116
117
118
119
120
121
122
123
124
125
126
127
# File 'ext/carray_numeric.c', line 114

static VALUE
rb_hack_rshift (VALUE x, VALUE y)
{
  if ( rb_obj_is_carray(y) ) {
#if RUBY_VERSION_CODE >= 190
      return rb_num_coerce_bin(x, y, rb_intern(">>"));
#else
      return rb_num_coerce_bin(x, y);
#endif
  }
  else {
    return rb_funcall(x, id___rshift__, 1, y);
  }
}

#^Object



79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
# File 'ext/carray_numeric.c', line 79

static VALUE
rb_hack_xor (VALUE x, VALUE y)
{
  if ( rb_obj_is_carray(y) ) {
    if ( rb_ca_is_boolean_type(y) ) {
      return rb_funcall(y, rb_intern("bit_xor"), 1, x);
    }
    else {
#if RUBY_VERSION_CODE >= 190
      return rb_num_coerce_bin(x, y, '^');
#else
      return rb_num_coerce_bin(x, y);
#endif
    }
  }
  else {
    return rb_funcall(x, id___xor__, 1, y);
  }
}

#|(y) ⇒ Object



39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# File 'ext/carray_numeric.c', line 39

static VALUE
rb_hack_or(VALUE x, VALUE y)
{
  if ( rb_obj_is_carray(y) ) {
    if ( rb_ca_is_boolean_type(y) ) {
      return rb_funcall(y, rb_intern("bit_or"), 1, x);
    }
    else {
#if RUBY_VERSION_CODE >= 190
      return rb_num_coerce_bin(x, y, '|');
#else
      return rb_num_coerce_bin(x, y);
#endif
    }
  }
  else {
    return rb_funcall(x, id___or__, 1, y);
  }
}