Top Inners Fields Constructors Methods
org.jruby

public Class RubyBignum

extends RubyInteger
Class Inheritance
Annotations
@JRubyClass
name:Bignum
parent:Integer
Imports
java.io.IOException, java.math.BigDecimal, .BigInteger, org.jruby.anno.JRubyClass, .JRubyMethod, org.jruby.api.Convert, .Create, .JRubyAPI, org.jruby.runtime.CallSite, .ClassIndex, .Helpers, .JavaSites, .ThreadContext, org.jruby.runtime.builtin.IRubyObject, org.jruby.runtime.callsite.CachingCallSite, org.jruby.runtime.marshal.MarshalDumper, .MarshalLoader, org.jruby.util.io.RubyInputStream, .RubyOutputStream

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static enum

Field Summary

Modifier and TypeField and Description
private static final long
private static final int
public static final BigInteger
public static final BigInteger
public static final BigInteger
public static final BigInteger
public static final BigInteger
public static final BigInteger
private static final long
public static final BigInteger
pack-priv final BigInteger
Inherited from org.jruby.RubyInteger:
NUMERR_NEGATIVENUMERR_TOOLARGENUMERR_TYPESINGLE_CHAR_ASCII8BIT_BYTELISTSSINGLE_CHAR_BYTESSINGLE_CHAR_USASCII_BYTELISTSSINGLE_CHAR_UTF8_BYTELISTS

Constructor Summary

AccessConstructor and Description
public
RubyBignum(Ruby runtime, BigInteger value)

Method Summary

Modifier and TypeMethod and Description
public IRubyObject
abs()
Deprecated

public IRubyObject
abs(ThreadContext context)

Implements abstract org.jruby.RubyInteger.abs.

rb_big_abs

private IRubyObject
private IRubyObject
public BigInteger
asBigInteger(ThreadContext
the current thread context
context
)

Overrides org.jruby.RubyNumeric.asBigInteger.

Return a BigInteger representation of this numerical value

public double
asDouble(ThreadContext
the current thread context
context
)

Overrides org.jruby.RubyNumeric.asDouble.

Return a double representation of this numerical value

public int
asInt(ThreadContext context)

Overrides org.jruby.RubyNumeric.asInt.

Returns the value of this numeric and a java int.

public long
asLong(ThreadContext context)

Overrides org.jruby.RubyNumeric.asLong.

Return the value of this numeric as a 64-bit long.

public static double
big2dbl(RubyBignum val)

rb_big2dbl

public static long
big2long(RubyBignum val)

rb_big2long

public static long
big2ulong(RubyBignum value)

rb_big2ulong This is here because for C extensions ulong can hold different values without throwing a RangeError

public static long
big2ulong(Ruby runtime, BigInteger big)

private IRubyObject
private static long
bigHash(Ruby runtime, BigInteger value)

public static RubyInteger
bignorm(Ruby runtime, BigInteger bi)

rb_big_norm

public IRubyObject
public IRubyObject
ceil(ThreadContext context, IRubyObject arg)

Implements abstract org.jruby.RubyInteger.ceil.

rb_big_ceil

private RubyFixnum
public IRubyObject
coerce(ThreadContext context, IRubyObject other)

Overrides org.jruby.RubyNumeric.coerce.

num_coerce

public final int
compareTo(IRubyObject
another IRubyObject
other
)

Overrides org.jruby.RubyBasicObject.compareTo.

Implements java.lang.Comparable.compareTo.

Compares this Ruby object with another.

pack-priv static double
convertToDouble(BigInteger bigint)

BigInteger#doubleValue is _really_ slow currently.

public RubyRational
public IRubyObject
denominator(ThreadContext context)

Overrides org.jruby.RubyInteger.denominator.

numeric_denominator

public RubyArray<T extends IRubyObject>
digits(ThreadContext context, IRubyObject baseArg)

Implements abstract org.jruby.RubyInteger.digits.

rb_big_digits

private RubyInteger
divideImpl(ThreadContext context, BigInteger otherValue)

public IRubyObject
divmod(ThreadContext context, IRubyObject other)

Overrides org.jruby.RubyInteger.divmod.

rb_big_divmod

public IRubyObject
eql_p(ThreadContext context, IRubyObject other)

Overrides org.jruby.RubyNumeric.eql_p.

rb_big_eql

public boolean
equals(Object
object to compare
other
)

Overrides org.jruby.RubyObject.equals.

This override does not do a "checked" dispatch.

public RubyBoolean
public IRubyObject
pack-priv final RubyFloat
public IRubyObject
public IRubyObject
private RubyFloat
public static BigInteger
fix2big(RubyFixnum arg)

rb_int2big

private IRubyObject
public IRubyObject
floor(ThreadContext context, IRubyObject arg)

Implements abstract org.jruby.RubyInteger.floor.

rb_big_floor

public Class<?>
getJavaClass()

Overrides org.jruby.RubyBasicObject.getJavaClass.

Implements org.jruby.runtime.builtin.IRubyObject.getJavaClass.

Will return the Java interface that most closely can represent this object, when working through Java integration translations.

public ClassIndex
getNativeClassIndex()

Overrides org.jruby.RubyObject.getNativeClassIndex.

Implements org.jruby.runtime.marshal.CoreObjectType.getNativeClassIndex.

This is overridden in the other concrete Java builtins to provide a fast way to determine what type they are.

public BigInteger

Returns:

Value of property value.
getValue
()

Getter for property value.

public RubyFixnum
hash(ThreadContext
the current thread context
context
)

Overrides org.jruby.RubyBasicObject.hash.

Will return the hash code of this object.

public int
hashCode()

Overrides org.jruby.RubyObject.hashCode.

This override does not do "checked" dispatch since Object usually has #hash defined.

public IRubyObject
idiv(ThreadContext context, IRubyObject other)

Implements abstract org.jruby.RubyInteger.idiv.

rb_big_idiv

public IRubyObject
idiv(ThreadContext context, long other)

Overrides org.jruby.RubyNumeric.idiv.

protected boolean
public boolean
isImmediate()

Overrides org.jruby.RubyBasicObject.isImmediate.

Implements org.jruby.runtime.builtin.IRubyObject.isImmediate.

Is object immediate (def: Fixnum, Symbol, true, false, nil?).

public IRubyObject
isNegative(ThreadContext context)

Overrides org.jruby.RubyInteger.isNegative.

num_negative_p

public IRubyObject
isPositive(ThreadContext context)

Overrides org.jruby.RubyInteger.isPositive.

num_positive_p

public final boolean
public static BigInteger
long2big(long arg)

public static void
marshalTo(RubyBignum bignum, MarshalStream output)
Deprecated for removal since 10.0.

public static void
public IRubyObject
modulo(ThreadContext context, IRubyObject other)

Overrides org.jruby.RubyNumeric.modulo.

num_modulo

pack-priv IRubyObject
modulo(ThreadContext context, long other)

Overrides org.jruby.RubyNumeric.modulo.

public RubyInteger
public static RubyInteger
newBignorm(Ruby runtime, double value)

Return a Bignum or Fixnum (Integer) for the given value, or raise FloatDomainError if it is out of range.

public static RubyBignum
newBignum(Ruby runtime, long value)

public static RubyBignum
newBignum(Ruby runtime, double value)

Return a Bignum for the given value, or raise FloatDomainError if it is out of range.

public static RubyBignum
newBignum(Ruby runtime, BigInteger value)

public static RubyBignum
newBignum(Ruby runtime, String value)

public IRubyObject
nonzero_p(ThreadContext context)

Overrides org.jruby.RubyNumeric.nonzero_p.

num_nonzero_p

public IRubyObject
numerator(ThreadContext context)

Overrides org.jruby.RubyInteger.numerator.

numeric_numerator

public RubyBoolean
public IRubyObject
op_and(ThreadContext context, IRubyObject other)

Implements abstract org.jruby.RubyInteger.op_and.

rb_big_and

pack-priv final RubyInteger
protected IRubyObject
op_aref_subclass(ThreadContext context, IRubyObject other)

Implements abstract org.jruby.RubyInteger.op_aref_subclass.

rb_big_aref

public IRubyObject
op_cmp(ThreadContext context, IRubyObject other)

Implements abstract org.jruby.RubyInteger.op_cmp.

rb_big_cmp

public IRubyObject
op_div(ThreadContext context, IRubyObject other)

Implements abstract org.jruby.RubyInteger.op_div.

rb_big_div

public IRubyObject
op_div(ThreadContext context, long other)

private IRubyObject
op_divide(ThreadContext context, IRubyObject other, boolean slash)

rb_big_divide.

public IRubyObject
public IRubyObject
public IRubyObject
public IRubyObject
public IRubyObject
op_lshift(ThreadContext context, IRubyObject other)

Implements abstract org.jruby.RubyInteger.op_lshift.

rb_big_lshift

public RubyInteger
public IRubyObject
public IRubyObject
op_minus(ThreadContext context, IRubyObject other)

Implements abstract org.jruby.RubyInteger.op_minus.

rb_big_minus

public final IRubyObject
op_minus(ThreadContext context, long other)

Overrides org.jruby.RubyInteger.op_minus.

public final IRubyObject
public IRubyObject
op_mod(ThreadContext context, IRubyObject other)

Implements abstract org.jruby.RubyInteger.op_mod.

rb_big_modulo

public IRubyObject
op_mod(ThreadContext context, long other)

