- Common ways to obtain RubyBignum
private void myMethod () {RubyBignum r =
RubyRandom.RandomType rubyRandomRandomType;rubyRandomRandomType.getState()
Ruby runtime;String value;new RubyBignum(runtime, new BigInteger(value))
Ruby runtime;RubyBignum.newBignum(runtime, value)
- Smart code suggestions by Codota
}
public static RubyFixnum safeHash(final ThreadContext context, IRubyObject obj) { Ruby runtime = context.runtime; IRubyObject hval = context.safeRecurse(sites(context).recursive_hash, runtime, obj, "hash", true); while (!(hval instanceof RubyFixnum)) { if (hval instanceof RubyBignum) { // This is different from MRI because we don't have rb_integer_pack return ((RubyBignum) hval).hash(); } hval = hval.convertToInteger(); } return (RubyFixnum) hval; }
public static RubyFixnum safeHash(final ThreadContext context, IRubyObject obj) { Ruby runtime = context.runtime; IRubyObject hval = context.safeRecurse(sites(context).recursive_hash, runtime, obj, "hash", true); while (!(hval instanceof RubyFixnum)) { if (hval instanceof RubyBignum) { // This is different from MRI because we don't have rb_integer_pack return ((RubyBignum) hval).hash(); } hval = hval.convertToInteger(); } return (RubyFixnum) hval; }