Package org.jruby
Class RubyRational
java.lang.Object
org.jruby.RubyBasicObject
org.jruby.RubyObject
org.jruby.RubyNumeric
org.jruby.RubyRational
- All Implemented Interfaces:
Serializable,Cloneable,Comparable<IRubyObject>,InstanceVariables,InternalVariables,IRubyObject,CoreObjectType
Ruby Rational impl (MRI: rational.c).
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.jruby.RubyNumeric
RubyNumeric.InvalidIntegerException, RubyNumeric.NumberTooLargeExceptionNested classes/interfaces inherited from class org.jruby.RubyObject
RubyObject.DataNested classes/interfaces inherited from class org.jruby.RubyBasicObject
RubyBasicObject.Finalizer -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static booleannurat_canonicalizationprivate RubyIntegerprivate static final longprivate RubyIntegerprivate static final ObjectMarshalFields inherited from class org.jruby.RubyNumeric
DBL_EPSILONFields inherited from class org.jruby.RubyObject
IVAR_INSPECTING_OBJECT_ALLOCATOR, OBJECT_ALLOCATOR, REIFYING_OBJECT_ALLOCATORFields inherited from class org.jruby.RubyBasicObject
ALL_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, varTableStampFields inherited from interface org.jruby.runtime.builtin.IRubyObject
NULL_ARRAY -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateRubyRational(Ruby runtime, RubyClass clazz) privateRubyRational(Ruby runtime, RubyClass clazz, RubyInteger num, RubyInteger den) -
Method Summary
Modifier and TypeMethodDescriptionprivate static RubyNumericcanonicalizeInternal(ThreadContext context, RubyClass clazz, long num, long den) private static RubyNumericcanonicalizeInternal(ThreadContext context, RubyClass clazz, RubyInteger num, RubyInteger den) nurat_s_canonicalize_internalprivate static RubyNumericcanonicalizeInternalNoReduce(ThreadContext context, RubyClass clazz, RubyInteger num, RubyInteger den) nurat_s_canonicalize_internal_no_reduceprivate static booleancanonicalizeShouldNegate(ThreadContext context, RubyInteger den) ceil(ThreadContext context) MRI: nurat_ceil_nceil(ThreadContext context, IRubyObject n) static IRubyObjectconvert(ThreadContext context, IRubyObject recv, IRubyObject a1) nurat_s_convertstatic IRubyObjectconvert(ThreadContext context, IRubyObject clazz, IRubyObject[] args) Deprecated.static IRubyObjectconvert(ThreadContext context, IRubyObject recv, IRubyObject a1, IRubyObject a2) nurat_s_convertstatic IRubyObjectconvert(ThreadContext context, IRubyObject recv, IRubyObject a1, IRubyObject a2, IRubyObject kwargs) nurat_s_convertprivate static IRubyObjectconvertCommon(ThreadContext context, RubyClass clazz, IRubyObject a1, IRubyObject a2, boolean raise) Tries to convert this object to a Ruby Integer using the "to_int" method.static RubyClasscreateRationalClass(Ruby runtime) denominator(ThreadContext context) nurat_denominatorprivate IRubyObjectdoRound(ThreadContext context, RoundingMode mode) eql_p(ThreadContext context, IRubyObject other) num_eqlprivate static RubyNumericf_addsub(ThreadContext context, RubyClass metaClass, RubyInteger anum, RubyInteger aden, RubyInteger bnum, RubyInteger bden, boolean plus) f_addsubprivate static RubyIntegerf_imul(ThreadContext context, long a, long b) f_imulprivate static RubyNumericf_muldiv(ThreadContext context, RubyClass clazz, RubyInteger anum, RubyInteger aden, RubyInteger bnum, RubyInteger bden, boolean mult) f_muldivfdiv(ThreadContext context, IRubyObject other) nurat_fdivprivate RubyNumericfix_expt(ThreadContext context, RubyInteger other, int sign) floor(ThreadContext context) MRI: nurat_floor_nfloor(ThreadContext context, IRubyObject n) doubledoublegetDoubleValue(ThreadContext context) longReturn the value of this numeric as a 64-bit long.This is overridden in the other concrete Java builtins to provide a fast way to determine what type they are.hash(ThreadContext context) nurat_hashinthashCode()This override does not do "checked" dispatch since Object usually has #hash defined.idiv(ThreadContext context, IRubyObject other) MRI: rb_int_idiv and overridesinspect()rb_obj_inspect call-seq: obj.inspect => string Returns a string containing a human-readable representation of obj.inspect(ThreadContext context) nurat_inspectprivate RubyStringinspectImpl(Ruby runtime) private static RubyIntegerintCheck(ThreadContext context, IRubyObject num) nurat_int_checkprivate static CallSiteinteger_p(ThreadContext context) (package private) static IRubyObjectintValue(ThreadContext context, IRubyObject num, boolean raise) nurat_int_valuebooleanisNegative(ThreadContext context) num_negative_pbooleanisPositive(ThreadContext context) num_positive_pfinal booleanisZero()marshal_dump(ThreadContext context) nurat_marshal_dumpmarshal_load(ThreadContext context, IRubyObject arg) nurat_marshal_loadprivate IRubyObjectmriCeil(ThreadContext context) private IRubyObjectmriFloor(ThreadContext context) private RubyIntegermriTruncate(ThreadContext context) (package private) static RubyNumericnewInstance(ThreadContext context, RubyClass clazz, RubyInteger num, RubyInteger den) (package private) static IRubyObjectnewInstance(ThreadContext context, RubyClass clazz, IRubyObject num) (package private) static IRubyObjectnewInstance(ThreadContext context, RubyClass clazz, IRubyObject num, boolean raise) (package private) static IRubyObjectnewInstance(ThreadContext context, RubyClass clazz, IRubyObject num, IRubyObject den) (package private) static IRubyObjectnewInstance(ThreadContext context, RubyClass clazz, IRubyObject num, IRubyObject den, boolean raise) static RubyNumericnewInstance(ThreadContext context, RubyInteger num) static RubyNumericnewInstance(ThreadContext context, RubyInteger num, RubyInteger den) static IRubyObjectnewInstance(ThreadContext context, IRubyObject clazz, IRubyObject num) Deprecated.static IRubyObjectnewInstance(ThreadContext context, IRubyObject clazz, IRubyObject[] args) Deprecated.static IRubyObjectnewInstance(ThreadContext context, IRubyObject clazz, IRubyObject num, IRubyObject den) Deprecated.static RubyRationalnewRational(Ruby runtime, long x, long y) (package private) static RubyRationalnewRational(Ruby runtime, RubyClass clazz, IRubyObject x, IRubyObject y) private static RubyRationalnewRationalBang(ThreadContext context, RubyClass clazz, long x) private static RubyRationalnewRationalBang(ThreadContext context, RubyClass clazz, IRubyObject x) f_rational_new_bang1private static RubyRationalnewRationalBang(ThreadContext context, RubyClass clazz, IRubyObject x, IRubyObject y) f_rational_new_bang2static IRubyObjectnewRationalCanonicalize(ThreadContext context, long x) static IRubyObjectnewRationalCanonicalize(ThreadContext context, long x, long y) (package private) static RubyNumericnewRationalCanonicalize(ThreadContext context, RubyInteger x) rb_rational_new1static IRubyObjectnewRationalCanonicalize(ThreadContext context, RubyInteger x, RubyInteger y) rb_rational_newstatic IRubyObjectnewRationalCanonicalize(ThreadContext context, IRubyObject x, IRubyObject y) static IRubyObjectnewRationalConvert(ThreadContext context, IRubyObject x) rb_Rational1static IRubyObjectnewRationalConvert(ThreadContext context, IRubyObject x, IRubyObject y) rb_Rational/rb_Rational2private static RubyNumericnewRationalNoReduce(ThreadContext context, RubyClass clazz, RubyInteger x, RubyInteger y) f_rational_new_no_reduce2(package private) static RubyNumericnewRationalNoReduce(ThreadContext context, RubyInteger x, RubyInteger y) (package private) static RubyRationalnewRationalRaw(Ruby runtime, IRubyObject x) rb_rational_raw1static RubyRationalnewRationalRaw(Ruby runtime, IRubyObject x, IRubyObject y) rb_rational_rawnonzero_p(ThreadContext context) num_nonzero_pnumerator(ThreadContext context) nurat_numeratorstatic IRubyObjectnumericQuo(ThreadContext context, IRubyObject x, IRubyObject y) numeric_quoop_abs(ThreadContext context) nurat_absop_add(ThreadContext context, IRubyObject other) Deprecated.op_ceil(ThreadContext context) Deprecated.op_ceil(ThreadContext context, IRubyObject n) Deprecated.op_cmp(ThreadContext context, IRubyObject other) nurat_cmpop_coerce(ThreadContext context, IRubyObject other) nurat_coercefinal RubyNumericop_div(ThreadContext context, RubyInteger other) op_div(ThreadContext context, IRubyObject other) nurat_divop_divmod(ThreadContext context, IRubyObject other) nurat_divmodop_divmod19(ThreadContext context, IRubyObject other) Deprecated.final IRubyObjectop_equal(ThreadContext context, RubyInteger other) (package private) final RubyBooleanop_equal(ThreadContext context, RubyRational other) op_equal(ThreadContext context, IRubyObject other) nurat_equal_pfinal IRubyObjectop_expt(ThreadContext context, long other) op_expt(ThreadContext context, IRubyObject other) nurat_exptop_fdiv(ThreadContext context, IRubyObject other) Deprecated.op_floor(ThreadContext context) Deprecated.op_floor(ThreadContext context, IRubyObject n) Deprecated.op_idiv(ThreadContext context, IRubyObject other) Deprecated.op_idiv19(ThreadContext context, IRubyObject other) Deprecated.final RubyNumericop_minus(ThreadContext context, RubyRational other) op_minus(ThreadContext context, IRubyObject other) nurat_subop_mod(ThreadContext context, IRubyObject other) op_mod19(ThreadContext context, IRubyObject other) Deprecated.op_mul(ThreadContext context, RubyInteger other) op_mul(ThreadContext context, IRubyObject other) nurat_mulfinal RubyNumericop_plus(ThreadContext context, RubyRational other) op_plus(ThreadContext context, IRubyObject other) nurat_addop_rem(ThreadContext context, IRubyObject other) nurat_remop_sub(ThreadContext context, IRubyObject other) Deprecated.op_uminus(ThreadContext context) num_uminusprivate static IRubyObjectr_to_f(ThreadContext context, RubyRational r) static IRubyObjectrationalCanonicalize(ThreadContext context, IRubyObject x) rationalize(ThreadContext context, IRubyObject[] args) nurat_rationalizeround(ThreadContext context) MRI: num_roundround(ThreadContext context, IRubyObject n) round(ThreadContext context, IRubyObject n, IRubyObject opts) private IRubyObjectroundCommon(ThreadContext context, IRubyObject n, RoundingMode mode) private RubyIntegerroundHalfDown(ThreadContext context) private RubyIntegerroundHalfEven(ThreadContext context) private RubyIntegerroundHalfUp(ThreadContext context) static voidsetCanonicalization(boolean canonical) final intsignum()private static JavaSites.RationalSitessites(ThreadContext context) (package private) static IRubyObject[]str_to_r_internal(ThreadContext context, RubyString str) private static IRubyObjectstr_to_r_strict(ThreadContext context, RubyString str, boolean raise) to_f(ThreadContext context) nurat_to_fto_i(ThreadContext context) to_r(ThreadContext context) nurat_to_rto_s()rb_any_to_s call-seq: obj.to_s => string Returns a string representing obj.private RubyStringto_s(ThreadContext context) nurat_to_struncate(ThreadContext context) MRI: nurat_truncatetruncate(ThreadContext context, IRubyObject n) zero_p(ThreadContext context) num_zero_pMethods inherited from class org.jruby.RubyNumeric
abs, abs2, arg, asNumeric, callCoerced, callCoerced, callCoerced, callCoerced, ceil, checkInt, checkInt, coerce, coerceBin, coerceBin, coerceBit, coerceBit, coerceBody, coerceCmp, coerceCmp, coerceFailed, coerceRelOp, coerceRelOp, coerceRescue, compareWithZero, conjugate, createNumericClass, dbl_cmp, dbl2ival, dbl2num, div, div19, divmod, divmod19, doCoerce, dup, finite_p, fix2int, fix2int, fix2long, fixable, float2long, float2ulong, floatStep, floatStep, floatStepSize, floor, getCoerced, getIntValue, getRoundingMode, idiv, image, infinite_p, initialize_copy, int2fix, integer_p, intervalStepSize, isReal, magnitude, modulo, modulo, modulo19, negativeInt, negFixable, negFixable, newNumeric, num_imaginary, num2chr, num2dbl, num2dbl, num2fix, num2int, num2long, num2ulong, numFuncall, numFuncall, numRemainder, op_cmp, op_not, op_num_equal, op_uplus, polar, posFixable, posFixable, positiveInt, quo, quo_19, rbClone, rbClone, rbClone, rbClone, real, real_p, rect, remainder, round, scalar_p, singleton_method_added, step, str2fnum, str2fnum, str2fnum, str2fnum19, str2inum, str2inum, str2inum, to_c, to_int, toJava, truncateMethods inherited from class org.jruby.RubyObject
attachToObjectSpace, callInit, callInit, callInit, callInit, callInit, callInit, callInit, callInit, callInit, callInit, convertToType, createObjectClass, dig, dig1, dig2, eqlInternal, equalInternal, equals, inspect, op_eqq, puts, specificEval, toRubyString, toStringMethods inherited from class org.jruby.RubyBasicObject
addFinalizer, anyToString, asJavaString, asString, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callSuper, checkArrayType, checkCallMethod, checkCallMethod, checkFrozen, checkStringType, checkStringType19, compareTo, convertToArray, convertToFloat, convertToHash, convertToInteger, convertToInteger, convertToString, copyInstanceVariablesInto, copySpecialInstanceVariables, createBasicObjectClass, dataGetStruct, dataGetStructChecked, dataWrapStruct, decode, defaultToJava, display, ensureInstanceVariablesSettable, eql, eql_p, equal_p, equal_p19, evalUnder, extend, fastGetInstanceVariable, fastGetInternalVariable, fastHasInstanceVariable, fastHasInternalVariable, fastSetInstanceVariable, fastSetInternalVariable, freeze, frozen_p, getFFIHandle, getFlag, getInstanceEvalClass, getInstanceVariable, getInstanceVariableList, getInstanceVariableNameList, getInstanceVariables, getInternalVariable, getInternalVariables, getJavaClass, getMetaClass, getMetaClass, getNativeHandle, getNativeTypeIndex, getObjectId, getRuntime, getSingletonClass, getSingletonClassClone, getSingletonClassCloneAndAttach, getType, getVariable, getVariableCount, getVariableList, getVariableNameList, hash, hashyInspect, hasInstanceVariable, hasInstanceVariables, hasInternalVariable, hasVariables, id, infectBy, infectBy, infectBy, initialize, initialize19, 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, isSpecialObject, isTaint, isTrue, isUntrusted, kind_of_p, makeMetaClass, method, method_missing, method_missing19, method19, methods, methods, methods19, methodsImpl, 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, recacheBuiltinMethods, remove_instance_variable, removeFinalizers, removeInstanceVariable, removeInternalVariable, respond_to_p, 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, singleton_method_added, singleton_method_added19, singleton_method_removed, singleton_method_removed19, singleton_method_undefined, singleton_method_undefined19, singleton_methods, specificEval, specificEval, specificEval, specificEval, syncVariables, syncVariables, taint, taint, tainted, tainted_p, testFrozen, testFrozen, to_a, to_a, trust, type, type_deprecated, untaint, untrust, untrusted_p, validateInstanceVariable, validateInstanceVariable, validateInstanceVariable, variableTableContains, variableTableFastContains, variableTableFastFetch, variableTableFastStore, variableTableFetch, variableTableRemove, variableTableStore, variableTableSync, yieldUnder, yieldUnder
-
Field Details
-
num
-
den
-
canonicalization
private static boolean canonicalizationnurat_canonicalization -
ML
private static final long ML -
RATIONAL_MARSHAL
-
-
Constructor Details
-
RubyRational
-
RubyRational
-
-
Method Details
-
createRationalClass
-
newRationalRaw
rb_rational_raw -
newRationalRaw
rb_rational_raw1 -
newRationalCanonicalize
rb_rational_new1 -
newRationalCanonicalize
public static IRubyObject newRationalCanonicalize(ThreadContext context, RubyInteger x, RubyInteger y) rb_rational_new -
newRationalCanonicalize
public static IRubyObject newRationalCanonicalize(ThreadContext context, IRubyObject x, IRubyObject y) -
newRationalCanonicalize
-
newRationalCanonicalize
-
newRationalNoReduce
-
newRationalNoReduce
private static RubyNumeric newRationalNoReduce(ThreadContext context, RubyClass clazz, RubyInteger x, RubyInteger y) f_rational_new_no_reduce2 -
newRationalBang
private static RubyRational newRationalBang(ThreadContext context, RubyClass clazz, IRubyObject x, IRubyObject y) f_rational_new_bang2 -
newRationalBang
f_rational_new_bang1 -
newRationalBang
-
getNativeClassIndex
Description copied from class:RubyObjectThis is overridden in the other concrete Java builtins to provide a fast way to determine what type they are. Will generally return a value from org.jruby.runtime.ClassIndex- Specified by:
getNativeClassIndexin interfaceCoreObjectType- Overrides:
getNativeClassIndexin classRubyObject- See Also:
-
setCanonicalization
public static void setCanonicalization(boolean canonical) -
intCheck
nurat_int_check -
integer_p
-
intValue
nurat_int_value -
canonicalizeInternal
private static RubyNumeric canonicalizeInternal(ThreadContext context, RubyClass clazz, RubyInteger num, RubyInteger den) nurat_s_canonicalize_internal -
canonicalizeInternal
private static RubyNumeric canonicalizeInternal(ThreadContext context, RubyClass clazz, long num, long den) -
canonicalizeInternalNoReduce
private static RubyNumeric canonicalizeInternalNoReduce(ThreadContext context, RubyClass clazz, RubyInteger num, RubyInteger den) nurat_s_canonicalize_internal_no_reduce -
canonicalizeShouldNegate
-
newInstance
@Deprecated public static IRubyObject newInstance(ThreadContext context, IRubyObject clazz, IRubyObject[] args) Deprecated.nurat_s_new -
newInstance
@Deprecated public static IRubyObject newInstance(ThreadContext context, IRubyObject clazz, IRubyObject num) Deprecated. -
newInstance
-
newInstance
static IRubyObject newInstance(ThreadContext context, RubyClass clazz, IRubyObject num, boolean raise) -
newInstance
@Deprecated public static IRubyObject newInstance(ThreadContext context, IRubyObject clazz, IRubyObject num, IRubyObject den) Deprecated. -
newInstance
static IRubyObject newInstance(ThreadContext context, RubyClass clazz, IRubyObject num, IRubyObject den) -
newInstance
static IRubyObject newInstance(ThreadContext context, RubyClass clazz, IRubyObject num, IRubyObject den, boolean raise) -
newInstance
static RubyNumeric newInstance(ThreadContext context, RubyClass clazz, RubyInteger num, RubyInteger den) -
newInstance
-
newInstance
-
newRationalConvert
rb_Rational1 -
newRationalConvert
rb_Rational/rb_Rational2 -
newRational
-
newRational
-
rationalCanonicalize
-
convert
@Deprecated public static IRubyObject convert(ThreadContext context, IRubyObject clazz, IRubyObject[] args) Deprecated. -
convert
nurat_s_convert -
convert
public static IRubyObject convert(ThreadContext context, IRubyObject recv, IRubyObject a1, IRubyObject a2) nurat_s_convert -
convert
public static IRubyObject convert(ThreadContext context, IRubyObject recv, IRubyObject a1, IRubyObject a2, IRubyObject kwargs) nurat_s_convert -
convertCommon
private static IRubyObject convertCommon(ThreadContext context, RubyClass clazz, IRubyObject a1, IRubyObject a2, boolean raise) -
numerator
nurat_numerator- Overrides:
numeratorin classRubyNumeric
-
denominator
nurat_denominator- Overrides:
denominatorin classRubyNumeric
-
getNumerator
-
getDenominator
-
convertToRational
- Overrides:
convertToRationalin classRubyNumeric
-
zero_p
Description copied from class:RubyNumericnum_zero_p- Overrides:
zero_pin classRubyNumeric
-
isZero
public final boolean isZero()- Overrides:
isZeroin classRubyNumeric
-
nonzero_p
Description copied from class:RubyNumericnum_nonzero_p- Overrides:
nonzero_pin classRubyNumeric
-
isNegative
Description copied from class:RubyNumericnum_negative_p- Overrides:
isNegativein classRubyNumeric
-
isPositive
Description copied from class:RubyNumericnum_positive_p- Overrides:
isPositivein classRubyNumeric
-
isNegative
public boolean isNegative()- Overrides:
isNegativein classRubyNumeric
-
isPositive
public boolean isPositive()- Overrides:
isPositivein classRubyNumeric
-
signum
public final int signum() -
f_imul
f_imul -
f_addsub
private static RubyNumeric f_addsub(ThreadContext context, RubyClass metaClass, RubyInteger anum, RubyInteger aden, RubyInteger bnum, RubyInteger bden, boolean plus) f_addsub -
op_plus
nurat_add- Overrides:
op_plusin classRubyNumeric
-
op_plus
-
op_add
Deprecated. -
op_minus
nurat_sub- Overrides:
op_minusin classRubyNumeric
-
op_minus
-
op_sub
Deprecated. -
op_uminus
Description copied from class:RubyNumericnum_uminus- Overrides:
op_uminusin classRubyNumeric
-
f_muldiv
private static RubyNumeric f_muldiv(ThreadContext context, RubyClass clazz, RubyInteger anum, RubyInteger aden, RubyInteger bnum, RubyInteger bden, boolean mult) f_muldiv -
op_mul
nurat_mul -
op_mul
-
op_div
nurat_div -
op_div
-
fdiv
nurat_fdiv- Overrides:
fdivin classRubyNumeric
-
op_expt
nurat_expt -
op_expt
-
fix_expt
-
op_cmp
nurat_cmp- Overrides:
op_cmpin classRubyBasicObject
-
op_equal
nurat_equal_p- Specified by:
op_equalin interfaceIRubyObject- Overrides:
op_equalin classRubyBasicObject
-
op_equal
-
op_equal
-
eql_p
Description copied from class:RubyNumericnum_eql- Overrides:
eql_pin classRubyNumeric
-
op_coerce
nurat_coerce -
idiv
Description copied from class:RubyNumericMRI: rb_int_idiv and overrides- Overrides:
idivin classRubyNumeric
-
op_mod
-
op_mod19
Deprecated. -
op_divmod
nurat_divmod -
op_divmod19
Deprecated. -
op_rem
nurat_rem -
op_abs
nurat_abs -
floor
MRI: nurat_floor_n- Overrides:
floorin classRubyNumeric
-
floor
-
mriFloor
-
ceil
MRI: nurat_ceil_n- Overrides:
ceilin classRubyNumeric
-
ceil
-
mriCeil
-
convertToInteger
Description copied from class:RubyBasicObjectTries to convert this object to a Ruby Integer using the "to_int" method.- Specified by:
convertToIntegerin interfaceIRubyObject- Overrides:
convertToIntegerin classRubyBasicObject- Returns:
- an integer representation of this
-
to_i
-
getLongValue
public long getLongValue()Description copied from class:RubyNumericReturn the value of this numeric as a 64-bit long. If the value does not fit in 64 bits, it will be truncated.- Overrides:
getLongValuein classRubyNumeric
-
getBigIntegerValue
- Overrides:
getBigIntegerValuein classRubyNumeric
-
truncate
MRI: nurat_truncate- Overrides:
truncatein classRubyNumeric
-
truncate
-
mriTruncate
-
round
Description copied from class:RubyNumericMRI: num_round- Overrides:
roundin classRubyNumeric
-
round
-
round
-
roundCommon
-
doRound
-
roundHalfDown
-
roundHalfEven
-
roundHalfUp
-
to_f
nurat_to_f -
getDoubleValue
public double getDoubleValue()- Overrides:
getDoubleValuein classRubyNumeric
-
getDoubleValue
-
to_r
nurat_to_r -
rationalize
nurat_rationalize -
hash
nurat_hash -
hashCode
public int hashCode()Description copied from class:RubyObjectThis override does not do "checked" dispatch since Object usually has #hash defined.- Overrides:
hashCodein classRubyObject- See Also:
-
to_s
Description copied from class:RubyBasicObjectrb_any_to_s call-seq: obj.to_s => string Returns a string representing obj. The defaultto_sprints 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.''- Overrides:
to_sin classRubyBasicObject
-
to_s
nurat_to_s -
to_s
-
inspect
Description copied from class:RubyBasicObjectrb_obj_inspect call-seq: obj.inspect => string Returns a string containing a human-readable representation of obj. If not overridden, uses theto_smethod to generate the string. [ 1, 2, 3..4, 'five' ].inspect #=> "[1, 2, 3..4, \"five\"]" Time.new.inspect #=> "Wed Apr 09 08:54:39 CDT 2003"- Specified by:
inspectin interfaceIRubyObject- Overrides:
inspectin classRubyBasicObject- Returns:
- String
-
inspect
nurat_inspect -
inspectImpl
-
marshal_dump
nurat_marshal_dump -
marshal_load
nurat_marshal_load -
str_to_r_internal
-
str_to_r_strict
-
numericQuo
numeric_quo -
op_floor
Deprecated. -
op_floor
Deprecated. -
op_ceil
Deprecated. -
op_ceil
Deprecated. -
op_idiv19
Deprecated. -
op_idiv
Deprecated. -
op_fdiv
Deprecated. -
sites
-
r_to_f
-