Package org.jruby
Class RubyComplex
java.lang.Object
org.jruby.RubyBasicObject
org.jruby.RubyObject
org.jruby.RubyNumeric
org.jruby.RubyComplex
- All Implemented Interfaces:
Serializable,Cloneable,Comparable<IRubyObject>,InstanceVariables,InternalVariables,IRubyObject,CoreObjectType
complex.c as of revision: 20011
- 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
Fields 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, 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 -
Method Summary
Modifier and TypeMethodDescriptionabs(ThreadContext context) nucomp_absabs2(ThreadContext context) nucomp_abs2arg(ThreadContext context) nucomp_argbooleancheckFinite(ThreadContext context, IRubyObject value) checkInfinite(ThreadContext context, IRubyObject value) coerce(ThreadContext context, IRubyObject other) nucomp_coercecomplex_p(ThreadContext context) nucomp_complex_pconjugate(ThreadContext context) nucomp_conjugatestatic IRubyObjectconvert(ThreadContext context, IRubyObject recv, IRubyObject arg) nucomp_s_convertstatic IRubyObjectconvert(ThreadContext context, IRubyObject clazz, IRubyObject[] args) Deprecated.static IRubyObjectconvert(ThreadContext context, IRubyObject recv, IRubyObject a1, IRubyObject a2) nucomp_s_convertstatic IRubyObjectconvert(ThreadContext context, IRubyObject recv, IRubyObject a1, IRubyObject a2, IRubyObject kwargs) nucomp_s_convertstatic IRubyObjectconvertCommon(ThreadContext context, IRubyObject recv, IRubyObject a1, IRubyObject a2, boolean raise) static RubyClasscreateComplexClass(ThreadContext context, RubyClass Numeric) demoninator(ThreadContext context) nucomp_denominatoreql_p(ThreadContext context, IRubyObject other) nucomp_eql_pbooleanThis override does not do a "checked" dispatch.exact_p(ThreadContext context) nucomp_exact_pstatic IRubyObjectf_divide(ThreadContext context, RubyComplex self, IRubyObject other, BiFunction<IRubyObject, IRubyObject, IRubyObject> func, CallSite id) fdiv(ThreadContext context, IRubyObject other) nucomp_fdivfinite_p(ThreadContext context) This is overridden in the other concrete Java builtins to provide a fast way to determine what type they are.hash(ThreadContext context) nucomp_hashinthashCode()This override does not do "checked" dispatch since Object usually has #hash defined.image()Deprecated.image(ThreadContext context) nucomp_imageinexact_p(ThreadContext context) nucomp_exact_pinfinite_p(ThreadContext context) inspect(ThreadContext context) nucomp_inspectbooleanisReal()marshal_dump(ThreadContext context) nucomp_marshal_dumpmarshal_load(ThreadContext context, IRubyObject arg) nucomp_marshal_loadnegate(ThreadContext context) nucomp_negatestatic RubyComplexnewComplexBang(ThreadContext context, RubyClass clazz, IRubyObject x) Deprecated.static IRubyObjectnewComplexCanonicalize(ThreadContext context, IRubyObject x) rb_complex_new1static IRubyObjectnewComplexCanonicalize(ThreadContext context, IRubyObject x, IRubyObject y) rb_complex_newstatic IRubyObjectnewComplexConvert(ThreadContext context, IRubyObject x) rb_Complex1static IRubyObjectnewComplexConvert(ThreadContext context, IRubyObject x, IRubyObject y) rb_Complex/rb_Complex2static RubyComplexnewComplexRaw(Ruby runtime, IRubyObject x) rb_complex_raw1static RubyComplexnewComplexRaw(Ruby runtime, IRubyObject x, IRubyObject y) rb_complex_rawstatic RubyComplexnewComplexRawImage(Ruby runtime, IRubyObject image) static IRubyObjectnewInstance(ThreadContext context, IRubyObject recv, IRubyObject real) static IRubyObjectnewInstance(ThreadContext context, IRubyObject recv, IRubyObject[] args) Deprecated.static IRubyObjectnewInstance(ThreadContext context, IRubyObject recv, IRubyObject real, boolean raise) static IRubyObjectnewInstance(ThreadContext context, IRubyObject recv, IRubyObject real, IRubyObject image) static IRubyObjectnewInstance(ThreadContext context, IRubyObject recv, IRubyObject real, IRubyObject image, boolean raise) static IRubyObjectnewInstanceBang(ThreadContext context, IRubyObject recv, IRubyObject real) static IRubyObjectnewInstanceBang(ThreadContext context, IRubyObject recv, IRubyObject[] args) Deprecated.static IRubyObjectnewInstanceBang(ThreadContext context, IRubyObject recv, IRubyObject real, IRubyObject image) static IRubyObjectnewInstanceNew(ThreadContext context, IRubyObject recv, IRubyObject real) Deprecated.static IRubyObjectnewInstanceNew(ThreadContext context, IRubyObject recv, IRubyObject real, IRubyObject image) Deprecated.numerator(ThreadContext context) nucomp_numeratorop_add(ThreadContext context, IRubyObject other) nucomp_addop_cmp(ThreadContext context, IRubyObject other) num_cmpop_div(ThreadContext context, IRubyObject other) nucomp_div / nucomp_quo / rb_complex_divop_equal(ThreadContext context, IRubyObject other) nucomp_equal_pop_expt(ThreadContext context, IRubyObject other) MRI: nucomp_expt, rb_complex_powop_mul(ThreadContext context, IRubyObject other) nucomp_mulop_sub(ThreadContext context, IRubyObject other) nucomp_subpolar(ThreadContext context) nucomp_polarstatic IRubyObjectpolar(ThreadContext context, IRubyObject clazz, IRubyObject... args) nucomp_s_polarrationalize(ThreadContext context, IRubyObject[] args) nucomp_rationalizereal()Deprecated.real(ThreadContext context) numeric_realreal_p(ThreadContext context) nucomp_real_prect(ThreadContext context) nucomp_rectstatic voidsetCanonicalization(boolean canonical) to_c(ThreadContext context) nucomp_to_cto_f(ThreadContext context) nucomp_to_fto_i(ThreadContext context) nucomp_to_ito_r(ThreadContext context) nucomp_to_rto_s(ThreadContext context) nucomp_to_sMethods inherited from class org.jruby.RubyNumeric
asBigInteger, asDouble, asInt, asLong, asNumeric, callCoerced, callCoerced, callCoerced, callCoerced, ceil, ceil, checkInt, checkInt, coerce, coerceBin, coerceBin, coerceBit, coerceBit, coerceCmp, coerceCmp, coerceFailed, coerceRelOp, coerceRelOp, coerceRescue, compareWithZero, convertToRational, convertToRational, createNumericClass, dbl_cmp, dbl2ival, dbl2num, denominator, div, divmod, doCoerce, dup, fix2int, fix2int, fix2long, fixable, float2long, float2ulong, floatStep, floatStepSize, floor, floor, getBigIntegerValue, getCoerced, getDoubleValue, getIntValue, getLongValue, getRoundingMode, idiv, idiv, initialize_copy, int2fix, integer_p, integer_p, intervalStepSize, isNegative, isNegative, isNegativeNumber, isPositive, isPositive, isPositiveNumber, isZero, isZero, magnitude, modulo, negativeInt, negFixable, negFixable, newNumeric, nonzero_p, num_imaginary, num2chr, num2dbl, num2dbl, num2fix, num2fix, num2int, num2long, num2ulong, numFuncall, numFuncall, numRemainder, op_minus, op_not, op_num_equal, op_plus, op_uminus, op_uplus, op_uplus, posFixable, posFixable, positiveInt, quo, rbClone, rbClone, rbClone, rbClone, remainder, round, round, scalar_p, singleton_method_added, step, str2fnum, str2fnum, str2fnum, str2inum, str2inum, str2inum, to_int, toJava, truncate, truncate, zero_pMethods inherited from class org.jruby.RubyObject
attachToObjectSpace, callInit, callInit, callInit, callInit, callInit, callInit, callInit, callInit, callInit, callInit, convertToType, dig, dig1, dig2, eqlInternal, equalInternal, finishObjectClass, inspect, op_eqq, puts, specificEval, toRubyString, toStringMethods inherited from class org.jruby.RubyBasicObject
addFinalizer, addFinalizer, anyToString, asJavaString, asString, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callSuper, checkArrayType, checkCallMethod, checkCallMethod, checkFrozen, checkStringType, cloneSetup, compareTo, convertToArray, convertToFloat, convertToHash, convertToInteger, convertToInteger, convertToInteger, convertToString, copyInstanceVariablesInto, copySpecialInstanceVariables, dataGetStruct, dataGetStructChecked, dataWrapStruct, decode, display, dupFinalizer, dupSetup, ensureInstanceVariablesSettable, eql, eql_p, equal_p, evalUnder, extend, fastGetInstanceVariable, fastGetInternalVariable, fastHasInstanceVariable, fastHasInternalVariable, fastSetInstanceVariable, fastSetInternalVariable, finishBasicObjectClass, forEachInstanceVariable, forEachInstanceVariableName, freeze, frozen_p, getCurrentContext, getFFIHandle, getFlag, getInstanceEvalClass, getInstanceEvalClass, getInstanceVariable, getInstanceVariableList, getInstanceVariableNameList, getInstanceVariables, getInternalVariable, getInternalVariables, getJavaClass, getMarshalVariableList, getMetaClass, getMetaClass, getNativeHandle, getNativeTypeIndex, getObjectId, getRuntime, getSingletonClass, getSingletonClassClone, getSingletonClassCloneAndAttach, getSingletonClassCloneAndAttach, getType, getVariable, getVariableCount, getVariableList, getVariableNameList, hash, hashyInspect, hasInstanceVariable, hasInstanceVariables, hasInternalVariable, hasVariables, id, infectBy, initialize, initialize_copy, inspect, inspectHashCode, instance_eval, instance_eval, instance_eval, instance_eval, instance_eval, instance_exec, instance_of_p, instance_variable_defined_p, instance_variable_get, instance_variable_set, instance_variables, isBuiltin, isClass, isFalse, isFrozen, isImmediate, isModule, isNil, isSpecialConst, isSpecialObject, isTaint, isTrue, isUntrusted, kind_of_p, makeMetaClass, makeMetaClass, makeMetaClassBootstrap, method, method, method, method_missing, methods, methods, nil_p, nonFixnumHashCode, nonFixnumHashCode, OBJ_INIT_COPY, objInitCopy, op_match, op_not_equal, op_not_match, private_methods, protected_methods, public_methods, rbInspect, remove_instance_variable, removeFinalizers, removeInstanceVariable, removeInternalVariable, respond_to_p, respond_to_p, respondsTo, respondsToMissing, respondsToMissing, send, send, send, send, send, setFFIHandle, setFlag, setFrozen, setInstanceVariable, setInternalVariable, setMetaClass, setNativeHandle, setTaint, setUntrusted, setVariable, singleton_method, singleton_method, singleton_method_added, singleton_method_removed, singleton_method_undefined, singleton_methods, singletonClass, specificEval, specificEval, specificEval, specificEval, syncVariables, syncVariables, taint, taint, tainted_p, testFrozen, testFrozen, to_a, to_a, to_s, trust, type, untaint, untrust, untrusted_p, validateInstanceVariable, validateInstanceVariable, validateInstanceVariable, variableTableContains, variableTableFastContains, variableTableFastFetch, variableTableFastStore, variableTableFetch, variableTableRemove, variableTableStore, variableTableSync, yieldUnder, yieldUnderMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.jruby.runtime.builtin.IRubyObject
checkStringType19, dup, marshalLiveVariables
-
Method Details
-
createComplexClass
-
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- Returns:
- the ClassIndex of the native type this object was constructed from
- See Also:
-
newComplexRaw
rb_complex_raw -
newComplexRaw
rb_complex_raw1 -
newComplexRawImage
-
newComplexCanonicalize
rb_complex_new1 -
newComplexCanonicalize
public static IRubyObject newComplexCanonicalize(ThreadContext context, IRubyObject x, IRubyObject y) rb_complex_new -
newComplexBang
@Deprecated public static RubyComplex newComplexBang(ThreadContext context, RubyClass clazz, IRubyObject x) Deprecated. -
newInstanceBang
@Deprecated public static IRubyObject newInstanceBang(ThreadContext context, IRubyObject recv, IRubyObject[] args) Deprecated.nucomp_s_new_bang -
newInstanceBang
public static IRubyObject newInstanceBang(ThreadContext context, IRubyObject recv, IRubyObject real) -
newInstanceBang
public static IRubyObject newInstanceBang(ThreadContext context, IRubyObject recv, IRubyObject real, IRubyObject image) -
setCanonicalization
public static void setCanonicalization(boolean canonical) -
newInstance
@Deprecated public static IRubyObject newInstance(ThreadContext context, IRubyObject recv, IRubyObject[] args) Deprecated.nucomp_s_new -
newInstanceNew
@Deprecated public static IRubyObject newInstanceNew(ThreadContext context, IRubyObject recv, IRubyObject real) Deprecated. -
newInstance
-
newInstance
public static IRubyObject newInstance(ThreadContext context, IRubyObject recv, IRubyObject real, boolean raise) -
newInstanceNew
@Deprecated public static IRubyObject newInstanceNew(ThreadContext context, IRubyObject recv, IRubyObject real, IRubyObject image) Deprecated. -
newInstance
public static IRubyObject newInstance(ThreadContext context, IRubyObject recv, IRubyObject real, IRubyObject image) -
newInstance
public static IRubyObject newInstance(ThreadContext context, IRubyObject recv, IRubyObject real, IRubyObject image, boolean raise) -
polar
nucomp_s_polar -
newComplexConvert
rb_Complex1 -
newComplexConvert
rb_Complex/rb_Complex2 -
convert
@Deprecated public static IRubyObject convert(ThreadContext context, IRubyObject clazz, IRubyObject[] args) Deprecated. -
convert
nucomp_s_convert -
convert
public static IRubyObject convert(ThreadContext context, IRubyObject recv, IRubyObject a1, IRubyObject a2) nucomp_s_convert -
convert
public static IRubyObject convert(ThreadContext context, IRubyObject recv, IRubyObject a1, IRubyObject a2, IRubyObject kwargs) nucomp_s_convert -
convertCommon
public static IRubyObject convertCommon(ThreadContext context, IRubyObject recv, IRubyObject a1, IRubyObject a2, boolean raise) -
op_cmp
Description copied from class:RubyNumericnum_cmp- Overrides:
op_cmpin classRubyNumeric
-
real
Deprecated. -
real
Description copied from class:RubyNumericnumeric_real- Overrides:
realin classRubyNumeric
-
image
Deprecated. -
image
nucomp_image- Overrides:
imagein classRubyNumeric
-
negate
nucomp_negate -
op_add
nucomp_add -
op_sub
nucomp_sub -
op_mul
nucomp_mul -
op_div
nucomp_div / nucomp_quo / rb_complex_div -
f_divide
public static IRubyObject f_divide(ThreadContext context, RubyComplex self, IRubyObject other, BiFunction<IRubyObject, IRubyObject, IRubyObject> func, CallSite id) -
fdiv
nucomp_fdiv- Overrides:
fdivin classRubyNumeric
-
op_expt
MRI: nucomp_expt, rb_complex_pow -
op_equal
nucomp_equal_p- Specified by:
op_equalin interfaceIRubyObject- Overrides:
op_equalin classRubyBasicObject
-
coerce
nucomp_coerce- Overrides:
coercein classRubyNumeric
-
abs
nucomp_abs- Overrides:
absin classRubyNumeric
-
abs2
nucomp_abs2- Overrides:
abs2in classRubyNumeric
-
arg
nucomp_arg- Overrides:
argin classRubyNumeric
-
rect
nucomp_rect- Overrides:
rectin classRubyNumeric
-
polar
nucomp_polar- Overrides:
polarin classRubyNumeric
-
conjugate
nucomp_conjugate- Overrides:
conjugatein classRubyNumeric
-
real_p
nucomp_real_p- Overrides:
real_pin classRubyNumeric
-
isReal
public boolean isReal()- Overrides:
isRealin classRubyNumeric
-
complex_p
nucomp_complex_p -
exact_p
nucomp_exact_p -
inexact_p
nucomp_exact_p -
demoninator
nucomp_denominator -
numerator
nucomp_numerator- Overrides:
numeratorin classRubyNumeric
-
hash
nucomp_hash- Overrides:
hashin classRubyBasicObject- Parameters:
context- the current thread context- Returns:
- the hash value
-
hashCode
public int hashCode()Description copied from class:RubyObjectThis override does not do "checked" dispatch since Object usually has #hash defined.- Overrides:
hashCodein classRubyObject- Returns:
- the hash code
- See Also:
-
eql_p
nucomp_eql_p- Overrides:
eql_pin classRubyNumeric
-
equals
Description copied from class:RubyObjectThis override does not do a "checked" dispatch.- Overrides:
equalsin classRubyObject- Parameters:
other- object to compare- Returns:
- true if equals
- See Also:
-
to_s
nucomp_to_s- Overrides:
to_sin classRubyBasicObject
-
inspect
nucomp_inspect- Specified by:
inspectin interfaceIRubyObject- Overrides:
inspectin classRubyBasicObject
-
marshal_dump
nucomp_marshal_dump -
marshal_load
nucomp_marshal_load -
to_c
nucomp_to_c- Overrides:
to_cin classRubyNumeric
-
to_i
nucomp_to_i -
to_f
nucomp_to_f -
to_r
nucomp_to_r -
rationalize
nucomp_rationalize -
finite_p
- Overrides:
finite_pin classRubyNumeric
-
checkFinite
-
infinite_p
- Overrides:
infinite_pin classRubyNumeric
-
checkInfinite
-