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.NumberTooLargeException
Nested classes/interfaces inherited from class org.jruby.RubyObject
RubyObject.Data
Nested classes/interfaces inherited from class org.jruby.RubyBasicObject
RubyBasicObject.Finalizer
-
Field Summary
Fields inherited from class org.jruby.RubyNumeric
DBL_EPSILON
Fields inherited from class org.jruby.RubyObject
IVAR_INSPECTING_OBJECT_ALLOCATOR, OBJECT_ALLOCATOR, REIFYING_OBJECT_ALLOCATOR
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, 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, varTableStamp
Fields 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_argboolean
checkFinite
(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 IRubyObject
convert
(ThreadContext context, IRubyObject recv, IRubyObject arg) nucomp_s_convertstatic IRubyObject
convert
(ThreadContext context, IRubyObject clazz, IRubyObject[] args) Deprecated.static IRubyObject
convert
(ThreadContext context, IRubyObject recv, IRubyObject a1, IRubyObject a2) nucomp_s_convertstatic IRubyObject
convert
(ThreadContext context, IRubyObject recv, IRubyObject a1, IRubyObject a2, IRubyObject kwargs) nucomp_s_convertstatic IRubyObject
convertCommon
(ThreadContext context, IRubyObject recv, IRubyObject a1, IRubyObject a2, boolean raise) static RubyClass
createComplexClass
(ThreadContext context, RubyClass Numeric) demoninator
(ThreadContext context) nucomp_denominatoreql_p
(ThreadContext context, IRubyObject other) nucomp_eql_pboolean
This override does not do a "checked" dispatch.exact_p
(ThreadContext context) nucomp_exact_pstatic IRubyObject
f_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_hashint
hashCode()
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_inspectboolean
isReal()
marshal_dump
(ThreadContext context) nucomp_marshal_dumpmarshal_load
(ThreadContext context, IRubyObject arg) nucomp_marshal_loadnegate
(ThreadContext context) nucomp_negatestatic RubyComplex
newComplexBang
(ThreadContext context, RubyClass clazz, IRubyObject x) Deprecated.static IRubyObject
newComplexCanonicalize
(ThreadContext context, IRubyObject x) rb_complex_new1static IRubyObject
newComplexCanonicalize
(ThreadContext context, IRubyObject x, IRubyObject y) rb_complex_newstatic IRubyObject
newComplexConvert
(ThreadContext context, IRubyObject x) rb_Complex1static IRubyObject
newComplexConvert
(ThreadContext context, IRubyObject x, IRubyObject y) rb_Complex/rb_Complex2static RubyComplex
newComplexRaw
(Ruby runtime, IRubyObject x) rb_complex_raw1static RubyComplex
newComplexRaw
(Ruby runtime, IRubyObject x, IRubyObject y) rb_complex_rawstatic RubyComplex
newComplexRawImage
(Ruby runtime, IRubyObject image) static IRubyObject
newInstance
(ThreadContext context, IRubyObject recv, IRubyObject real) static IRubyObject
newInstance
(ThreadContext context, IRubyObject recv, IRubyObject[] args) Deprecated.static IRubyObject
newInstance
(ThreadContext context, IRubyObject recv, IRubyObject real, boolean raise) static IRubyObject
newInstance
(ThreadContext context, IRubyObject recv, IRubyObject real, IRubyObject image) static IRubyObject
newInstance
(ThreadContext context, IRubyObject recv, IRubyObject real, IRubyObject image, boolean raise) static IRubyObject
newInstanceBang
(ThreadContext context, IRubyObject recv, IRubyObject real) static IRubyObject
newInstanceBang
(ThreadContext context, IRubyObject recv, IRubyObject[] args) Deprecated.static IRubyObject
newInstanceBang
(ThreadContext context, IRubyObject recv, IRubyObject real, IRubyObject image) static IRubyObject
newInstanceNew
(ThreadContext context, IRubyObject recv, IRubyObject real) Deprecated.static IRubyObject
newInstanceNew
(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 IRubyObject
polar
(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 void
setCanonicalization
(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_p
Methods 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, toString
Methods 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, yieldUnder
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.jruby.runtime.builtin.IRubyObject
checkStringType19, dup, marshalLiveVariables
-
Method Details
-
createComplexClass
-
getNativeClassIndex
Description copied from class:RubyObject
This 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:
getNativeClassIndex
in interfaceCoreObjectType
- Overrides:
getNativeClassIndex
in 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:RubyNumeric
num_cmp- Overrides:
op_cmp
in classRubyNumeric
-
real
Deprecated. -
real
Description copied from class:RubyNumeric
numeric_real- Overrides:
real
in classRubyNumeric
-
image
Deprecated. -
image
nucomp_image- Overrides:
image
in 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:
fdiv
in classRubyNumeric
-
op_expt
MRI: nucomp_expt, rb_complex_pow -
op_equal
nucomp_equal_p- Specified by:
op_equal
in interfaceIRubyObject
- Overrides:
op_equal
in classRubyBasicObject
-
coerce
nucomp_coerce- Overrides:
coerce
in classRubyNumeric
-
abs
nucomp_abs- Overrides:
abs
in classRubyNumeric
-
abs2
nucomp_abs2- Overrides:
abs2
in classRubyNumeric
-
arg
nucomp_arg- Overrides:
arg
in classRubyNumeric
-
rect
nucomp_rect- Overrides:
rect
in classRubyNumeric
-
polar
nucomp_polar- Overrides:
polar
in classRubyNumeric
-
conjugate
nucomp_conjugate- Overrides:
conjugate
in classRubyNumeric
-
real_p
nucomp_real_p- Overrides:
real_p
in classRubyNumeric
-
isReal
public boolean isReal()- Overrides:
isReal
in classRubyNumeric
-
complex_p
nucomp_complex_p -
exact_p
nucomp_exact_p -
inexact_p
nucomp_exact_p -
demoninator
nucomp_denominator -
numerator
nucomp_numerator- Overrides:
numerator
in classRubyNumeric
-
hash
nucomp_hash- Overrides:
hash
in classRubyBasicObject
- Parameters:
context
- the current thread context- Returns:
- the hash value
-
hashCode
public int hashCode()Description copied from class:RubyObject
This override does not do "checked" dispatch since Object usually has #hash defined.- Overrides:
hashCode
in classRubyObject
- Returns:
- the hash code
- See Also:
-
eql_p
nucomp_eql_p- Overrides:
eql_p
in classRubyNumeric
-
equals
Description copied from class:RubyObject
This override does not do a "checked" dispatch.- Overrides:
equals
in classRubyObject
- Parameters:
other
- object to compare- Returns:
- true if equals
- See Also:
-
to_s
nucomp_to_s- Overrides:
to_s
in classRubyBasicObject
-
inspect
nucomp_inspect- Specified by:
inspect
in interfaceIRubyObject
- Overrides:
inspect
in classRubyBasicObject
-
marshal_dump
nucomp_marshal_dump -
marshal_load
nucomp_marshal_load -
to_c
nucomp_to_c- Overrides:
to_c
in classRubyNumeric
-
to_i
nucomp_to_i -
to_f
nucomp_to_f -
to_r
nucomp_to_r -
rationalize
nucomp_rationalize -
finite_p
- Overrides:
finite_p
in classRubyNumeric
-
checkFinite
-
infinite_p
- Overrides:
infinite_p
in classRubyNumeric
-
checkInfinite
-