/* * Document-method: Bignum#to_msgpack * * call-seq: * bignum.to_msgpack(out = '') -> String * * Serializes the Bignum into raw bytes. */ static VALUE MessagePack_Bignum_to_msgpack(int argc, VALUE *argv, VALUE self) { ARG_BUFFER(out, argc, argv); // FIXME bignum if(RBIGNUM_SIGN(self)) { // positive msgpack_pack_uint64(out, rb_big2ull(self)); } else { // negative msgpack_pack_int64(out, rb_big2ll(self)); } return out; }