Class: RawFixedPt

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

Instance Method Summary collapse

Constructor Details

#initialize(rawval, total_bits, binpt) ⇒ Object



54
55
56
57
58
59
60
61
62
63
64
65
66
67
# File 'ext/fixedpt.c', line 54

static VALUE rfp_init(VALUE self, VALUE rawval, VALUE total_bits, VALUE binpt)
{
  VALUE sign;
  rb_iv_set(self,"@rawval",fix_abs(rawval));
  rb_iv_set(self,"@bits",total_bits);
  rb_iv_set(self,"@binpt",binpt);
  if( FIX2INT(rawval) < 0){
    sign = INT2FIX(-1);
  } else {
    sign = INT2FIX(1);
  }
  rb_iv_set(self,"@sign",sign);
  return self;
}

Instance Method Details

#binptObject



79
80
81
82
# File 'ext/fixedpt.c', line 79

static VALUE rfp_binpt(VALUE self)
{
  return rb_iv_get(self,"@binpt");
}

#bitsObject



74
75
76
77
# File 'ext/fixedpt.c', line 74

static VALUE rfp_bits(VALUE self)
{
  return rb_iv_get(self,"@bits");
}

#rawvalObject



69
70
71
72
# File 'ext/fixedpt.c', line 69

static VALUE rfp_rawval(VALUE self)
{
  return rb_iv_get(self,"@rawval");
}

#signObject



85
86
87
88
# File 'ext/fixedpt.c', line 85

static VALUE rfp_sign(VALUE self)
{
  return rb_iv_get(self,"@sign");
}