public class RubyFloat extends RubyNumeric
RubyNumeric.InvalidIntegerException, RubyNumeric.NumberTooLargeExceptionRubyObject.DataRubyBasicObject.Finalizer| Modifier and Type | Field and Description |
|---|---|
(package private) static int |
DBL_MANT_DIG
float_to_r, float_decode
|
static int |
DIG |
static double |
EPSILON |
(package private) static int |
FLT_RADIX |
private static java.text.DecimalFormat |
FORMAT |
static double |
INFINITY |
private static org.jruby.util.ByteList |
INFINITY_BYTELIST |
static int |
MANT_DIG |
static int |
MAX_10_EXP |
static int |
MAX_EXP |
static int |
MIN_10_EXP |
static int |
MIN_EXP |
static double |
NAN |
private static org.jruby.util.ByteList |
NAN_BYTELIST |
private static org.jruby.util.ByteList |
NEGATIVE_INFINITY_BYTELIST |
static int |
RADIX |
static int |
ROUNDS |
private double |
value |
DBL_EPSILON, NUMERIC_ALLOCATORFIELD_ALLOCATED_CLASSES, FIELD_ALLOCATORS, IVAR_INSPECTING_OBJECT_ALLOCATOR, OBJECT_ALLOCATOR, OBJECT_VAR0_ALLOCATOR, OBJECT_VAR1_ALLOCATOR, OBJECT_VAR2_ALLOCATOR, OBJECT_VAR3_ALLOCATOR, OBJECT_VAR4_ALLOCATOR, OBJECT_VAR5_ALLOCATOR, OBJECT_VAR6_ALLOCATOR, OBJECT_VAR7_ALLOCATOR, OBJECT_VAR8_ALLOCATOR, OBJECT_VAR9_ALLOCATOR, REIFYING_OBJECT_ALLOCATORALL_F, BASICOBJECT_ALLOCATOR, COMPARE_BY_IDENTITY_F, ERR_INSECURE_SET_INST_VAR, FALSE_F, FL_USHIFT, flags, FROZEN_F, metaClass, NEVER, NIL_F, STAMP_OFFSET, TAINTED_F, UNDEF, UNTRUSTED_F, USER0_F, USER1_F, USER2_F, USER3_F, USER4_F, USER5_F, USER6_F, USER7_F, USER8_F, VAR_TABLE_OFFSET, varTable, varTableStampNULL_ARRAY| Constructor and Description |
|---|
RubyFloat(Ruby runtime) |
RubyFloat(Ruby runtime,
double value) |
| Modifier and Type | Method and Description |
|---|---|
IRubyObject |
abs(ThreadContext context)
flo_abs
|
IRubyObject |
ceil()
flo_ceil
|
IRubyObject |
coerce(IRubyObject other)
flo_coerce
|
int |
compareTo(IRubyObject other)
Compares this Ruby object with another.
|
protected int |
compareValue(RubyNumeric other) |
RubyFloat |
convertToFloat()
Tries to convert this object to a Ruby Float using the "to_f"
method.
|
static RubyClass |
createFloatClass(Ruby runtime) |
IRubyObject |
denominator(ThreadContext context)
flo_denominator
|
IRubyObject |
divmod(ThreadContext context,
IRubyObject other)
flo_divmod
|
IRubyObject |
divmod19(ThreadContext context,
IRubyObject other)
flo_divmod
|
IRubyObject |
eql_p(IRubyObject other)
flo_eql
|
boolean |
fastEqual(RubyFloat other) |
IRubyObject |
finite_p()
flo_is_finite_p
|
IRubyObject |
floor()
floor
|
java.math.BigInteger |
getBigIntegerValue() |
double |
getDoubleValue() |
java.lang.Class<?> |
getJavaClass()
Will return the Java interface that most closely can represent
this object, when working through JAva integration
translations.
|
long |
getLongValue() |
int |
getNativeTypeIndex()
This is overridden in the other concrete Java builtins to provide a fast way
to determine what type they are.
|
double |
getValue()
Getter for property value.
|
RubyFixnum |
hash()
flo_hash
|
int |
hashCode()
Override the Object#hashCode method to make sure that the Ruby
hash is actually used as the hashcode for Ruby objects.
|
static IRubyObject |
induced_from(ThreadContext context,
IRubyObject recv,
IRubyObject number)
rb_flo_induced_from
|
IRubyObject |
infinite_p()
flo_is_infinite_p
|
IRubyObject |
magnitude(ThreadContext context)
flo_abs/1.9
|
IRubyObject |
magnitude(ThreadContext context,
IRubyObject other)
flo_quo
|
private org.jruby.util.ByteList |
marshalDump() |
static void |
marshalTo(RubyFloat aFloat,
MarshalStream output) |
IRubyObject |
nan_p()
flo_is_nan_p
|
static RubyFloat |
newFloat(Ruby runtime,
double value) |
IRubyObject |
numerator(ThreadContext context)
flo_numerator
|
IRubyObject |
op_cmp(ThreadContext context,
double other) |
IRubyObject |
op_cmp(ThreadContext context,
IRubyObject other)
flo_cmp
|
IRubyObject |
op_equal(ThreadContext context,
double other) |
IRubyObject |
op_equal(ThreadContext context,
IRubyObject other)
flo_eq
|
IRubyObject |
op_fdiv(ThreadContext context,
double other) |
IRubyObject |
op_fdiv(ThreadContext context,
IRubyObject other)
flo_div
|
IRubyObject |
op_ge(ThreadContext context,
double other) |
IRubyObject |
op_ge(ThreadContext context,
IRubyObject other)
flo_ge
|
IRubyObject |
op_gt(ThreadContext context,
double other) |
IRubyObject |
op_gt(ThreadContext context,
IRubyObject other)
flo_gt
|
IRubyObject |
op_le(ThreadContext context,
double other) |
IRubyObject |
op_le(ThreadContext context,
IRubyObject other)
flo_le
|
IRubyObject |
op_lt(ThreadContext context,
double other) |
IRubyObject |
op_lt(ThreadContext context,
IRubyObject other)
flo_lt
|
IRubyObject |
op_minus(ThreadContext context,
double other) |
IRubyObject |
op_minus(ThreadContext context,
IRubyObject other)
flo_minus
|
IRubyObject |
op_mod(ThreadContext context,
double other) |
IRubyObject |
op_mod(ThreadContext context,
IRubyObject other)
flo_mod
|
IRubyObject |
op_mod19(ThreadContext context,
IRubyObject other)
flo_mod
|
IRubyObject |
op_mul(ThreadContext context,
double other) |
IRubyObject |
op_mul(ThreadContext context,
IRubyObject other)
flo_mul
|
IRubyObject |
op_plus(ThreadContext context,
double other) |
IRubyObject |
op_plus(ThreadContext context,
IRubyObject other)
flo_plus
|
IRubyObject |
op_pow(ThreadContext context,
double other) |
IRubyObject |
op_pow(ThreadContext context,
IRubyObject other)
flo_pow
|
IRubyObject |
op_pow19(ThreadContext context,
IRubyObject other) |
IRubyObject |
op_uminus()
flo_uminus
|
IRubyObject |
rationalize(ThreadContext context,
IRubyObject[] args)
float_rationalize
|
IRubyObject |
round()
flo_round
|
IRubyObject |
round(ThreadContext context,
IRubyObject[] args) |
IRubyObject |
to_f()
flo_fo
|
IRubyObject |
to_r(ThreadContext context) |
IRubyObject |
to_s()
flo_to_s
|
IRubyObject |
truncate()
flo_truncate
|
static RubyFloat |
unmarshalFrom(UnmarshalStream input) |
private double |
val2dbl() |
IRubyObject |
zero_p()
flo_zero_p
|
abs2, arg, asNumeric, callCoerced, callCoerced, checkInt, coerceBin, coerceBody, coerceCmp, coerceRelOp, conjugate, createNumericClass, dbl_cmp, dbl2num, div, div19, doCoerce, eql_p, fdiv, fix2int, fix2int, fix2long, floatStep, floatStep19, getCoerced, image, initialize_copy, int2fix, integer_p, 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, sadded, scalar_p, step, step, str2fnum, str2fnum, str2fnum19, str2inum, str2inum, to_c, to_int, toJava, zero_pattachToObjectSpace, callInit, callInit, callInit, callInit, callInit, callInit, callInit, callInit, callInit, callInit, convertToType, createObjectClass, eqlInternal, equalInternal, equals, initialize, initialize, inspect, op_eqq, puts, specificEval, toStringaddFinalizer, anyToString, asJavaString, asString, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callSuper, checkArrayType, checkCallMethod, checkFrozen, checkStringType, checkStringType19, convertToArray, convertToHash, convertToInteger, convertToInteger, convertToInteger, convertToString, copyInstanceVariablesInto, copySpecialInstanceVariables, createBasicObjectClass, dataGetStruct, dataGetStructChecked, dataWrapStruct, display, dup, ensureInstanceVariablesSettable, eql, equal_p, equal_p19, evalUnder, extend, fastGetInstanceVariable, fastGetInternalVariable, fastHasInstanceVariable, fastHasInternalVariable, fastSetInstanceVariable, fastSetInternalVariable, freeze, frozen_p, getFFIHandle, getFlag, getInstanceEvalClass, getInstanceVariable, getInstanceVariableList, getInstanceVariableNameList, getInstanceVariables, getInternalVariable, getInternalVariables, getMetaClass, getNativeHandle, getObjectId, getRuntime, getSingletonClass, getSingletonClassClone, getType, getVariable, getVariableCount, getVariableList, getVariableNameList, hashyInspect, hasInstanceVariable, hasInternalVariable, hasVariables, id_deprecated, id, infectBy, infectBy, infectBy, 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, 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, recacheBuiltinMethods, 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, setFFIHandle, setFlag, setFrozen, setInstanceVariable, setInternalVariable, setMetaClass, setNativeHandle, 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, trust, type_deprecated, type, untaint, untrust, untrusted_p, validateInstanceVariable, variableTableContains, variableTableFastContains, variableTableFastFetch, variableTableFastStore, variableTableFetch, variableTableRemove, variableTableStore, variableTableSync, yieldUnder, yieldUnderpublic static final int ROUNDS
public static final int RADIX
public static final int MANT_DIG
public static final int DIG
public static final int MIN_EXP
public static final int MAX_EXP
public static final int MAX_10_EXP
public static final int MIN_10_EXP
public static final double EPSILON
public static final double INFINITY
public static final double NAN
private final double value
private static final java.text.DecimalFormat FORMAT
static final int DBL_MANT_DIG
static final int FLT_RADIX
private static final org.jruby.util.ByteList NAN_BYTELIST
private static final org.jruby.util.ByteList NEGATIVE_INFINITY_BYTELIST
private static final org.jruby.util.ByteList INFINITY_BYTELIST
public RubyFloat(Ruby runtime)
public RubyFloat(Ruby runtime, double value)
public int getNativeTypeIndex()
RubyObjectgetNativeTypeIndex in interface CoreObjectTypegetNativeTypeIndex in class RubyObjectClassIndexpublic java.lang.Class<?> getJavaClass()
RubyBasicObjectgetJavaClass in interface IRubyObjectgetJavaClass in class RubyBasicObjectpublic double getValue()
public double getDoubleValue()
getDoubleValue in class RubyNumericpublic long getLongValue()
getLongValue in class RubyNumericpublic java.math.BigInteger getBigIntegerValue()
getBigIntegerValue in class RubyNumericpublic RubyFloat convertToFloat()
RubyBasicObjectconvertToFloat in interface IRubyObjectconvertToFloat in class RubyBasicObjectprotected int compareValue(RubyNumeric other)
public static IRubyObject induced_from(ThreadContext context, IRubyObject recv, IRubyObject number)
public IRubyObject to_s()
to_s in class RubyBasicObjectpublic IRubyObject coerce(IRubyObject other)
coerce in class RubyNumericpublic IRubyObject op_uminus()
public IRubyObject op_plus(ThreadContext context, IRubyObject other)
public IRubyObject op_plus(ThreadContext context, double other)
public IRubyObject op_minus(ThreadContext context, IRubyObject other)
public IRubyObject op_minus(ThreadContext context, double other)
public IRubyObject op_mul(ThreadContext context, IRubyObject other)
public IRubyObject op_mul(ThreadContext context, double other)
public IRubyObject op_fdiv(ThreadContext context, IRubyObject other)
public IRubyObject op_fdiv(ThreadContext context, double other)
public IRubyObject magnitude(ThreadContext context, IRubyObject other)
public IRubyObject op_mod(ThreadContext context, IRubyObject other)
public IRubyObject op_mod(ThreadContext context, double other)
public IRubyObject op_mod19(ThreadContext context, IRubyObject other)
public IRubyObject divmod(ThreadContext context, IRubyObject other)
divmod in class RubyNumericpublic IRubyObject divmod19(ThreadContext context, IRubyObject other)
divmod19 in class RubyNumericpublic IRubyObject op_pow(ThreadContext context, IRubyObject other)
public IRubyObject op_pow(ThreadContext context, double other)
public IRubyObject op_pow19(ThreadContext context, IRubyObject other)
public IRubyObject op_equal(ThreadContext context, IRubyObject other)
op_equal in interface IRubyObjectop_equal in class RubyBasicObjectpublic IRubyObject op_equal(ThreadContext context, double other)
public boolean fastEqual(RubyFloat other)
public final int compareTo(IRubyObject other)
RubyBasicObjectcompareTo in interface java.lang.Comparable<IRubyObject>compareTo in class RubyBasicObjectother - another IRubyObjectpublic IRubyObject op_cmp(ThreadContext context, IRubyObject other)
op_cmp in class RubyBasicObjectpublic IRubyObject op_cmp(ThreadContext context, double other)
public IRubyObject op_gt(ThreadContext context, IRubyObject other)
public IRubyObject op_gt(ThreadContext context, double other)
public IRubyObject op_ge(ThreadContext context, IRubyObject other)
public IRubyObject op_ge(ThreadContext context, double other)
public IRubyObject op_lt(ThreadContext context, IRubyObject other)
public IRubyObject op_lt(ThreadContext context, double other)
public IRubyObject op_le(ThreadContext context, IRubyObject other)
public IRubyObject op_le(ThreadContext context, double other)
public IRubyObject eql_p(IRubyObject other)
eql_p in class RubyBasicObjectpublic RubyFixnum hash()
hash in class RubyBasicObjectpublic final int hashCode()
RubyObjecthashCode in class RubyObjectpublic IRubyObject to_f()
public IRubyObject abs(ThreadContext context)
abs in class RubyNumericpublic IRubyObject magnitude(ThreadContext context)
magnitude in class RubyNumericpublic IRubyObject zero_p()
public IRubyObject truncate()
truncate in class RubyNumericpublic IRubyObject numerator(ThreadContext context)
numerator in class RubyNumericpublic IRubyObject denominator(ThreadContext context)
denominator in class RubyNumericpublic IRubyObject to_r(ThreadContext context)
public IRubyObject rationalize(ThreadContext context, IRubyObject[] args)
public IRubyObject floor()
floor in class RubyNumericpublic IRubyObject ceil()
ceil in class RubyNumericpublic IRubyObject round()
round in class RubyNumericpublic IRubyObject round(ThreadContext context, IRubyObject[] args)
private double val2dbl()
public IRubyObject nan_p()
public IRubyObject infinite_p()
public IRubyObject finite_p()
private org.jruby.util.ByteList marshalDump()
public static void marshalTo(RubyFloat aFloat, MarshalStream output) throws java.io.IOException
java.io.IOExceptionpublic static RubyFloat unmarshalFrom(UnmarshalStream input) throws java.io.IOException
java.io.IOException