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
FieldsModifier and TypeFieldDescriptionprivate static final ByteListprivate static booleannucomp_canonicalizationprivate IRubyObjectprivate IRubyObjectprivate static final ByteListFields 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
ConstructorsModifierConstructorDescriptionprivateRubyComplex(Ruby runtime, RubyClass clazz) privateRubyComplex(Ruby runtime, RubyClass clazz, IRubyObject real, IRubyObject image) internal -
Method Summary
Modifier and TypeMethodDescriptionabs(ThreadContext context) nucomp_absabs2(ThreadContext context) nucomp_abs2arg(ThreadContext context) nucomp_argprivate static RubyNumericcanonicalizeInternal(ThreadContext context, RubyClass clazz, IRubyObject real, IRubyObject image) nucomp_s_canonicalize_internalbooleancheckFinite(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_convertprivate static IRubyObjectconvertCommon(ThreadContext context, IRubyObject recv, IRubyObject a1, IRubyObject a2, boolean raise) private static RubyNumericconvertString(ThreadContext context, IRubyObject s, RubyFixnum zero) static RubyClasscreateComplexClass(Ruby runtime) demoninator(ThreadContext context) nucomp_denominatoreql_p(ThreadContext context, IRubyObject other) nucomp_eql_pbooleanThis override does not do a "checked" dispatch.private booleanequals(ThreadContext context, Object other) exact_p(ThreadContext context) nucomp_exact_pprivate static IRubyObjectf_complex_polar(ThreadContext context, RubyClass clazz, IRubyObject x, IRubyObject y) f_complex_polarstatic 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) (package private) IRubyObjectgetImage()This is overridden in the other concrete Java builtins to provide a fast way to determine what type they are.(package private) IRubyObjectgetReal()hash(ThreadContext context) nucomp_hashinthashCode()This override does not do "checked" dispatch since Object usually has #hash defined.image()nucomp_imageinexact_p(ThreadContext context) nucomp_exact_pinfinite_p(ThreadContext context) inspect(ThreadContext context) nucomp_inspectbooleanisReal()private static booleanlastCharDigit(RubyString str) private static IRubyObjectm_cos(ThreadContext context, IRubyObject x) m_cosprivate static IRubyObjectm_sin(ThreadContext context, IRubyObject x) m_sinprivate static IRubyObjectm_sqrt(ThreadContext context, IRubyObject x) m_sqrtmarshal_dump(ThreadContext context) nucomp_marshal_dumpmarshal_load(ThreadContext context, IRubyObject arg) nucomp_marshal_loadnegate(ThreadContext context) nucomp_negate(package private) static RubyNumericnewComplex(ThreadContext context, RubyClass clazz, IRubyObject x) f_complex_new1(package private) static RubyNumericnewComplex(ThreadContext context, RubyClass clazz, IRubyObject x, IRubyObject y) f_complex_new2(package private) static RubyComplexnewComplexBang(ThreadContext context, RubyClass clazz, RubyNumeric x) f_complex_new_bang1(package private) static RubyComplexnewComplexBang(ThreadContext context, RubyClass clazz, RubyNumeric x, RubyNumeric y) f_complex_new_bang2static 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_Complex2(package private) static IRubyObjectnewComplexPolar(ThreadContext context, IRubyObject x, IRubyObject y) rb_complex_polarstatic 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_div(ThreadContext context, IRubyObject other) nucomp_div / nucomp_quoop_equal(ThreadContext context, IRubyObject other) nucomp_equal_pop_expt(ThreadContext context, IRubyObject other) nucomp_exptop_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_polarstatic IRubyObjectpolar19(ThreadContext context, IRubyObject clazz, IRubyObject[] args) Deprecated.rationalize(ThreadContext context, IRubyObject[] args) nucomp_rationalizereal()nucomp_realreal_p(ThreadContext context) nucomp_real_pprivate static booleanrealCheck(ThreadContext context, IRubyObject num, boolean raise) nucomp_real_check (might go to bimorphic)rect(ThreadContext context) nucomp_rectstatic voidsetCanonicalization(boolean canonical) private static booleansignbit(ThreadContext context, IRubyObject x) f_signbitprivate static JavaSites.ComplexSitessites(ThreadContext context) (package private) static IRubyObject[]str_to_c_internal(ThreadContext context, RubyString str) private static IRubyObjectstr_to_c_strict(ThreadContext context, RubyString str, boolean raise) 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_sprivate static booleantpositive_p(ThreadContext context, IRubyObject x) f_tpositive_pMethods inherited from class org.jruby.RubyNumeric
asNumeric, callCoerced, callCoerced, callCoerced, callCoerced, ceil, ceil, checkInt, checkInt, coerce, coerceBin, coerceBin, coerceBit, coerceBit, coerceBody, coerceCmp, coerceCmp, coerceFailed, coerceRelOp, coerceRelOp, coerceRescue, compareWithZero, convertToRational, createNumericClass, dbl_cmp, dbl2ival, dbl2num, denominator, div, div19, divmod, divmod19, doCoerce, dup, fix2int, fix2int, fix2long, fixable, float2long, float2ulong, floatStep, floatStep, floatStepSize, floor, floor, getBigIntegerValue, getCoerced, getDoubleValue, getIntValue, getLongValue, getRoundingMode, idiv, idiv, image, initialize_copy, int2fix, integer_p, intervalStepSize, isNegative, isNegative, isPositive, isPositive, isZero, magnitude, modulo, modulo, modulo19, negativeInt, negFixable, negFixable, newNumeric, nonzero_p, num_imaginary, num2chr, num2dbl, num2dbl, num2fix, num2int, num2long, num2ulong, numFuncall, numFuncall, numRemainder, op_cmp, op_minus, op_not, op_num_equal, op_plus, op_uminus, op_uplus, posFixable, posFixable, positiveInt, quo, quo_19, rbClone, rbClone, rbClone, rbClone, real, remainder, round, round, scalar_p, singleton_method_added, step, str2fnum, str2fnum, str2fnum, str2fnum19, 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, createObjectClass, dig, dig1, dig2, eqlInternal, equalInternal, 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, 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, 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, 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_cmp, 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, to_s, trust, type, type_deprecated, untaint, untrust, untrusted_p, validateInstanceVariable, validateInstanceVariable, validateInstanceVariable, variableTableContains, variableTableFastContains, variableTableFastFetch, variableTableFastStore, variableTableFetch, variableTableRemove, variableTableStore, variableTableSync, yieldUnder, yieldUnder
-
Field Details
-
real
-
image
-
canonicalization
private static boolean canonicalizationnucomp_canonicalization -
SEP
-
_eE
-
-
Constructor Details
-
RubyComplex
internal -
RubyComplex
-
-
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- 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 -
newComplexPolar
rb_complex_polar -
newComplex
f_complex_new1 -
newComplex
f_complex_new2 -
newComplexBang
static RubyComplex newComplexBang(ThreadContext context, RubyClass clazz, RubyNumeric x, RubyNumeric y) f_complex_new_bang2 -
newComplexBang
f_complex_new_bang1 -
newComplexBang
@Deprecated public static RubyComplex newComplexBang(ThreadContext context, RubyClass clazz, IRubyObject x) Deprecated. -
getImage
IRubyObject getImage() -
getReal
IRubyObject getReal() -
m_cos
m_cos -
m_sin
m_sin -
m_sqrt
m_sqrt -
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) -
realCheck
nucomp_real_check (might go to bimorphic) -
canonicalizeInternal
private static RubyNumeric canonicalizeInternal(ThreadContext context, RubyClass clazz, IRubyObject real, IRubyObject image) nucomp_s_canonicalize_internal -
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) -
f_complex_polar
private static IRubyObject f_complex_polar(ThreadContext context, RubyClass clazz, IRubyObject x, IRubyObject y) f_complex_polar -
polar
nucomp_s_polar -
polar19
@Deprecated public static IRubyObject polar19(ThreadContext context, IRubyObject clazz, IRubyObject[] args) Deprecated. -
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
private static IRubyObject convertCommon(ThreadContext context, IRubyObject recv, IRubyObject a1, IRubyObject a2, boolean raise) -
real
nucomp_real -
image
nucomp_image -
negate
nucomp_negate -
op_add
nucomp_add -
op_sub
nucomp_sub -
op_mul
nucomp_mul -
op_div
nucomp_div / nucomp_quo -
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
nucomp_expt -
op_equal
nucomp_equal_p- Specified by:
op_equalin interfaceIRubyObject- Overrides:
op_equalin classRubyBasicObject
-
coerce
nucomp_coerce -
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 -
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:
-
eql_p
nucomp_eql_p- Overrides:
eql_pin classRubyNumeric
-
equals
-
equals
Description copied from class:RubyObjectThis override does not do a "checked" dispatch.- Overrides:
equalsin classRubyObject- See Also:
-
signbit
f_signbit -
tpositive_p
f_tpositive_p -
to_s
nucomp_to_s -
inspect
nucomp_inspect -
lastCharDigit
-
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
-
str_to_c_internal
-
convertString
-
str_to_c_strict
-
sites
-