public class RubyBignum extends RubyInteger
RubyNumeric.InvalidIntegerException, RubyNumeric.NumberTooLargeException
RubyObject.Data
RubyBasicObject.Finalizer
Modifier and Type | Field and Description |
---|---|
static BigInteger |
LONG_MAX |
static BigInteger |
LONG_MIN |
static BigInteger |
ULONG_MAX |
DBL_EPSILON, NUMERIC_ALLOCATOR
FIELD_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_ALLOCATOR
ALL_F, BASICOBJECT_ALLOCATOR, COMPARE_BY_IDENTITY_F, ERR_INSECURE_SET_INST_VAR, FALSE_F, FL_USHIFT, flags, FROZEN_F, metaClass, NEVER, NIL_F, STAMP_OFFSET, TAINTED_F, UNDEF, UNTRUSTED_F, USER0_F, USER1_F, USER2_F, USER3_F, USER4_F, USER5_F, USER6_F, USER7_F, USER8_F, VAR_TABLE_OFFSET, varTable, varTableStamp
NULL_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() |
Class<?> |
getJavaClass()
Will return the Java interface that most closely can represent
this object, when working through JAva integration
translations.
|
long |
getLongValue() |
int |
getNativeTypeIndex()
This is overridden in the other concrete Java builtins to provide a fast way
to determine what type they are.
|
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, to_i, to_r, toFloat, upto
abs, abs2, arg, asNumeric, callCoerced, callCoerced, ceil, checkInt, coerceBin, coerceBody, coerceCmp, coerceRelOp, conjugate, createNumericClass, dbl_cmp, dbl2num, div, div19, doCoerce, eql_p, fdiv, fix2int, fix2int, fix2long, floatStep, floor, getCoerced, image, initialize_copy, int2fix, 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, step, str2fnum, str2fnum, str2fnum19, str2inum, str2inum, to_c, to_int, toJava, truncate, zero_p
attachToObjectSpace, callInit, callInit, callInit, callInit, callInit, callInit, callInit, callInit, callInit, callInit, convertToType, createObjectClass, eqlInternal, equalInternal, equals, hashCode, initialize, initialize, inspect, op_eqq, puts, specificEval, toString
addFinalizer, 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, getObjectId, getRuntime, getSingletonClass, getSingletonClassClone, getType, getVariable, getVariableCount, getVariableList, getVariableNameList, hashyInspect, hasInstanceVariable, hasInternalVariable, hasVariables, id_deprecated, 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, isTaint, isTrue, isUntrusted, kind_of_p, makeMetaClass, method_missing19, method, method19, methods, methods, methods19, nil_p, 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, 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, singleton_methods19, 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, yieldUnder
public static final BigInteger LONG_MAX
public static final BigInteger LONG_MIN
public static final BigInteger ULONG_MAX
public RubyBignum(Ruby runtime, BigInteger value)
public int getNativeTypeIndex()
RubyObject
getNativeTypeIndex
in interface CoreObjectType
getNativeTypeIndex
in class RubyObject
ClassIndex
public Class<?> getJavaClass()
RubyBasicObject
getJavaClass
in interface IRubyObject
getJavaClass
in class RubyBasicObject
public 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 RubyNumeric
public long getLongValue()
getLongValue
in class RubyNumeric
public BigInteger getBigIntegerValue()
getBigIntegerValue
in class RubyNumeric
public 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()
RubyBasicObject
to_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 RubyBasicObject
public IRubyObject to_s(IRubyObject arg0)
public IRubyObject coerce(IRubyObject other)
coerce
in class RubyNumeric
public 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 RubyNumeric
public IRubyObject divmod19(ThreadContext context, IRubyObject other)
RubyNumeric
divmod19
in class RubyNumeric
public 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 RubyNumeric
public IRubyObject remainder19(ThreadContext context, IRubyObject other)
public IRubyObject quo(ThreadContext context, IRubyObject other)
quo
in class RubyNumeric
public 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)
RubyBasicObject
compareTo
in interface Comparable<IRubyObject>
compareTo
in class RubyBasicObject
other
- another IRubyObjectpublic IRubyObject op_cmp(ThreadContext context, IRubyObject other)
op_cmp
in class RubyBasicObject
public IRubyObject op_equal(IRubyObject other)
public IRubyObject eql_p(IRubyObject other)
eql_p
in class RubyBasicObject
public IRubyObject eql_p19(IRubyObject other)
public RubyFixnum hash()
hash
in class RubyBasicObject
public IRubyObject to_f()
public IRubyObject abs()
public IRubyObject size()
public static void marshalTo(RubyBignum bignum, MarshalStream output) throws IOException
IOException
public static RubyNumeric unmarshalFrom(UnmarshalStream input) throws IOException
IOException
Copyright © 2001-2015 JRuby. All Rights Reserved.