public class RubyBignum extends RubyInteger
RubyNumeric.InvalidIntegerException, RubyNumeric.NumberTooLargeExceptionRubyObject.DataRubyBasicObject.Finalizer| Modifier and Type | Field and Description |
|---|---|
static java.math.BigInteger |
LONG_MAX |
static java.math.BigInteger |
LONG_MIN |
static java.math.BigInteger |
ULONG_MAX |
SINGLE_CHAR_BYTELISTS19DBL_EPSILON, NUMERIC_ALLOCATORIVAR_INSPECTING_OBJECT_ALLOCATOR, OBJECT_ALLOCATOR, REIFYING_OBJECT_ALLOCATORALL_F, BASICOBJECT_ALLOCATOR, COMPARE_BY_IDENTITY_F, ERR_INSECURE_SET_INST_VAR, FALSE_F, FL_USHIFT, flags, FROZEN_F, IS_OVERLAID_F, metaClass, NEVER, NIL_F, REFINED_MODULE_F, STAMP_OFFSET, TAINTED_F, UNDEF, UNTRUST_F, USER0_F, USER1_F, USER2_F, USER3_F, USER4_F, USER5_F, USER6_F, USER7_F, USER8_F, USER9_F, USERA_F, VAR_TABLE_OFFSET, varTable, varTableStampNULL_ARRAY| Constructor and Description |
|---|
RubyBignum(Ruby runtime,
java.math.BigInteger value) |
| Modifier and Type | Method and Description |
|---|---|
IRubyObject |
abs()
Deprecated.
|
IRubyObject |
abs(ThreadContext context)
rb_big_abs
|
static double |
big2dbl(RubyBignum val)
rb_big2dbl
|
static long |
big2long(RubyBignum val)
rb_big2long
|
static long |
big2ulong(RubyBignum value)
rb_big2ulong
This is here because for C extensions ulong can hold different values without throwing a RangeError
|
static RubyInteger |
bignorm(Ruby runtime,
java.math.BigInteger bi)
rb_big_norm
|
IRubyObject |
bit_length(ThreadContext context) |
IRubyObject |
ceil(ThreadContext context,
IRubyObject arg)
rb_big_ceil
|
IRubyObject |
coerce(IRubyObject other)
rb_big_coerce
|
int |
compareTo(IRubyObject other)
Compares this Ruby object with another.
|
RubyRational |
convertToRational() |
static RubyClass |
createBignumClass(Ruby runtime) |
IRubyObject |
denominator(ThreadContext context)
numeric_denominator
|
RubyArray |
digits(ThreadContext context,
IRubyObject base)
rb_big_digits
|
IRubyObject |
divmod(ThreadContext context,
IRubyObject other)
rb_big_divmod
|
IRubyObject |
eql_p(IRubyObject other)
rb_big_eql
|
IRubyObject |
eql_p19(IRubyObject other)
Deprecated.
|
boolean |
equals(java.lang.Object other)
This override does not do a "checked" dispatch.
|
RubyBoolean |
even_p(ThreadContext context) |
IRubyObject |
fdivDouble(ThreadContext context,
IRubyObject y) |
IRubyObject |
fdivFloat(ThreadContext context,
RubyFloat y) |
IRubyObject |
fdivInt(ThreadContext context,
RubyBignum y) |
static java.math.BigInteger |
fix2big(RubyFixnum arg)
rb_int2big
|
IRubyObject |
floor(ThreadContext context,
IRubyObject arg)
rb_big_floor
|
java.math.BigInteger |
getBigIntegerValue() |
double |
getDoubleValue() |
int |
getIntValue()
Return the value of this numeric as a 32-bit long.
|
java.lang.Class<?> |
getJavaClass()
Will return the Java interface that most closely can represent
this object, when working through Java integration translations.
|
long |
getLongValue()
Return the value of this numeric as a 64-bit long.
|
ClassIndex |
getNativeClassIndex()
This is overridden in the other concrete Java builtins to provide a fast way
to determine what type they are.
|
RubyClass |
getSingletonClass()
rb_singleton_class
Note: this method is specialized for RubyFixnum, RubySymbol,
RubyNil and RubyBoolean
Will either return the existing singleton class for this
object, or create a new one and return that.
|
java.math.BigInteger |
getValue()
Getter for property value.
|
RubyFixnum |
hash()
rb_big_hash
|
int |
hashCode()
This override does not do "checked" dispatch since Object usually has #hash defined.
|
IRubyObject |
idiv(ThreadContext context,
IRubyObject other)
rb_big_idiv
|
IRubyObject |
idiv(ThreadContext context,
long other) |
protected boolean |
int_round_zero_p(ThreadContext context,
int ndigits) |
boolean |
isImmediate()
Is object immediate (def: Fixnum, Symbol, true, false, nil?).
|
IRubyObject |
isNegative(ThreadContext context)
num_negative_p
|
IRubyObject |
isPositive(ThreadContext context)
num_positive_p
|
boolean |
isZero() |
static java.math.BigInteger |
long2big(long arg) |
static void |
marshalTo(RubyBignum bignum,
MarshalStream output) |
IRubyObject |
modulo(ThreadContext context,
IRubyObject other)
num_modulo
|
RubyInteger |
negate() |
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.
|
static RubyBignum |
newBignum(Ruby runtime,
java.math.BigInteger value) |
static RubyBignum |
newBignum(Ruby runtime,
double value)
Return a Bignum for the given value, or raise FloatDomainError if it is out of range.
|
static RubyBignum |
newBignum(Ruby runtime,
long value) |
static RubyBignum |
newBignum(Ruby runtime,
java.lang.String value) |
IRubyObject |
nonzero_p(ThreadContext context)
num_nonzero_p
|
IRubyObject |
numerator(ThreadContext context)
numeric_numerator
|
RubyBoolean |
odd_p(ThreadContext context) |
IRubyObject |
op_and(ThreadContext context,
IRubyObject other)
rb_big_and
|
IRubyObject |
op_and19(ThreadContext context,
IRubyObject other)
Deprecated.
|
RubyFixnum |
op_aref(ThreadContext context,
IRubyObject other)
rb_big_aref
|
IRubyObject |
op_cmp(ThreadContext context,
IRubyObject other)
rb_big_cmp
|
IRubyObject |
op_div(ThreadContext context,
IRubyObject other)
rb_big_div
|
IRubyObject |
op_div(ThreadContext context,
long other) |
IRubyObject |
op_equal(ThreadContext context,
IRubyObject other)
rb_big_eq
|
IRubyObject |
op_lshift(ThreadContext context,
IRubyObject other)
rb_big_lshift
|
RubyInteger |
op_lshift(ThreadContext context,
long shift) |
IRubyObject |
op_minus(ThreadContext context,
java.math.BigInteger other) |
IRubyObject |
op_minus(ThreadContext context,
IRubyObject other)
rb_big_minus
|
IRubyObject |
op_minus(ThreadContext context,
long other) |
IRubyObject |
op_mod(ThreadContext context,
IRubyObject other)
rb_big_modulo
|
IRubyObject |
op_mod(ThreadContext context,
long other) |
IRubyObject |
op_mod19(ThreadContext context,
IRubyObject other)
Deprecated.
|
IRubyObject |
op_mul(ThreadContext context,
IRubyObject other)
rb_big_mul
|
IRubyObject |
op_mul(ThreadContext context,
long other) |
IRubyObject |
op_mul19(ThreadContext context,
IRubyObject other)
Deprecated.
|
IRubyObject |
op_neg(ThreadContext context)
rb_big_neg
|
IRubyObject |
op_or(ThreadContext context,
IRubyObject other)
rb_big_or
|
IRubyObject |
op_or19(ThreadContext context,
IRubyObject other)
Deprecated.
|
IRubyObject |
op_plus(ThreadContext context,
java.math.BigInteger other) |
IRubyObject |
op_plus(ThreadContext context,
IRubyObject other)
rb_big_plus
|
IRubyObject |
op_plus(ThreadContext context,
long other) |
IRubyObject |
op_pow(ThreadContext context,
IRubyObject other)
rb_big_pow
|
IRubyObject |
op_pow(ThreadContext context,
long other) |
IRubyObject |
op_pow19(ThreadContext context,
IRubyObject other)
Deprecated.
|
IRubyObject |
op_rshift(ThreadContext context,
IRubyObject other)
rb_big_rshift
|
RubyInteger |
op_rshift(ThreadContext context,
long shift) |
IRubyObject |
op_uminus(ThreadContext context)
rb_big_uminus
|
IRubyObject |
op_xor(ThreadContext context,
IRubyObject other)
rb_big_xor
|
IRubyObject |
op_xor19(ThreadContext context,
IRubyObject other)
Deprecated.
|
IRubyObject |
quo(ThreadContext context,
IRubyObject other)
rb_big_quo
|
IRubyObject |
quo19(ThreadContext context,
IRubyObject other)
Deprecated.
|
IRubyObject |
remainder(ThreadContext context,
IRubyObject other)
rb_big_remainder
|
IRubyObject |
remainder19(ThreadContext context,
IRubyObject other)
Deprecated.
|
int |
signum() |
IRubyObject |
size(ThreadContext context)
rb_big_size
|
IRubyObject |
sqrt(ThreadContext context) |
IRubyObject |
to_f() |
IRubyObject |
to_f(ThreadContext context)
rb_big_to_f
|
RubyString |
to_s()
rb_any_to_s
call-seq:
obj.to_s => string
Returns a string representing obj.
|
RubyString |
to_s(IRubyObject arg0) |
IRubyObject |
to_s(IRubyObject[] args)
rb_big_to_s
|
static java.math.BigInteger |
toBigInteger(double value) |
IRubyObject |
truncate(ThreadContext context,
IRubyObject arg)
rb_big_truncate
|
static RubyNumeric |
unmarshalFrom(UnmarshalStream input) |
IRubyObject |
zero_p(ThreadContext context)
num_zero_p
|
allbits_p, anybits_p, ceil, ceil, chr, chr, chr19, chr19, convertToInteger, createIntegerClass, digits, div_div, downto, fdiv, floor, floor, floorSqrt, floorSqrt, gcd, gcdlcm, induced_from, int_half_p_half_down, int_half_p_half_even, int_half_p_half_up, int_round_half_down, int_round_half_even, int_round_half_up, integer_p, intPowTmp3, isNegative, isPositive, lcm, magnitude, nobits_p, op_aref, op_ge, op_gt, op_idiv, op_le, op_lshift, op_lt, op_neg, op_rshift, op_uminus, ord, pow, pow, pred, rationalize, round, round, round, round, round, round19, round19, roundShared, size, sqrt, succ, times, timesSizeFn, to_i, to_r, toFloat, truncate, truncate, uptoabs2, arg, asNumeric, callCoerced, callCoerced, callCoerced, callCoerced, checkInt, checkInt, coerceBin, coerceBin, coerceBit, coerceBit, coerceBody, coerceCmp, coerceCmp, coerceFailed, coerceRelOp, coerceRelOp, coerceRescue, compareWithZero, conjugate, createNumericClass, dbl_cmp, dbl2ival, dbl2num, div, div19, divmod19, doCoerce, dup, eql_p, finite_p, fix2int, fix2int, fix2long, fixable, float2long, floatStepSize, getCoerced, getRoundingMode, image, infinite_p, initialize_copy, int2fix, intervalStepSize, isReal, modulo19, negativeInt, negFixable, negFixable, newNumeric, num_imaginary, num2chr, num2dbl, num2dbl, num2fix, num2int, num2long, numFuncall, numFuncall, numRemainder, op_cmp, op_not, op_num_equal, op_uplus, polar, posFixable, posFixable, positiveInt, quo_19, rbClone, rbClone, rbClone, rbClone, real_p, real, rect, scalar_p, singleton_method_added, step, str2fnum, str2fnum, str2fnum19, str2inum, str2inum, to_c, to_int, toJavaattachToObjectSpace, callInit, callInit, callInit, callInit, callInit, callInit, callInit, callInit, callInit, callInit, convertToType, createObjectClass, dig, eqlInternal, equalInternal, inspect, op_eqq, puts, specificEval, toRubyString, toStringaddFinalizer, anyToString, asJavaString, asString, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callSuper, checkArrayType, checkCallMethod, checkCallMethod, checkFrozen, checkStringType, checkStringType19, convertToArray, convertToFloat, convertToHash, convertToInteger, convertToInteger, convertToString, copyInstanceVariablesInto, copySpecialInstanceVariables, createBasicObjectClass, dataGetStruct, dataGetStructChecked, dataWrapStruct, decode, display, ensureInstanceVariablesSettable, eql, equal_p, equal_p19, evalUnder, extend, fastGetInstanceVariable, fastGetInternalVariable, fastHasInstanceVariable, fastHasInternalVariable, fastSetInstanceVariable, fastSetInternalVariable, freeze, frozen_p, getFFIHandle, getFlag, getInstanceEvalClass, getInstanceVariable, getInstanceVariableList, getInstanceVariableNameList, getInstanceVariables, getInternalVariable, getInternalVariables, getMetaClass, getMetaClass, getNativeHandle, getNativeTypeIndex, getObjectId, getRuntime, getSingletonClassClone, getSingletonClassCloneAndAttach, getType, getVariable, getVariableCount, getVariableList, getVariableNameList, hashyInspect, hasInstanceVariable, hasInternalVariable, hasVariables, id, infectBy, initialize, initialize19, inspect, inspectHashCode, instance_eval, instance_eval, instance_eval, instance_eval, instance_eval19, instance_eval19, instance_eval19, instance_eval19, instance_exec, instance_exec19, instance_of_p, instance_variable_defined_p, instance_variable_get, instance_variable_set, instance_variables, instance_variables19, isBuiltin, isClass, isFalse, isFrozen, isModule, isNil, isSpecialConst, isSpecialObject, isTaint, isTrue, isUntrusted, kind_of_p, makeMetaClass, method_missing, method_missing19, method, method19, methods, methods, methods19, nil_p, nonFixnumHashCode, OBJ_INIT_COPY, objInitCopy, op_equal_19, op_match, op_match19, op_not_equal, op_not_match, private_methods, private_methods19, protected_methods, protected_methods19, public_methods, public_methods19, rbInspect, remove_instance_variable, removeFinalizers, removeInstanceVariable, removeInternalVariable, respond_to_p, respond_to_p, respond_to_p19, respond_to_p19, respondsTo, respondsToMissing, respondsToMissing, send, send, send, send, send, send19, send19, send19, send19, setFFIHandle, setFlag, setFrozen, setInstanceVariable, setInternalVariable, setMetaClass, setNativeHandle, setTaint, setUntrusted, setVariable, singleton_method_added, singleton_method_added19, singleton_method_removed, singleton_method_removed19, singleton_method_undefined, singleton_method_undefined19, singleton_method, singleton_methods, specificEval, specificEval, specificEval, specificEval, syncVariables, syncVariables, taint, taint, tainted_p, testFrozen, testFrozen, to_a, trust, type_deprecated, type, untaint, untrust, untrusted_p, validateInstanceVariable, validateInstanceVariable, validateInstanceVariable, variableTableContains, variableTableFastContains, variableTableFastFetch, variableTableFastStore, variableTableFetch, variableTableRemove, variableTableStore, variableTableSync, yieldUnder, yieldUnderclone, finalize, getClass, notify, notifyAll, wait, wait, waitarraypublic static final java.math.BigInteger LONG_MAX
public static final java.math.BigInteger LONG_MIN
public static final java.math.BigInteger ULONG_MAX
public RubyBignum(Ruby runtime, java.math.BigInteger value)
public ClassIndex getNativeClassIndex()
RubyObjectgetNativeClassIndex in interface CoreObjectTypegetNativeClassIndex in class RubyObjectClassIndexpublic java.lang.Class<?> getJavaClass()
RubyBasicObjectgetJavaClass in interface IRubyObjectgetJavaClass in class RubyBasicObjectpublic static RubyBignum newBignum(Ruby runtime, long value)
public static RubyBignum newBignum(Ruby runtime, double value)
public static java.math.BigInteger toBigInteger(double value)
public static RubyInteger newBignorm(Ruby runtime, double value)
public static RubyBignum newBignum(Ruby runtime, java.math.BigInteger value)
public static RubyBignum newBignum(Ruby runtime, java.lang.String value)
public double getDoubleValue()
getDoubleValue in class RubyNumericpublic long getLongValue()
RubyNumericgetLongValue in class RubyNumericpublic int getIntValue()
RubyNumericgetIntValue in class RubyNumericpublic java.math.BigInteger getBigIntegerValue()
getBigIntegerValue in class RubyNumericpublic RubyClass getSingletonClass()
RubyBasicObjectgetSingletonClass in interface IRubyObjectgetSingletonClass in class RubyBasicObjectpublic java.math.BigInteger getValue()
public int signum()
signum in class RubyIntegerpublic RubyInteger negate()
negate in class RubyIntegerpublic static RubyInteger bignorm(Ruby runtime, java.math.BigInteger bi)
public static long big2long(RubyBignum val)
public static long big2ulong(RubyBignum value)
public static double big2dbl(RubyBignum val)
public static java.math.BigInteger fix2big(RubyFixnum arg)
public static java.math.BigInteger long2big(long arg)
public IRubyObject ceil(ThreadContext context, IRubyObject arg)
ceil in class RubyIntegerpublic IRubyObject floor(ThreadContext context, IRubyObject arg)
floor in class RubyIntegerpublic IRubyObject truncate(ThreadContext context, IRubyObject arg)
truncate in class RubyIntegerpublic RubyArray digits(ThreadContext context, IRubyObject base)
digits in class RubyIntegerpublic IRubyObject to_s(IRubyObject[] args)
public RubyString to_s()
RubyBasicObjectto_s prints the object's class and an encoding of the
object id. As a special case, the top-level object that is the
initial execution context of Ruby programs returns ``main.''to_s in class RubyIntegerpublic RubyString to_s(IRubyObject arg0)
to_s in class RubyIntegerpublic IRubyObject coerce(IRubyObject other)
coerce in class RubyNumericpublic IRubyObject op_uminus(ThreadContext context)
op_uminus in class RubyIntegerpublic IRubyObject op_plus(ThreadContext context, IRubyObject other)
op_plus in class RubyIntegerpublic final IRubyObject op_plus(ThreadContext context, long other)
op_plus in class RubyIntegerpublic final IRubyObject op_plus(ThreadContext context, java.math.BigInteger other)
public IRubyObject op_minus(ThreadContext context, IRubyObject other)
op_minus in class RubyIntegerpublic final IRubyObject op_minus(ThreadContext context, long other)
op_minus in class RubyIntegerpublic final IRubyObject op_minus(ThreadContext context, java.math.BigInteger other)
public IRubyObject op_mul(ThreadContext context, IRubyObject other)
op_mul in class RubyInteger@Deprecated public final IRubyObject op_mul19(ThreadContext context, IRubyObject other)
public final IRubyObject op_mul(ThreadContext context, long other)
op_mul in class RubyIntegerpublic IRubyObject op_div(ThreadContext context, IRubyObject other)
op_div in class RubyIntegerpublic IRubyObject op_div(ThreadContext context, long other)
public IRubyObject idiv(ThreadContext context, IRubyObject other)
idiv in class RubyIntegerpublic IRubyObject idiv(ThreadContext context, long other)
idiv in class RubyNumericpublic IRubyObject divmod(ThreadContext context, IRubyObject other)
divmod in class RubyIntegerpublic IRubyObject op_mod(ThreadContext context, IRubyObject other)
op_mod in class RubyIntegerpublic IRubyObject op_mod(ThreadContext context, long other)
op_mod in class RubyIntegerpublic IRubyObject modulo(ThreadContext context, IRubyObject other)
RubyNumericmodulo in class RubyNumeric@Deprecated public IRubyObject op_mod19(ThreadContext context, IRubyObject other)
public IRubyObject remainder(ThreadContext context, IRubyObject other)
remainder in class RubyInteger@Deprecated public IRubyObject remainder19(ThreadContext context, IRubyObject other)
public IRubyObject quo(ThreadContext context, IRubyObject other)
quo in class RubyNumeric@Deprecated public final IRubyObject quo19(ThreadContext context, IRubyObject other)
public IRubyObject op_pow(ThreadContext context, IRubyObject other)
op_pow in class RubyIntegerpublic final IRubyObject op_pow(ThreadContext context, long other)
@Deprecated public IRubyObject op_pow19(ThreadContext context, IRubyObject other)
public IRubyObject op_and(ThreadContext context, IRubyObject other)
op_and in class RubyInteger@Deprecated public IRubyObject op_and19(ThreadContext context, IRubyObject other)
public IRubyObject op_or(ThreadContext context, IRubyObject other)
op_or in class RubyIntegerpublic IRubyObject bit_length(ThreadContext context)
bit_length in class RubyInteger@Deprecated public IRubyObject op_or19(ThreadContext context, IRubyObject other)
public IRubyObject op_xor(ThreadContext context, IRubyObject other)
op_xor in class RubyInteger@Deprecated public IRubyObject op_xor19(ThreadContext context, IRubyObject other)
public IRubyObject op_neg(ThreadContext context)
op_neg in class RubyIntegerpublic IRubyObject op_lshift(ThreadContext context, IRubyObject other)
op_lshift in class RubyIntegerpublic RubyInteger op_lshift(ThreadContext context, long shift)
op_lshift in class RubyIntegerpublic IRubyObject op_rshift(ThreadContext context, IRubyObject other)
op_rshift in class RubyIntegerpublic RubyInteger op_rshift(ThreadContext context, long shift)
op_rshift in class RubyIntegerpublic RubyBoolean odd_p(ThreadContext context)
odd_p in class RubyIntegerpublic RubyBoolean even_p(ThreadContext context)
even_p in class RubyIntegerpublic RubyFixnum op_aref(ThreadContext context, IRubyObject other)
op_aref in class RubyIntegerpublic final int compareTo(IRubyObject other)
RubyBasicObjectcompareTo in interface java.lang.Comparable<IRubyObject>compareTo in class RubyBasicObjectother - another IRubyObjectpublic boolean equals(java.lang.Object other)
RubyObjectequals in class RubyObjectRubyBasicObject.equals(Object)public IRubyObject op_cmp(ThreadContext context, IRubyObject other)
op_cmp in class RubyIntegerpublic IRubyObject op_equal(ThreadContext context, IRubyObject other)
op_equal in interface IRubyObjectop_equal in class RubyIntegerpublic IRubyObject eql_p(IRubyObject other)
eql_p in class RubyBasicObject@Deprecated public IRubyObject eql_p19(IRubyObject other)
public RubyFixnum hash()
hash in class RubyBasicObjectpublic int hashCode()
RubyObjecthashCode in class RubyObjectRubyBasicObject.hashCode()public IRubyObject to_f(ThreadContext context)
to_f in class RubyIntegerpublic IRubyObject to_f()
to_f in class RubyInteger@Deprecated public IRubyObject abs()
public IRubyObject abs(ThreadContext context)
abs in class RubyIntegerpublic IRubyObject size(ThreadContext context)
size in class RubyIntegerpublic IRubyObject zero_p(ThreadContext context)
RubyNumericzero_p in class RubyIntegerpublic final boolean isZero()
isZero in class RubyNumericpublic IRubyObject nonzero_p(ThreadContext context)
RubyNumericnonzero_p in class RubyNumericpublic static void marshalTo(RubyBignum bignum, MarshalStream output) throws java.io.IOException
java.io.IOExceptionpublic static RubyNumeric unmarshalFrom(UnmarshalStream input) throws java.io.IOException
java.io.IOExceptionpublic IRubyObject fdivDouble(ThreadContext context, IRubyObject y)
fdivDouble in class RubyIntegerpublic IRubyObject fdivInt(ThreadContext context, RubyBignum y)
public IRubyObject fdivFloat(ThreadContext context, RubyFloat y)
public IRubyObject isNegative(ThreadContext context)
RubyNumericisNegative in class RubyIntegerpublic IRubyObject isPositive(ThreadContext context)
RubyNumericisPositive in class RubyIntegerprotected boolean int_round_zero_p(ThreadContext context, int ndigits)
int_round_zero_p in class RubyIntegerpublic boolean isImmediate()
RubyBasicObjectisImmediate in interface IRubyObjectisImmediate in class RubyBasicObjectpublic IRubyObject numerator(ThreadContext context)
RubyNumericnumerator in class RubyIntegerpublic IRubyObject denominator(ThreadContext context)
RubyNumericdenominator in class RubyIntegerpublic RubyRational convertToRational()
convertToRational in class RubyNumericpublic IRubyObject sqrt(ThreadContext context)
sqrt in class RubyIntegerCopyright © 2001-2019 JRuby. All Rights Reserved.