Class: Bignum

Inherits:
Object
  • Object
show all
Defined in:
(unknown)

Instance Method Summary collapse

Instance Method Details

#to_msgpack(*args) ⇒ Object

call-seq:

bignum.to_msgpack(out = '') -> String

Serializes the Bignum into raw bytes.



133
134
135
136
137
138
139
140
141
142
# File 'ext/pack.c', line 133

static VALUE MessagePack_Bignum_to_msgpack(int argc, VALUE *argv, VALUE self)
{
  ARG_BUFFER(out, argc, argv);
  if(RBIGNUM_POSITIVE_P(self)) {
    msgpack_pack_uint64(out, rb_big2ull(self));
  } else {
    msgpack_pack_int64(out, rb_big2ll(self));
  }
  return out;
}