Package org.jruby.ext.bigdecimal
Class RubyBigDecimal
java.lang.Object
org.jruby.RubyBasicObject
org.jruby.RubyObject
org.jruby.RubyNumeric
org.jruby.ext.bigdecimal.RubyBigDecimal
- All Implemented Interfaces:
Serializable
,Cloneable
,Comparable<IRubyObject>
,InstanceVariables
,InternalVariables
,IRubyObject
,CoreObjectType
- See Also:
-
Nested Class Summary
Nested ClassesNested 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
FieldsModifier and TypeFieldDescriptionstatic final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
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
-
Constructor Summary
ConstructorsConstructorDescriptionRubyBigDecimal
(Ruby runtime, BigDecimal value) RubyBigDecimal
(Ruby runtime, BigDecimal value, boolean isNan) RubyBigDecimal
(Ruby runtime, BigDecimal value, int infinitySign) RubyBigDecimal
(Ruby runtime, BigDecimal value, int infinitySign, int zeroSign) RubyBigDecimal
(Ruby runtime, RubyBigDecimal rbd) Deprecated.RubyBigDecimal
(Ruby runtime, RubyClass klass) RubyBigDecimal
(Ruby runtime, RubyClass klass, BigDecimal value) RubyBigDecimal
(Ruby runtime, RubyClass klass, RubyBigDecimal rbd) Deprecated. -
Method Summary
Modifier and TypeMethodDescription_dump
(ThreadContext context) _dump
(ThreadContext context, IRubyObject unused) static RubyBigDecimal
_load
(ThreadContext context, IRubyObject recv, IRubyObject from) abs()
Deprecated.abs
(ThreadContext context) num_absadd2
(ThreadContext context, IRubyObject b, IRubyObject digits) asBigInteger
(ThreadContext context) Return a BigInteger representation of this numerical valuedouble
asDouble
(ThreadContext context) Return a double representation of this numerical valueint
asInt
(ThreadContext context) Returns the value of this numeric and a java int.long
asLong
(ThreadContext context) Return the value of this numeric as a 64-bit long.static BigDecimal
bigSqrt
(BigDecimal squarD, MathContext rootMC) Returns the correctly rounded square root of a positive BigDecimal.ceil
(ThreadContext context) MRI: num_ceilceil
(ThreadContext context, IRubyObject arg) coerce
(ThreadContext context, IRubyObject other) num_coerceTries to convert this object to a Ruby Float using the "to_f" method.Deprecated.static RubyClass
createBigDecimal
(ThreadContext context) divmod
(ThreadContext context, IRubyObject other) num_divmodstatic IRubyObject
double_fig
(ThreadContext context, IRubyObject recv) eql_p
(ThreadContext context, IRubyObject arg) num_eqlexponent()
Deprecated.exponent
(ThreadContext context) finite_p()
Deprecated.finite_p
(ThreadContext context) fix()
Deprecated.fix
(ThreadContext context) floor
(ThreadContext context) MRI: num_floorfloor
(ThreadContext context, IRubyObject arg) static int
formatFractionalDigitGroups
(String format) static boolean
formatHasFloatingPointNotation
(String format) static boolean
formatHasLeadingPlus
(String format) static boolean
formatHasLeadingSpace
(String format) frac
(ThreadContext context) This is overridden in the other concrete Java builtins to provide a fast way to determine what type they are.getValue()
hash
(ThreadContext context) Will return the hash code of this object.static IRubyObject
induced_from
(ThreadContext context, IRubyObject recv, IRubyObject arg) infinite_p
(ThreadContext context) initialize_copy
(ThreadContext context, IRubyObject original) num_init_copyinspect
(ThreadContext context) Returns a string containing a human-readable representation of obj.static IRubyObject
interpret_loosely
(ThreadContext context, IRubyObject recv, IRubyObject str) final boolean
isZero
(ThreadContext context) static IRubyObject
limit
(ThreadContext context, IRubyObject recv) Retrieve vpPrecLimit.static IRubyObject
limit
(ThreadContext context, IRubyObject recv, IRubyObject arg) Set new vpPrecLimit if Fixnum and return the old value.static IRubyObject
mode
(ThreadContext context, IRubyObject recv, IRubyObject[] args) mult2
(ThreadContext context, IRubyObject b, IRubyObject n) multiplyWith
(ThreadContext context, RubyBignum value) multiplyWith
(ThreadContext context, RubyFloat value) multiplyWith
(ThreadContext context, RubyInteger value) n_significant_digits
(ThreadContext context) nan_p
(ThreadContext context) static RubyBigDecimal
newInstance
(ThreadContext context, IRubyObject recv, IRubyObject arg) Deprecated.static IRubyObject
newInstance
(ThreadContext context, IRubyObject recv, IRubyObject arg, boolean strict, boolean exception) Deprecated.static RubyBigDecimal
newInstance
(ThreadContext context, IRubyObject recv, IRubyObject arg, IRubyObject mathArg) static IRubyObject
newInstance
(ThreadContext context, IRubyObject recv, IRubyObject arg, IRubyObject mathArg, boolean strict, boolean exception) Deprecated.nonzero_p
(ThreadContext context) num_nonzero_pop_cmp
(ThreadContext context, IRubyObject arg) num_cmpop_div
(ThreadContext context, IRubyObject other) op_div
(ThreadContext context, IRubyObject other, IRubyObject digits) op_divide
(ThreadContext context, IRubyObject other) op_eqq
(ThreadContext context, IRubyObject arg) rb_equal The Ruby "===" method is used by default in case/when statements.op_ge
(ThreadContext context, IRubyObject arg) op_gt
(ThreadContext context, IRubyObject arg) op_le
(ThreadContext context, IRubyObject arg) op_lt
(ThreadContext context, IRubyObject arg) op_minus
(ThreadContext context, IRubyObject b) op_mod
(ThreadContext context, IRubyObject other) op_mul
(ThreadContext context, IRubyObject arg) op_plus
(ThreadContext context, IRubyObject b) op_pow
(ThreadContext context, IRubyObject exp) op_power
(ThreadContext context, IRubyObject exp) op_power
(ThreadContext context, IRubyObject exp, IRubyObject prec) op_quo
(ThreadContext context, IRubyObject other) op_quo
(ThreadContext context, IRubyObject object, IRubyObject digits) op_uminus
(ThreadContext context) num_uminusop_uplus
(ThreadContext context) num_uplusprecision
(ThreadContext context) precision_scale
(ThreadContext context) precs
(ThreadContext context) Deprecated.remainder
(ThreadContext context, IRubyObject arg) num_remainderround
(ThreadContext context, IRubyObject[] args) round
(ThreadContext context, IRubyObject scale, IRubyObject mode) static IRubyObject
save_exception_mode
(ThreadContext context, IRubyObject recv, Block block) static IRubyObject
save_limit
(ThreadContext context, IRubyObject recv, Block block) static IRubyObject
save_rounding_mode
(ThreadContext context, IRubyObject recv, Block block) scale
(ThreadContext context) sign()
Deprecated.sign
(ThreadContext context) split
(ThreadContext context) sqrt
(IRubyObject arg) Deprecated.sqrt
(ThreadContext context, IRubyObject arg) sub2
(ThreadContext context, IRubyObject b, IRubyObject n) to_f()
Deprecated.to_f
(ThreadContext context) final IRubyObject
to_int()
Deprecated.to_int
(ThreadContext context) num_to_intto_r
(ThreadContext context) to_s
(IRubyObject[] args) Deprecated.to_s
(ThreadContext context) to_s
(ThreadContext context, IRubyObject arg) <T> T
Convert the object to the specified Java class, if possible.toString()
The default toString method is just a wrapper that calls the Ruby "to_s" method.truncate
(ThreadContext context) MRI: num_truncatetruncate
(ThreadContext context, IRubyObject arg) zero_p()
Deprecated.zero_p
(ThreadContext context) num_zero_pMethods inherited from class org.jruby.RubyNumeric
abs2, arg, asNumeric, callCoerced, callCoerced, callCoerced, callCoerced, ceil, checkInt, checkInt, coerce, coerceBin, coerceBin, coerceBit, coerceBit, coerceCmp, coerceCmp, coerceFailed, coerceRelOp, coerceRelOp, coerceRescue, compareWithZero, conjugate, convertToRational, convertToRational, createNumericClass, dbl_cmp, dbl2ival, dbl2num, denominator, div, doCoerce, dup, fdiv, fix2int, fix2int, fix2long, fixable, float2long, float2ulong, floatStep, floatStepSize, floor, getBigIntegerValue, getCoerced, getDoubleValue, getIntValue, getLongValue, getRoundingMode, idiv, idiv, image, int2fix, integer_p, integer_p, intervalStepSize, isNegative, isNegative, isNegativeNumber, isPositive, isPositive, isPositiveNumber, isReal, isZero, magnitude, modulo, negativeInt, negFixable, negFixable, newNumeric, num_imaginary, num2chr, num2dbl, num2dbl, num2fix, num2fix, num2int, num2long, num2ulong, numerator, numFuncall, numFuncall, numRemainder, op_not, op_num_equal, op_uplus, polar, posFixable, posFixable, positiveInt, quo, rbClone, rbClone, rbClone, rbClone, real, real_p, rect, round, round, scalar_p, singleton_method_added, step, str2fnum, str2fnum, str2fnum, str2inum, str2inum, str2inum, to_c, truncate
Methods inherited from class org.jruby.RubyObject
attachToObjectSpace, callInit, callInit, callInit, callInit, callInit, callInit, callInit, callInit, callInit, callInit, convertToType, dig, dig1, dig2, eqlInternal, equalInternal, equals, finishObjectClass, hashCode, inspect, puts, specificEval, toRubyString
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, convertToHash, 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_equal, 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
-
Field Details
-
ROUND_DOWN
public static final int ROUND_DOWN- See Also:
-
ROUND_CEILING
public static final int ROUND_CEILING- See Also:
-
ROUND_UP
public static final int ROUND_UP- See Also:
-
ROUND_HALF_DOWN
public static final int ROUND_HALF_DOWN- See Also:
-
ROUND_HALF_EVEN
public static final int ROUND_HALF_EVEN- See Also:
-
ROUND_HALF_UP
public static final int ROUND_HALF_UP- See Also:
-
ROUND_FLOOR
public static final int ROUND_FLOOR- See Also:
-
SIGN_POSITIVE_INFINITE
public static final int SIGN_POSITIVE_INFINITE- See Also:
-
SIGN_POSITIVE_ZERO
public static final int SIGN_POSITIVE_ZERO- See Also:
-
SIGN_NEGATIVE_FINITE
public static final int SIGN_NEGATIVE_FINITE- See Also:
-
SIGN_NaN
public static final int SIGN_NaN- See Also:
-
BASE
public static final int BASE- See Also:
-
ROUND_MODE
public static final int ROUND_MODE- See Also:
-
SIGN_POSITIVE_FINITE
public static final int SIGN_POSITIVE_FINITE- See Also:
-
SIGN_NEGATIVE_INFINITE
public static final int SIGN_NEGATIVE_INFINITE- See Also:
-
SIGN_NEGATIVE_ZERO
public static final int SIGN_NEGATIVE_ZERO- See Also:
-
EXCEPTION_INFINITY
public static final int EXCEPTION_INFINITY- See Also:
-
EXCEPTION_OVERFLOW
public static final int EXCEPTION_OVERFLOW- See Also:
-
EXCEPTION_NaN
public static final int EXCEPTION_NaN- See Also:
-
EXCEPTION_UNDERFLOW
public static final int EXCEPTION_UNDERFLOW- See Also:
-
EXCEPTION_ZERODIVIDE
public static final int EXCEPTION_ZERODIVIDE- See Also:
-
EXCEPTION_ALL
public static final int EXCEPTION_ALL- See Also:
-
-
Constructor Details
-
RubyBigDecimal
-
RubyBigDecimal
-
RubyBigDecimal
-
RubyBigDecimal
-
RubyBigDecimal
-
RubyBigDecimal
-
RubyBigDecimal
Deprecated. -
RubyBigDecimal
Deprecated.
-
-
Method Details
-
createBigDecimal
-
getValue
-
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:
-
_dump
-
_dump
-
_load
-
double_fig
-
limit
Retrieve vpPrecLimit. -
limit
Set new vpPrecLimit if Fixnum and return the old value. -
save_limit
-
save_exception_mode
-
save_rounding_mode
-
interpret_loosely
public static IRubyObject interpret_loosely(ThreadContext context, IRubyObject recv, IRubyObject str) -
mode
-
induced_from
-
newInstance
@Deprecated public static RubyBigDecimal newInstance(ThreadContext context, IRubyObject recv, IRubyObject arg) Deprecated. -
newInstance
@Deprecated public static IRubyObject newInstance(ThreadContext context, IRubyObject recv, IRubyObject arg, boolean strict, boolean exception) Deprecated. -
newInstance
public static RubyBigDecimal newInstance(ThreadContext context, IRubyObject recv, IRubyObject arg, IRubyObject mathArg) -
newInstance
public static IRubyObject newInstance(ThreadContext context, IRubyObject recv, IRubyObject arg, IRubyObject mathArg, boolean strict, boolean exception) -
hash
Description copied from class:RubyBasicObject
Will return the hash code of this object. In comparison to MRI, this method will use the Java identity hash code instead of using rb_obj_id, since the usage of id in JRuby will incur the cost of some. ObjectSpace maintenance.- Overrides:
hash
in classRubyBasicObject
- Parameters:
context
- the current thread context- Returns:
- the hash value
-
initialize_copy
Description copied from class:RubyNumeric
num_init_copy- Overrides:
initialize_copy
in classRubyNumeric
- Parameters:
context
- the thread contextoriginal
- the original- Returns:
- a copy unless the same thing
-
op_mod
-
remainder
Description copied from class:RubyNumeric
num_remainder- Overrides:
remainder
in classRubyNumeric
-
op_mul
-
mult2
-
op_pow
-
op_power
-
op_power
-
op_plus
- Overrides:
op_plus
in classRubyNumeric
-
add2
-
op_uplus
Description copied from class:RubyNumeric
num_uplus- Overrides:
op_uplus
in classRubyNumeric
-
op_uminus
Description copied from class:RubyNumeric
num_uminus- Overrides:
op_uminus
in classRubyNumeric
-
op_minus
- Overrides:
op_minus
in classRubyNumeric
-
sub2
-
op_divide
-
op_quo
-
op_quo
-
op_div
-
op_div
-
op_cmp
Description copied from class:RubyNumeric
num_cmp- Overrides:
op_cmp
in classRubyNumeric
-
eql_p
Description copied from class:RubyNumeric
num_eql- Overrides:
eql_p
in classRubyNumeric
-
op_eqq
Description copied from class:RubyObject
rb_equal The Ruby "===" method is used by default in case/when statements. The Object implementation first checks Java identity equality and then calls the "==" method too.- Specified by:
op_eqq
in interfaceIRubyObject
- Overrides:
op_eqq
in classRubyObject
-
op_lt
-
op_le
-
op_gt
-
op_ge
-
abs
Deprecated. -
abs
Description copied from class:RubyNumeric
num_abs- Overrides:
abs
in classRubyNumeric
-
ceil
-
ceil
Description copied from class:RubyNumeric
MRI: num_ceil- Overrides:
ceil
in classRubyNumeric
-
coerce
Description copied from class:RubyNumeric
num_coerce- Overrides:
coerce
in classRubyNumeric
-
asBigInteger
Description copied from class:RubyNumeric
Return a BigInteger representation of this numerical value- Overrides:
asBigInteger
in classRubyNumeric
- Parameters:
context
- the current thread context- Returns:
- a BigInteger
-
asDouble
Description copied from class:RubyNumeric
Return a double representation of this numerical value- Overrides:
asDouble
in classRubyNumeric
- Parameters:
context
- the current thread context- Returns:
- a double
-
asInt
Description copied from class:RubyNumeric
Returns the value of this numeric and a java int.- Overrides:
asInt
in classRubyNumeric
-
asLong
Description copied from class:RubyNumeric
Return the value of this numeric as a 64-bit long.- Overrides:
asLong
in classRubyNumeric
-
getBigDecimalValue
-
multiplyWith
-
multiplyWith
-
multiplyWith
-
divmod
Description copied from class:RubyNumeric
num_divmod- Overrides:
divmod
in classRubyNumeric
-
exponent
Deprecated. -
exponent
-
finite_p
- Overrides:
finite_p
in classRubyNumeric
-
finite_p
Deprecated. -
floor
Description copied from class:RubyNumeric
MRI: num_floor- Overrides:
floor
in classRubyNumeric
-
floor
-
frac
-
infinite_p
- Overrides:
infinite_p
in classRubyNumeric
-
inspect
Description copied from class:RubyBasicObject
Returns a string containing a human-readable representation of obj. If not overridden, uses theto_s
method 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:
inspect
in interfaceIRubyObject
- Overrides:
inspect
in classRubyBasicObject
-
nan_p
-
nonzero_p
Description copied from class:RubyNumeric
num_nonzero_p- Overrides:
nonzero_p
in classRubyNumeric
-
nonzero_p
Deprecated. -
n_significant_digits
-
precision
-
scale
-
precision_scale
-
precs
Deprecated. -
round
-
round
-
sign
Deprecated.Usesign(ThreadContext)
instead.- Returns:
-
sign
-
split
-
sqrt
Deprecated. -
sqrt
-
to_f
Deprecated. -
to_f
-
convertToFloat
Description copied from class:RubyBasicObject
Tries to convert this object to a Ruby Float using the "to_f" method.- Specified by:
convertToFloat
in interfaceIRubyObject
- Overrides:
convertToFloat
in classRubyBasicObject
- Returns:
- float representation of this
-
to_int
Deprecated. -
to_int
Description copied from class:RubyNumeric
num_to_int- Overrides:
to_int
in classRubyNumeric
-
convertToInteger
Deprecated.Description copied from class:RubyBasicObject
Tries to convert this object to a Ruby Integer using the "to_int" method.- Specified by:
convertToInteger
in interfaceIRubyObject
- Overrides:
convertToInteger
in classRubyBasicObject
- Returns:
- an integer representation of this
-
to_r
-
formatHasLeadingPlus
-
formatHasLeadingSpace
-
formatHasFloatingPointNotation
-
formatFractionalDigitGroups
-
isZero
- Overrides:
isZero
in classRubyNumeric
-
to_s
- Overrides:
to_s
in classRubyBasicObject
-
to_s
-
toString
Description copied from class:RubyObject
The default toString method is just a wrapper that calls the Ruby "to_s" method.- Overrides:
toString
in classRubyObject
- Returns:
- string representation
-
to_s
Deprecated. -
fix
Deprecated. -
fix
-
truncate
Description copied from class:RubyNumeric
MRI: num_truncate- Overrides:
truncate
in classRubyNumeric
-
truncate
-
zero_p
Description copied from class:RubyNumeric
num_zero_p- Overrides:
zero_p
in classRubyNumeric
-
zero_p
Deprecated. -
toJava
Description copied from interface:IRubyObject
Convert the object to the specified Java class, if possible.- Specified by:
toJava
in interfaceIRubyObject
- Overrides:
toJava
in classRubyNumeric
- Type Parameters:
T
- type- Parameters:
target
- The target type to which the object should be converted.- Returns:
- java type
- See Also:
-
bigSqrt
Returns the correctly rounded square root of a positive BigDecimal. This method performs the fast Square Root by Coupled Newton Iteration algorithm by Timm Ahrendt, from the book "Pi, unleashed" by Jörg Arndt in a neat loop.The code is based on Frans Lelieveld's code , used here with permission.
- Parameters:
squarD
- The number to get the root from.rootMC
- Precision and rounding mode.- Returns:
- the root of the argument number
- Throws:
ArithmeticException
- if the argument number is negativeIllegalArgumentException
- if rootMC has precision 0- See Also:
-
sign(ThreadContext)
instead.