org.jruby
Class RubyRational
java.lang.Object
org.jruby.RubyBasicObject
org.jruby.RubyObject
org.jruby.RubyNumeric
org.jruby.RubyRational
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Cloneable, java.lang.Comparable<IRubyObject>, InstanceVariables, InternalVariables, IRubyObject, CoreObjectType
public class RubyRational
- extends RubyNumeric
1.9 rational.c as of revision: 20011
- See Also:
- Serialized Form
Fields 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, metaClass, NEVER, NIL_F, TAINTED_F, UNDEF, UNTRUSTED_F, USER0_F, USER1_F, USER2_F, USER3_F, USER4_F, USER5_F, USER6_F, USER7_F, USER8_F |
Method Summary |
static IRubyObject |
convert(ThreadContext context,
IRubyObject recv,
IRubyObject a1)
nurat_s_convert |
static IRubyObject |
convert(ThreadContext context,
IRubyObject clazz,
IRubyObject[] args)
Deprecated. |
static IRubyObject |
convert(ThreadContext context,
IRubyObject recv,
IRubyObject a1,
IRubyObject a2)
nurat_s_convert |
static RubyClass |
createRationalClass(Ruby runtime)
|
IRubyObject |
denominator(ThreadContext context)
nurat_denominator |
IRubyObject |
hash(ThreadContext context)
nurat_hash |
IRubyObject |
inspect(ThreadContext context)
nurat_inspect |
IRubyObject |
marshal_dump(ThreadContext context)
nurat_marshal_dump |
IRubyObject |
marshal_load(ThreadContext context,
IRubyObject arg)
nurat_marshal_load |
static IRubyObject |
newInstance(ThreadContext context,
IRubyObject clazz,
IRubyObject num)
|
static IRubyObject |
newInstance(ThreadContext context,
IRubyObject clazz,
IRubyObject[] args)
Deprecated. |
static IRubyObject |
newInstance(ThreadContext context,
IRubyObject clazz,
IRubyObject num,
IRubyObject den)
|
static IRubyObject |
newInstanceBang(ThreadContext context,
IRubyObject recv,
IRubyObject num)
|
static IRubyObject |
newInstanceBang(ThreadContext context,
IRubyObject recv,
IRubyObject[] args)
Deprecated. |
static IRubyObject |
newInstanceBang(ThreadContext context,
IRubyObject recv,
IRubyObject num,
IRubyObject den)
|
static IRubyObject |
newRationalConvert(ThreadContext context,
IRubyObject x)
rb_Rational1 |
static IRubyObject |
newRationalConvert(ThreadContext context,
IRubyObject x,
IRubyObject y)
rb_Rational/rb_Rational2 |
IRubyObject |
numerator(ThreadContext context)
nurat_numerator |
IRubyObject |
op_abs(ThreadContext context)
nurat_abs |
IRubyObject |
op_add(ThreadContext context,
IRubyObject other)
nurat_add |
IRubyObject |
op_ceil(ThreadContext context)
nurat_ceil |
IRubyObject |
op_ceil(ThreadContext context,
IRubyObject n)
|
IRubyObject |
op_cmp(ThreadContext context,
IRubyObject other)
nurat_cmp |
IRubyObject |
op_coerce(ThreadContext context,
IRubyObject other)
nurat_coerce |
IRubyObject |
op_div(ThreadContext context,
IRubyObject other)
nurat_div |
IRubyObject |
op_divmod(ThreadContext context,
IRubyObject other)
nurat_divmod |
IRubyObject |
op_divmod19(ThreadContext context,
IRubyObject other)
|
IRubyObject |
op_equal(ThreadContext context,
IRubyObject other)
nurat_equal_p |
IRubyObject |
op_expt(ThreadContext context,
IRubyObject other)
nurat_expt |
IRubyObject |
op_fdiv(ThreadContext context,
IRubyObject other)
nurat_fdiv |
IRubyObject |
op_floor(ThreadContext context)
nurat_floor |
IRubyObject |
op_floor(ThreadContext context,
IRubyObject n)
|
IRubyObject |
op_idiv(ThreadContext context,
IRubyObject other)
nurat_idiv |
IRubyObject |
op_idiv19(ThreadContext context,
IRubyObject other)
|
IRubyObject |
op_mod(ThreadContext context,
IRubyObject other)
nurat_mod |
IRubyObject |
op_mod19(ThreadContext context,
IRubyObject other)
|
IRubyObject |
op_mul(ThreadContext context,
IRubyObject other)
nurat_mul |
IRubyObject |
op_rem(ThreadContext context,
IRubyObject other)
nurat_rem |
IRubyObject |
op_round(ThreadContext context)
nurat_round |
IRubyObject |
op_round(ThreadContext context,
IRubyObject n)
|
IRubyObject |
op_sub(ThreadContext context,
IRubyObject other)
nurat_sub |
IRubyObject |
op_truncate(ThreadContext context)
nurat_truncate |
IRubyObject |
op_truncate(ThreadContext context,
IRubyObject n)
|
IRubyObject |
rationalize(ThreadContext context,
IRubyObject[] args)
nurat_rationalize |
static void |
setCanonicalization(boolean canonical)
|
IRubyObject |
to_f(ThreadContext context)
|
IRubyObject |
to_r(ThreadContext context)
nurat_to_r |
IRubyObject |
to_s(ThreadContext context)
nurat_to_s |
Methods inherited from class org.jruby.RubyNumeric |
abs, abs2, arg, asNumeric, callCoerced, callCoerced, ceil, checkInt, coerce, coerceBin, coerceBody, coerceCmp, coerceRelOp, conjugate, createNumericClass, dbl_cmp, dbl2num, div, div19, divmod, divmod19, doCoerce, eql_p, fdiv, fix2int, fix2int, fix2long, floatStep, floor, getBigIntegerValue, getCoerced, getDoubleValue, getLongValue, image, initialize_copy, int2fix, integer_p, 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, quo, real, rect, remainder, round, sadded, scalar_p, step, step, str2fnum, str2fnum, str2fnum19, str2inum, str2inum, to_c, to_int, toJava, truncate, zero_p |
Methods inherited from class org.jruby.RubyObject |
attachToObjectSpace, callInit, callInit, callInit, callInit, callInit, convertToType, createObjectClass, eqlInternal, equalInternal, equals, getNativeTypeIndex, hashCode, initialize, op_eqq, puts, specificEval, toString |
Methods inherited from class org.jruby.RubyBasicObject |
addFinalizer, anyToString, asJavaString, asString, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callSuper, checkArrayType, checkCallMethod, checkFrozen, checkStringType, checkStringType19, compareTo, convertToArray, convertToFloat, convertToHash, convertToInteger, convertToInteger, convertToInteger, convertToString, copyInstanceVariablesInto, copySpecialInstanceVariables, createBasicObjectClass, dataGetStruct, dataGetStructChecked, dataWrapStruct, display, dup, ensureInstanceVariablesSettable, eql_p, eql, equal_p, equal_p19, evalUnder, extend, fastGetInstanceVariable, fastGetInternalVariable, fastHasInstanceVariable, fastHasInternalVariable, fastSetInstanceVariable, fastSetInternalVariable, freeze, frozen_p, getFlag, getInstanceEvalClass, getInstanceVariable, getInstanceVariableList, getInstanceVariableNameList, getInstanceVariables, getInternalVariable, getInternalVariables, getJavaClass, getMetaClass, getObjectId, getRuntime, getSingletonClass, getSingletonClassClone, getType, getVariable, getVariableCount, getVariableList, getVariableNameList, hash, hashyInspect, hasInstanceVariable, hasInternalVariable, hasVariables, id_deprecated, id, infectBy, initialize19, initialize19, initialize19, initialize19, initialize19, initObjectId, 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_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, send19, setFlag, setFrozen, setInstanceVariable, setInternalVariable, setMetaClass, 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, to_s, trust, type_deprecated, type, untaint, untrust, untrusted_p, validateInstanceVariable, variableTableContains, variableTableFastContains, variableTableFastFetch, variableTableFastStore, variableTableFetch, variableTableRemove, variableTableStore, variableTableSync, yieldUnder, yieldUnder |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
createRationalClass
public static RubyClass createRationalClass(Ruby runtime)
newInstanceBang
@Deprecated
public static IRubyObject newInstanceBang(ThreadContext context,
IRubyObject recv,
IRubyObject[] args)
- Deprecated.
- nurat_s_new_bang
newInstanceBang
public static IRubyObject newInstanceBang(ThreadContext context,
IRubyObject recv,
IRubyObject num)
newInstanceBang
public static IRubyObject newInstanceBang(ThreadContext context,
IRubyObject recv,
IRubyObject num,
IRubyObject den)
setCanonicalization
public static void setCanonicalization(boolean canonical)
newInstance
@Deprecated
public static IRubyObject newInstance(ThreadContext context,
IRubyObject clazz,
IRubyObject[] args)
- Deprecated.
- nurat_s_new
newInstance
public static IRubyObject newInstance(ThreadContext context,
IRubyObject clazz,
IRubyObject num)
newInstance
public static IRubyObject newInstance(ThreadContext context,
IRubyObject clazz,
IRubyObject num,
IRubyObject den)
newRationalConvert
public static IRubyObject newRationalConvert(ThreadContext context,
IRubyObject x)
- rb_Rational1
newRationalConvert
public static IRubyObject newRationalConvert(ThreadContext context,
IRubyObject x,
IRubyObject y)
- rb_Rational/rb_Rational2
convert
@Deprecated
public static IRubyObject convert(ThreadContext context,
IRubyObject clazz,
IRubyObject[] args)
- Deprecated.
convert
public static IRubyObject convert(ThreadContext context,
IRubyObject recv,
IRubyObject a1)
- nurat_s_convert
convert
public static IRubyObject convert(ThreadContext context,
IRubyObject recv,
IRubyObject a1,
IRubyObject a2)
- nurat_s_convert
numerator
public IRubyObject numerator(ThreadContext context)
- nurat_numerator
- Overrides:
numerator
in class RubyNumeric
denominator
public IRubyObject denominator(ThreadContext context)
- nurat_denominator
- Overrides:
denominator
in class RubyNumeric
op_add
public IRubyObject op_add(ThreadContext context,
IRubyObject other)
- nurat_add
op_sub
public IRubyObject op_sub(ThreadContext context,
IRubyObject other)
- nurat_sub
op_mul
public IRubyObject op_mul(ThreadContext context,
IRubyObject other)
- nurat_mul
op_div
public IRubyObject op_div(ThreadContext context,
IRubyObject other)
- nurat_div
op_fdiv
public IRubyObject op_fdiv(ThreadContext context,
IRubyObject other)
- nurat_fdiv
op_expt
public IRubyObject op_expt(ThreadContext context,
IRubyObject other)
- nurat_expt
op_cmp
public IRubyObject op_cmp(ThreadContext context,
IRubyObject other)
- nurat_cmp
- Overrides:
op_cmp
in class RubyBasicObject
op_equal
public IRubyObject op_equal(ThreadContext context,
IRubyObject other)
- nurat_equal_p
- Specified by:
op_equal
in interface IRubyObject
- Overrides:
op_equal
in class RubyBasicObject
op_coerce
public IRubyObject op_coerce(ThreadContext context,
IRubyObject other)
- nurat_coerce
op_idiv
public IRubyObject op_idiv(ThreadContext context,
IRubyObject other)
- nurat_idiv
op_idiv19
public IRubyObject op_idiv19(ThreadContext context,
IRubyObject other)
op_mod
public IRubyObject op_mod(ThreadContext context,
IRubyObject other)
- nurat_mod
op_mod19
public IRubyObject op_mod19(ThreadContext context,
IRubyObject other)
op_divmod
public IRubyObject op_divmod(ThreadContext context,
IRubyObject other)
- nurat_divmod
op_divmod19
public IRubyObject op_divmod19(ThreadContext context,
IRubyObject other)
op_rem
public IRubyObject op_rem(ThreadContext context,
IRubyObject other)
- nurat_rem
op_abs
public IRubyObject op_abs(ThreadContext context)
- nurat_abs
op_floor
public IRubyObject op_floor(ThreadContext context)
- nurat_floor
op_floor
public IRubyObject op_floor(ThreadContext context,
IRubyObject n)
op_ceil
public IRubyObject op_ceil(ThreadContext context)
- nurat_ceil
op_ceil
public IRubyObject op_ceil(ThreadContext context,
IRubyObject n)
op_truncate
public IRubyObject op_truncate(ThreadContext context)
- nurat_truncate
op_truncate
public IRubyObject op_truncate(ThreadContext context,
IRubyObject n)
op_round
public IRubyObject op_round(ThreadContext context)
- nurat_round
op_round
public IRubyObject op_round(ThreadContext context,
IRubyObject n)
to_f
public IRubyObject to_f(ThreadContext context)
to_r
public IRubyObject to_r(ThreadContext context)
- nurat_to_r
rationalize
public IRubyObject rationalize(ThreadContext context,
IRubyObject[] args)
- nurat_rationalize
hash
public IRubyObject hash(ThreadContext context)
- nurat_hash
to_s
public IRubyObject to_s(ThreadContext context)
- nurat_to_s
inspect
public IRubyObject inspect(ThreadContext context)
- nurat_inspect
marshal_dump
public IRubyObject marshal_dump(ThreadContext context)
- nurat_marshal_dump
marshal_load
public IRubyObject marshal_load(ThreadContext context,
IRubyObject arg)
- nurat_marshal_load
Copyright © 2002-2009 JRuby Team. All Rights Reserved.