Overrides org.jruby.RubyInteger.op_mod.

public IRubyObject
op_mul(ThreadContext context, IRubyObject other)

Implements abstract org.jruby.RubyInteger.op_mul.

rb_big_mul

public final IRubyObject
op_mul(ThreadContext context, long other)

Overrides org.jruby.RubyInteger.op_mul.

public IRubyObject
op_neg(ThreadContext context)

Implements abstract org.jruby.RubyInteger.op_neg.

rb_big_neg

public IRubyObject
op_or(ThreadContext context, IRubyObject other)

Implements abstract org.jruby.RubyInteger.op_or.

rb_big_or

pack-priv final RubyInteger
op_or(ThreadContext context, RubyFixnum other)

public IRubyObject
op_plus(ThreadContext context, IRubyObject other)

Implements abstract org.jruby.RubyInteger.op_plus.

rb_big_plus

public final IRubyObject
op_plus(ThreadContext context, long other)

Overrides org.jruby.RubyInteger.op_plus.

public final IRubyObject
public IRubyObject
op_pow(ThreadContext context, IRubyObject other)

Implements abstract org.jruby.RubyInteger.op_pow.

rb_big_pow

public final IRubyObject
op_pow(final ThreadContext context, final long other)

public IRubyObject
op_rshift(ThreadContext context, IRubyObject other)

Implements abstract org.jruby.RubyInteger.op_rshift.

rb_big_rshift

public RubyInteger
public IRubyObject
op_uminus(ThreadContext context)

Implements abstract org.jruby.RubyInteger.op_uminus.

rb_big_uminus

public IRubyObject
op_xor(ThreadContext context, IRubyObject other)

Implements abstract org.jruby.RubyInteger.op_xor.

rb_big_xor

private RubyNumeric
pow(ThreadContext context, final double d)

public IRubyObject
quo(ThreadContext context, IRubyObject otherArg)

Overrides org.jruby.RubyNumeric.quo.

Deprecated since 10.0.

MRI: rb_big_quo, formerly Deprecated since 10.0 since CRuby no longer has Bignum-specific quo logic.

public IRubyObject
remainder(ThreadContext context, IRubyObject other)

Overrides org.jruby.RubyInteger.remainder.

rb_big_remainder

public int
public RubyClass
singletonClass(ThreadContext
the current thread context
context
)

Overrides org.jruby.RubyBasicObject.singletonClass.

Overrides default org.jruby.runtime.builtin.IRubyObject.singletonClass.

Will either return the existing singleton class for this object, or create a new one and return that.

private static JavaSites.BignumSites
sites(ThreadContext context)

Hides org.jruby.RubyInteger.sites.

Retrieve the call sites for this class.

public IRubyObject
size(ThreadContext context)

Implements abstract org.jruby.RubyInteger.size.

rb_big_size

public IRubyObject
sqrt(ThreadContext context)

Implements abstract org.jruby.RubyInteger.sqrt.

private IRubyObject
private IRubyObject
public IRubyObject
to_f(ThreadContext context)

Implements abstract org.jruby.RubyInteger.to_f.

rb_big_to_f

public IRubyObject
to_s(IRubyObject[] args)
Deprecated since 10.0.

rb_big_to_s

public RubyString
public RubyString
public static BigInteger
toBigInteger(double value)

public IRubyObject
truncate(ThreadContext context, IRubyObject arg)

Implements abstract org.jruby.RubyInteger.truncate.

rb_big_truncate

public static RubyNumeric
unmarshalFrom(UnmarshalStream input)
Deprecated for removal since 10.0.

public static RubyNumeric
public IRubyObject
zero_p(ThreadContext context)

Implements abstract org.jruby.RubyInteger.zero_p.

num_zero_p

Inherited from org.jruby.RubyInteger:
allbits_panybits_pceilceilchrchrconvertToIntegercreateIntegerClassdigitsdiv_divdowntoduckUptofdivfixnumUptofloorfloorfloorSqrtfloorSqrtgcdgcdlcmgenerateMaskinduced_fromint_half_p_half_downint_half_p_half_evenint_half_p_half_upint_round_half_downint_round_half_evenint_round_half_upinteger_pintegerCeilintegerFloorintPowTmp3intValueisNegativeNumberisOneisOneisPositiveNumberlcmmagnitudenegatenobits_pnumToUintnumToUintop_arefop_arefop_arefop_idivop_lshiftop_negop_rshiftop_uminusordpowpowpredrationalizeroundroundroundroundroundroundSharedsignumsingleCharASCII8BITByteListsingleCharByteListsingleCharStringsingleCharUSASCIIByteListsingleCharUTF8ByteListsizesqrtsucctimestimesSizeto_fto_ito_ito_rto_sto_stoFloattoIntegertruncatetruncatetry_convertupto