|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jruby.RubyObject
org.jruby.RubyNumeric
Field Summary |
Fields inherited from class org.jruby.RubyObject |
runtime |
Fields inherited from interface org.jruby.runtime.builtin.IRubyObject |
NULL_ARRAY |
Constructor Summary | |
RubyNumeric(Ruby ruby,
RubyClass rubyClass)
|
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public RubyNumeric(Ruby ruby, RubyClass rubyClass)
Method Detail |
public abstract double getDoubleValue()
public abstract long getLongValue()
public long getTruncatedLongValue()
public static RubyClass createNumericClass(Ruby ruby)
public static long num2long(IRubyObject arg)
public static long fix2long(IRubyObject arg)
public static int fix2int(IRubyObject arg)
public static final RubyNumeric numericValue(IRubyObject arg)
public static RubyInteger str2inum(Ruby ruby, RubyString str, int base)
base
is zero, strings that begin with '0[xX]',
'0[bB]', or '0' (optionally preceded by a sign) will be treated as hex,
binary, or octal numbers, respectively. If a non-zero base is given,
only the prefix (if any) that is appropriate to that base will be
parsed correctly. For example, if the base is zero or 16, the string
"0xff" will be converted to 256, but if the base is 10, it will come out
as zero, since 'x' is not a valid decimal digit. If the string fails
to parse as a number, zero is returned.
ruby
- the ruby runtimestr
- the string to be convertedbase
- the expected base of the number (2, 8, 10 or 16), or 0
if the method should determine the base automatically
(defaults to 10).
public static RubyFloat str2fnum(Ruby ruby, RubyString arg)
ruby
- the ruby runtimearg
- the string to be converted
public RubyArray coerce(RubyNumeric other)
public RubyNumeric[] getCoerce(RubyNumeric other)
public IRubyObject rbClone()
rbClone
in interface IRubyObject
rbClone
in class RubyObject
public RubyNumeric op_uplus()
public RubyNumeric op_uminus()
public RubyNumeric cmp(RubyNumeric other)
public RubyArray divmod(RubyNumeric other)
public RubyNumeric modulo(RubyNumeric other)
public RubyNumeric remainder(RubyNumeric other)
protected int compareValue(RubyNumeric other)
public RubyBoolean veryEqual(IRubyObject other)
public RubyBoolean equal(IRubyObject other)
equal
in class RubyObject
public RubyBoolean eql(IRubyObject other)
public RubyNumeric abs()
public RubyBoolean int_p()
public RubyBoolean zero_p()
public IRubyObject nonzero_p()
public RubyInteger floor()
public RubyInteger ceil()
public RubyInteger round()
public RubyInteger truncate()
public RubyNumeric multiplyWith(RubyFixnum value)
public abstract RubyNumeric multiplyWith(RubyInteger value)
public abstract RubyNumeric multiplyWith(RubyFloat value)
public abstract RubyNumeric multiplyWith(RubyBignum value)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |