Class: RawFixedPt
- Inherits:
-
Object
- Object
- RawFixedPt
- Defined in:
- ext/fixedpt.c
Instance Method Summary collapse
- #binpt ⇒ Object
- #bits ⇒ Object
- #initialize(rawval, total_bits, binpt) ⇒ Object constructor
- #rawval ⇒ Object
- #sign ⇒ Object
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
#binpt ⇒ Object
79 80 81 82 |
# File 'ext/fixedpt.c', line 79 static VALUE rfp_binpt(VALUE self) { return rb_iv_get(self,"@binpt"); } |
#bits ⇒ Object
74 75 76 77 |
# File 'ext/fixedpt.c', line 74 static VALUE rfp_bits(VALUE self) { return rb_iv_get(self,"@bits"); } |
#rawval ⇒ Object
69 70 71 72 |
# File 'ext/fixedpt.c', line 69 static VALUE rfp_rawval(VALUE self) { return rb_iv_get(self,"@rawval"); } |
#sign ⇒ Object
85 86 87 88 |
# File 'ext/fixedpt.c', line 85 static VALUE rfp_sign(VALUE self) { return rb_iv_get(self,"@sign"); } |