Package org.jruby.util
Class Numeric
java.lang.Object
org.jruby.util.Numeric
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classstatic final class -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidcheckInteger(ThreadContext context, IRubyObject obj) Deprecated.static RubyFloatf_abs(ThreadContext context, RubyFloat x) static RubyIntegerf_abs(ThreadContext context, RubyInteger x) static IRubyObjectf_abs(ThreadContext context, IRubyObject x) f_absstatic IRubyObjectf_abs2(ThreadContext context, IRubyObject x) f_abs2static RubyIntegerf_add(ThreadContext context, RubyInteger x, RubyInteger y) static IRubyObjectf_add(ThreadContext context, IRubyObject x, IRubyObject y) f_addstatic IRubyObjectf_arg(ThreadContext context, IRubyObject x) f_argstatic RubyFixnumf_cmp(ThreadContext context, RubyInteger x, long y) static RubyFixnumf_cmp(ThreadContext context, RubyInteger x, RubyInteger y) static IRubyObjectf_cmp(ThreadContext context, IRubyObject x, IRubyObject y) f_cmpstatic IRubyObjectf_conjugate(ThreadContext context, IRubyObject x) f_conjugatestatic IRubyObjectf_denominator(ThreadContext context, IRubyObject x) f_denominatorstatic IRubyObjectf_div(ThreadContext context, IRubyObject x, IRubyObject y) f_divstatic IRubyObjectf_divmod(ThreadContext context, RubyInteger x, IRubyObject y) static IRubyObjectf_divmod(ThreadContext context, IRubyObject x, IRubyObject y) f_divmodstatic booleanf_eqeq_p(ThreadContext context, IRubyObject x, IRubyObject y) static IRubyObjectf_equal(ThreadContext context, RubyInteger x, RubyInteger y) static IRubyObjectf_equal(ThreadContext context, IRubyObject a, IRubyObject b) f_equal Note: This may not return a value which is a boolean.static booleanf_exact_p(ThreadContext context, IRubyObject x) f_exact_pstatic RubyNumericf_expt(ThreadContext context, RubyInteger x, RubyInteger y) static IRubyObjectf_expt(ThreadContext context, IRubyObject x, IRubyObject y) f_exptstatic IRubyObjectf_floor(ThreadContext context, IRubyObject x) f_floorstatic RubyIntegerf_gcd(ThreadContext context, RubyInteger x, RubyInteger y) static IRubyObjectf_gcd(ThreadContext context, IRubyObject x, IRubyObject y) f_gcdstatic booleanf_gt_p(ThreadContext context, RubyInteger x, RubyInteger y) static booleanf_gt_p(ThreadContext context, IRubyObject x, IRubyObject y) f_gt_pstatic RubyIntegerf_idiv(ThreadContext context, RubyInteger x, RubyInteger y) static IRubyObjectf_idiv(ThreadContext context, IRubyObject x, IRubyObject y) f_idivstatic IRubyObjectf_inspect(ThreadContext context, IRubyObject x) f_inspectstatic booleanf_integer_p(ThreadContext context, RubyNumeric x) static booleanf_integer_p(ThreadContext context, IRubyObject x) f_integer_pstatic IRubyObjectf_lcm(ThreadContext context, IRubyObject x, IRubyObject y) f_lcmstatic IRubyObjectf_lshift(ThreadContext context, IRubyObject x, IRubyObject y) f_lshiftstatic booleanf_lt_p(ThreadContext context, RubyInteger x, RubyInteger y) static booleanf_lt_p(ThreadContext context, IRubyObject x, IRubyObject y) f_lt_pstatic booleanf_minus_one_p(ThreadContext context, IRubyObject x) f_minus_one_pstatic IRubyObjectf_mod(ThreadContext context, IRubyObject x, IRubyObject y) f_modstatic RubyIntegerf_mul(ThreadContext context, RubyInteger x, RubyInteger y) static IRubyObjectf_mul(ThreadContext context, IRubyObject x, IRubyObject y) f_mulstatic RubyIntegerf_negate(ThreadContext context, RubyInteger x) static IRubyObjectf_negate(ThreadContext context, IRubyObject x) f_negatestatic booleanf_negative_p(ThreadContext context, RubyFloat x) static booleanf_negative_p(ThreadContext context, RubyInteger x) static booleanf_negative_p(ThreadContext context, IRubyObject x) f_negative_pstatic IRubyObjectf_numerator(ThreadContext context, IRubyObject x) f_numeratorstatic booleanf_odd_p(ThreadContext context, IRubyObject i) f_odd_pstatic booleanf_one_p(ThreadContext context, IRubyObject x) f_one_pstatic IRubyObjectf_polar(ThreadContext context, IRubyObject x) f_polarstatic IRubyObjectf_quo(ThreadContext context, RubyFloat x, RubyFloat y) static IRubyObjectf_quo(ThreadContext context, IRubyObject x, IRubyObject y) f_quostatic booleanf_real_p(ThreadContext context, IRubyObject x) f_real_pstatic IRubyObjectf_reciprocal(ThreadContext context, IRubyObject x) MRI: f_reciprocalstatic IRubyObjectf_rshift(ThreadContext context, IRubyObject x, IRubyObject y) f_rshiftstatic RubyIntegerf_sub(ThreadContext context, RubyInteger x, RubyInteger y) static IRubyObjectf_sub(ThreadContext context, IRubyObject x, IRubyObject y) f_substatic IRubyObjectf_to_f(ThreadContext context, IRubyObject x) f_to_fstatic IRubyObjectf_to_i(ThreadContext context, IRubyObject x) f_to_istatic RubyNumericf_to_r(ThreadContext context, RubyInteger x) static IRubyObjectf_to_r(ThreadContext context, IRubyObject x) f_to_rstatic IRubyObjectf_to_s(ThreadContext context, IRubyObject x) f_to_sstatic IRubyObjectf_truncate(ThreadContext context, IRubyObject x) f_truncatestatic IRubyObjectf_xor(ThreadContext context, RubyInteger x, RubyInteger y) static IRubyObjectf_xor(ThreadContext context, IRubyObject x, IRubyObject y) f_xorstatic booleanf_zero_p(ThreadContext context, RubyInteger x) static booleanf_zero_p(ThreadContext context, IRubyObject x) f_zero_pstatic doublefrexp(double mantissa, long[] e) static longi_gcd(long x, long y) i_gcdstatic longi_ilog2(ThreadContext context, RubyInteger x) static longi_ilog2(ThreadContext context, IRubyObject x) static RubyNumericint_pow(ThreadContext context, long x, long y) protected static booleanCheck if the Fixnum passed is equal to Long.MAX_VALUE.static booleanstatic booleank_exact_zero_p(ThreadContext context, IRubyObject x) MRI: k_exact_zero_pstatic booleanstatic booleanstatic booleanstatic doubleldexp(double f, long e) static booleanmultiplyOverflows(long a, long b) static IRubyObjectnum_pow(ThreadContext context, IRubyObject x, IRubyObject y) static IRubyObject[]nurat_rationalize_internal(ThreadContext context, IRubyObject[] ary) static IRubyObject[]nurat_rationalize_internal(ThreadContext context, IRubyObject a, IRubyObject b) static longrotl(long bits, int rot) Rotate the given long bits left.static longrotr(long bits, int rot) Rotate the given long bits right.static IRubyObjectsafe_mul(ThreadContext context, IRubyObject a, IRubyObject b, boolean az, boolean bz)
-
Field Details
-
CANON
public static final boolean CANON- See Also:
-
-
Constructor Details
-
Numeric
public Numeric()
-
-
Method Details
-
f_add
f_add -
f_add
-
f_cmp
f_cmp -
f_cmp
-
f_cmp
-
f_div
f_div -
f_gt_p
f_gt_p -
f_gt_p
-
f_lt_p
f_lt_p -
f_lt_p
-
f_mod
f_mod -
f_mul
f_mul -
f_mul
-
safe_mul
public static IRubyObject safe_mul(ThreadContext context, IRubyObject a, IRubyObject b, boolean az, boolean bz) -
f_sub
f_sub -
f_sub
-
f_xor
f_xor -
f_xor
-
f_abs
f_abs -
f_abs
-
f_abs
-
f_abs2
f_abs2 -
f_arg
f_arg -
f_conjugate
f_conjugate -
f_denominator
f_denominator -
f_exact_p
f_exact_p -
f_numerator
f_numerator -
f_polar
f_polar -
f_real_p
f_real_p -
f_integer_p
f_integer_p -
f_integer_p
-
f_divmod
f_divmod -
f_divmod
-
f_floor
f_floor -
f_inspect
f_inspect -
f_negate
f_negate -
f_negate
-
f_to_f
f_to_f -
f_to_i
f_to_i -
f_to_r
f_to_r -
f_to_r
-
f_to_s
f_to_s -
f_truncate
f_truncate -
f_equal
f_equal Note: This may not return a value which is a boolean. other.== can return non-boolean (which unless it is nil it will be isTrue()). -
f_equal
-
f_expt
f_expt -
f_expt
-
f_idiv
f_idiv -
f_idiv
-
f_quo
f_quo -
f_quo
-
f_reciprocal
MRI: f_reciprocal -
f_rshift
f_rshift -
f_lshift
f_lshift -
f_negative_p
f_negative_p -
f_negative_p
-
f_negative_p
-
f_zero_p
f_zero_p -
f_zero_p
-
f_one_p
f_one_p -
f_minus_one_p
f_minus_one_p -
f_odd_p
f_odd_p -
i_gcd
public static long i_gcd(long x, long y) i_gcd -
f_gcd
f_gcd -
f_gcd
-
isLongMinValue
Check if the Fixnum passed is equal to Long.MAX_VALUE.- Parameters:
x- the Fixnum to compare- Returns:
- true if it is equal to Long.MAX_VALUE, false otherwise.
-
f_lcm
f_lcm -
i_ilog2
-
i_ilog2
-
ldexp
public static double ldexp(double f, long e) -
frexp
public static double frexp(double mantissa, long[] e) -
int_pow
-
num_pow
-
multiplyOverflows
public static boolean multiplyOverflows(long a, long b) -
k_exact_p
-
k_exact_zero_p
MRI: k_exact_zero_p -
k_inexact_p
-
k_integer_p
-
k_numeric_p
-
rotl
public static long rotl(long bits, int rot) Rotate the given long bits left.- Parameters:
bits- the bits to rotaterot- how many bit positions to rotate- Returns:
- the rotated value
-
rotr
public static long rotr(long bits, int rot) Rotate the given long bits right.- Parameters:
bits- the bits to rotaterot- how many bit positions to rotate- Returns:
- the rotated value
-
nurat_rationalize_internal
public static IRubyObject[] nurat_rationalize_internal(ThreadContext context, IRubyObject a, IRubyObject b) -
nurat_rationalize_internal
-
f_eqeq_p
-
checkInteger
Deprecated.
-