public class RubyFloat extends RubyNumeric
RubyNumeric.InvalidIntegerException, RubyNumeric.NumberTooLargeException
RubyObject.Data
RubyBasicObject.Finalizer
Modifier and Type | Field and Description |
---|---|
static int |
DIG |
static double |
EPSILON |
static double |
INFINITY |
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 |
static int |
RADIX |
static int |
ROUNDS |
DBL_EPSILON, NUMERIC_ALLOCATOR
FIELD_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_ALLOCATOR
ALL_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, varTableStamp
NULL_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
|
BigInteger |
getBigIntegerValue() |
double |
getDoubleValue() |
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
|
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) |
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, 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_p
attachToObjectSpace, callInit, callInit, callInit, callInit, callInit, callInit, callInit, callInit, callInit, callInit, convertToType, createObjectClass, eqlInternal, equalInternal, equals, initialize, initialize, inspect, op_eqq, puts, specificEval, toString
addFinalizer, 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, 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, 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, yieldUnder
public 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
public RubyFloat(Ruby runtime)
public RubyFloat(Ruby runtime, double value)
public int getNativeTypeIndex()
RubyObject
getNativeTypeIndex
in interface CoreObjectType
getNativeTypeIndex
in class RubyObject
ClassIndex
public Class<?> getJavaClass()
RubyBasicObject
getJavaClass
in interface IRubyObject
getJavaClass
in class RubyBasicObject
public double getValue()
public double getDoubleValue()
getDoubleValue
in class RubyNumeric
public long getLongValue()
getLongValue
in class RubyNumeric
public BigInteger getBigIntegerValue()
getBigIntegerValue
in class RubyNumeric
public RubyFloat convertToFloat()
RubyBasicObject
convertToFloat
in interface IRubyObject
convertToFloat
in class RubyBasicObject
protected int compareValue(RubyNumeric other)
public static IRubyObject induced_from(ThreadContext context, IRubyObject recv, IRubyObject number)
public IRubyObject to_s()
to_s
in class RubyBasicObject
public IRubyObject coerce(IRubyObject other)
coerce
in class RubyNumeric
public 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 RubyNumeric
public IRubyObject divmod19(ThreadContext context, IRubyObject other)
divmod19
in class RubyNumeric
public 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 IRubyObject
op_equal
in class RubyBasicObject
public IRubyObject op_equal(ThreadContext context, double other)
public boolean fastEqual(RubyFloat other)
public final int compareTo(IRubyObject other)
RubyBasicObject
compareTo
in interface Comparable<IRubyObject>
compareTo
in class RubyBasicObject
other
- another IRubyObjectpublic IRubyObject op_cmp(ThreadContext context, IRubyObject other)
op_cmp
in class RubyBasicObject
public 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 RubyBasicObject
public RubyFixnum hash()
hash
in class RubyBasicObject
public final int hashCode()
RubyObject
hashCode
in class RubyObject
public IRubyObject to_f()
public IRubyObject abs(ThreadContext context)
abs
in class RubyNumeric
public IRubyObject magnitude(ThreadContext context)
magnitude
in class RubyNumeric
public IRubyObject zero_p()
public IRubyObject truncate()
truncate
in class RubyNumeric
public IRubyObject numerator(ThreadContext context)
numerator
in class RubyNumeric
public IRubyObject denominator(ThreadContext context)
denominator
in class RubyNumeric
public IRubyObject to_r(ThreadContext context)
public IRubyObject rationalize(ThreadContext context, IRubyObject[] args)
public IRubyObject floor()
floor
in class RubyNumeric
public IRubyObject ceil()
ceil
in class RubyNumeric
public IRubyObject round()
round
in class RubyNumeric
public IRubyObject round(ThreadContext context, IRubyObject[] args)
public IRubyObject nan_p()
public IRubyObject infinite_p()
public IRubyObject finite_p()
public static void marshalTo(RubyFloat aFloat, MarshalStream output) throws IOException
IOException
public static RubyFloat unmarshalFrom(UnmarshalStream input) throws IOException
IOException
Copyright © 2001-2013 JRuby. All Rights Reserved.