public class RubyBignum extends RubyInteger
RubyNumeric.InvalidIntegerException, RubyNumeric.NumberTooLargeExceptionRubyObject.DataRubyBasicObject.Finalizer| Modifier and Type | Field and Description |
|---|---|
static BigInteger |
LONG_MAX |
static BigInteger |
LONG_MIN |
static BigInteger |
ULONG_MAX |
SINGLE_CHAR_BYTELISTS19DBL_EPSILON, NUMERIC_ALLOCATORFIELD_ALLOCATED_CLASSES, FIELD_ALLOCATORS, IVAR_INSPECTING_OBJECT_ALLOCATOR, OBJECT_ALLOCATOR, OBJECT_VAR0_ALLOCATOR, OBJECT_VAR1_ALLOCATOR, OBJECT_VAR2_ALLOCATOR, OBJECT_VAR3_ALLOCATOR, OBJECT_VAR4_ALLOCATOR, OBJECT_VAR5_ALLOCATOR, OBJECT_VAR6_ALLOCATOR, OBJECT_VAR7_ALLOCATOR, OBJECT_VAR8_ALLOCATOR, OBJECT_VAR9_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,
BigInteger value) |
| Modifier and Type | Method and Description |
|---|---|
IRubyObject |
abs()
rb_big_abs
|
static double |
big2dbl(RubyBignum value)
rb_big2dbl
|
static long |
big2long(RubyBignum value)
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,
BigInteger bi)
rb_big_norm
|
IRubyObject |
coerce(IRubyObject other)
rb_big_coerce
|
int |
compareTo(IRubyObject other)
Compares this Ruby object with another.
|
static RubyClass |
createBignumClass(Ruby runtime) |
IRubyObject |
divmod(ThreadContext context,
IRubyObject other)
rb_big_divmod
|
IRubyObject |
divmod19(ThreadContext context,
IRubyObject other)
num_divmod
|
IRubyObject |
eql_p(IRubyObject other)
rb_big_eql
|
IRubyObject |
eql_p19(IRubyObject other)
In ruby 1.9, '==' and '===' are the same, but they differ from 'eql?'.
|
static BigInteger |
fix2big(RubyFixnum arg)
rb_int2big
|
BigInteger |
getBigIntegerValue() |
double |
getDoubleValue() |
int |
getIntValue()
Return the value of this numeric as a 32-bit long.
|
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.
|
BigInteger |
getValue()
Getter for property value.
|
RubyFixnum |
hash()
rb_big_hash
|
static BigInteger |
long2big(long arg) |
static void |
marshalTo(RubyBignum bignum,
MarshalStream output) |
static RubyBignum |
newBignum(Ruby runtime,
BigInteger value) |
static RubyBignum |
newBignum(Ruby runtime,
double value) |
static RubyBignum |
newBignum(Ruby runtime,
long value) |
static RubyBignum |
newBignum(Ruby runtime,
String value) |
IRubyObject |
op_and(ThreadContext context,
IRubyObject other)
rb_big_and
|
IRubyObject |
op_and19(ThreadContext context,
IRubyObject other) |
RubyFixnum |
op_aref(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_equal(IRubyObject other)
rb_big_eq
|
IRubyObject |
op_idiv(ThreadContext context,
IRubyObject other)
rb_big_idiv
|
IRubyObject |
op_lshift(IRubyObject other)
rb_big_lshift
|
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_mod19(ThreadContext context,
IRubyObject other)
rb_big_modulo
|
IRubyObject |
op_mul(ThreadContext context,
IRubyObject other)
rb_big_mul
|
IRubyObject |
op_mul(ThreadContext context,
long other) |
IRubyObject |
op_mul19(ThreadContext context,
IRubyObject other) |
IRubyObject |
op_neg()
rb_big_neg
|
IRubyObject |
op_or(ThreadContext context,
IRubyObject other)
rb_big_or
|
IRubyObject |
op_or19(ThreadContext context,
IRubyObject 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)
rb_big_pow
|
IRubyObject |
op_rshift(IRubyObject other)
rb_big_rshift
|
IRubyObject |
op_uminus()
rb_big_uminus
|
IRubyObject |
op_xor(ThreadContext context,
IRubyObject other)
rb_big_xor
|
IRubyObject |
op_xor19(ThreadContext context,
IRubyObject other) |
IRubyObject |
opMulOther(ThreadContext context,
IRubyObject other) |
IRubyObject |
quo(ThreadContext context,
IRubyObject other)
rb_big_quo
|
IRubyObject |
quo19(ThreadContext context,
IRubyObject other) |
IRubyObject |
remainder(ThreadContext context,
IRubyObject other)
rb_big_remainder
|
IRubyObject |
remainder19(ThreadContext context,
IRubyObject other) |
IRubyObject |
size()
rb_big_size
|
IRubyObject |
to_f()
rb_big_to_f
|
IRubyObject |
to_s()
rb_any_to_s
call-seq:
obj.to_s => string
Returns a string representing obj.
|
IRubyObject |
to_s(IRubyObject arg0) |
IRubyObject |
to_s(IRubyObject[] args)
rb_big_to_s
|
static RubyNumeric |
unmarshalFrom(UnmarshalStream input) |
chr, chr19, chr19, convertToInteger, createIntegerClass, denominator, downto, even_p, gcd, gcdlcm, induced_from, integer_p, lcm, numerator, odd_p, ord, pred, rationalize, round, round19, round19, succ, times, timesSizeFn, to_i, to_r, toFloat, uptoabs, abs2, arg, asNumeric, callCoerced, callCoerced, ceil, checkInt, coerceBin, coerceBit, coerceBody, coerceCmp, coerceFailed, coerceRelOp, coerceRescue, conjugate, createNumericClass, dbl_cmp, dbl2num, div, div19, doCoerce, eql_p, fdiv, fix2int, fix2int, fix2long, floatStep, floatStepSize, floor, getCoerced, image, initialize_copy, int2fix, intervalStepSize, magnitude, modulo, modulo19, newNumeric, nonzero_p, num_imaginary, num2chr, num2dbl, num2fix, num2int, num2long, op_cmp, op_num_equal, op_uminus, op_uplus, polar, quo_19, real, rect, sadded, scalar_p, step, str2fnum, str2fnum, str2fnum19, str2inum, str2inum, to_c, to_int, toJava, truncate, zero_pattachToObjectSpace, callInit, callInit, callInit, callInit, callInit, callInit, callInit, callInit, callInit, callInit, convertToType, createObjectClass, eqlInternal, equalInternal, equals, hashCode, initialize, initialize, inspect, op_eqq, puts, specificEval, toStringaddFinalizer, anyToString, asJavaString, asString, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callSuper, checkArrayType, checkCallMethod, checkFrozen, checkStringType, checkStringType19, convertToArray, convertToFloat, convertToHash, convertToInteger, convertToInteger, convertToString, copyInstanceVariablesInto, copySpecialInstanceVariables, createBasicObjectClass, dataGetStruct, dataGetStructChecked, dataWrapStruct, display, dup, 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, getNativeHandle, getNativeTypeIndex, getObjectId, getRuntime, getSingletonClassClone, getType, getVariable, getVariableCount, getVariableList, getVariableNameList, hashyInspect, hasInstanceVariable, hasInternalVariable, hasVariables, id, infectBy, 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, isImmediate, isModule, isNil, isSpecialConst, isTaint, isTrue, isUntrusted, kind_of_p, makeMetaClass, method_missing19, method, method19, methods, methods, methods19, nil_p, OBJ_INIT_COPY, objInitCopy, op_equal_19, op_equal, op_match, op_match19, op_not_equal, op_not_match, op_not, private_methods, private_methods19, protected_methods, protected_methods19, public_methods, public_methods19, rbClone, 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_added19, singleton_method_removed19, singleton_method_undefined19, 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, variableTableContains, variableTableFastContains, variableTableFastFetch, variableTableFastStore, variableTableFetch, variableTableRemove, variableTableStore, variableTableSync, yieldUnder, yieldUnderpublic static final BigInteger LONG_MAX
public static final BigInteger LONG_MIN
public static final BigInteger ULONG_MAX
public RubyBignum(Ruby runtime, BigInteger value)
public ClassIndex getNativeClassIndex()
RubyObjectgetNativeClassIndex in interface CoreObjectTypegetNativeClassIndex in class RubyObjectClassIndexpublic 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 RubyBignum newBignum(Ruby runtime, BigInteger value)
public static RubyBignum newBignum(Ruby runtime, String value)
public double getDoubleValue()
getDoubleValue in class RubyNumericpublic long getLongValue()
RubyNumericgetLongValue in class RubyNumericpublic int getIntValue()
RubyNumericgetIntValue in class RubyNumericpublic BigInteger getBigIntegerValue()
getBigIntegerValue in class RubyNumericpublic RubyClass getSingletonClass()
RubyBasicObjectgetSingletonClass in interface IRubyObjectgetSingletonClass in class RubyBasicObjectpublic BigInteger getValue()
public static RubyInteger bignorm(Ruby runtime, BigInteger bi)
public static long big2long(RubyBignum value)
public static long big2ulong(RubyBignum value)
public static double big2dbl(RubyBignum value)
public static BigInteger fix2big(RubyFixnum arg)
public static BigInteger long2big(long arg)
public IRubyObject to_s(IRubyObject[] args)
public IRubyObject 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 RubyBasicObjectpublic IRubyObject to_s(IRubyObject arg0)
public IRubyObject coerce(IRubyObject other)
coerce in class RubyNumericpublic IRubyObject op_uminus()
public IRubyObject op_plus(ThreadContext context, IRubyObject other)
public IRubyObject op_plus(ThreadContext context, long other)
public IRubyObject op_minus(ThreadContext context, IRubyObject other)
public IRubyObject op_minus(ThreadContext context, long other)
public IRubyObject op_mul(ThreadContext context, IRubyObject other)
public IRubyObject op_mul19(ThreadContext context, IRubyObject other)
public IRubyObject op_mul(ThreadContext context, long other)
public IRubyObject opMulOther(ThreadContext context, IRubyObject other)
public IRubyObject op_div(ThreadContext context, IRubyObject other)
public IRubyObject op_idiv(ThreadContext context, IRubyObject other)
public IRubyObject divmod(ThreadContext context, IRubyObject other)
divmod in class RubyNumericpublic IRubyObject divmod19(ThreadContext context, IRubyObject other)
RubyNumericdivmod19 in class RubyNumericpublic IRubyObject op_mod(ThreadContext context, IRubyObject other)
public IRubyObject op_mod19(ThreadContext context, IRubyObject other)
public IRubyObject remainder(ThreadContext context, IRubyObject other)
remainder in class RubyNumericpublic IRubyObject remainder19(ThreadContext context, IRubyObject other)
public IRubyObject quo(ThreadContext context, IRubyObject other)
quo in class RubyNumericpublic IRubyObject quo19(ThreadContext context, IRubyObject other)
public IRubyObject op_pow(ThreadContext context, IRubyObject other)
public IRubyObject op_pow(ThreadContext context, long other)
public IRubyObject op_pow19(ThreadContext context, IRubyObject other)
public IRubyObject op_and(ThreadContext context, IRubyObject other)
public IRubyObject op_and19(ThreadContext context, IRubyObject other)
public IRubyObject op_or(ThreadContext context, IRubyObject other)
public IRubyObject op_or19(ThreadContext context, IRubyObject other)
public IRubyObject op_xor(ThreadContext context, IRubyObject other)
public IRubyObject op_xor19(ThreadContext context, IRubyObject other)
public IRubyObject op_neg()
public IRubyObject op_lshift(IRubyObject other)
public IRubyObject op_rshift(IRubyObject other)
public RubyFixnum op_aref(IRubyObject other)
public final int compareTo(IRubyObject other)
RubyBasicObjectcompareTo in interface Comparable<IRubyObject>compareTo in class RubyBasicObjectother - another IRubyObjectpublic IRubyObject op_cmp(ThreadContext context, IRubyObject other)
op_cmp in class RubyBasicObjectpublic IRubyObject op_equal(IRubyObject other)
public IRubyObject eql_p(IRubyObject other)
eql_p in class RubyBasicObjectpublic IRubyObject eql_p19(IRubyObject other)
public RubyFixnum hash()
hash in class RubyBasicObjectpublic IRubyObject to_f()
public IRubyObject abs()
public IRubyObject size()
public static void marshalTo(RubyBignum bignum, MarshalStream output) throws IOException
IOExceptionpublic static RubyNumeric unmarshalFrom(UnmarshalStream input) throws IOException
IOExceptionCopyright © 2001-2015 JRuby. All Rights Reserved.