Tabnine Logo
RubyBignum.op_mod
Code IndexAdd Tabnine to your IDE (free)

How to use
op_mod
method
in
org.jruby.RubyBignum

Best Java code snippets using org.jruby.RubyBignum.op_mod (Showing top 6 results out of 315)

origin: org.jruby/jruby-complete

@Deprecated
public IRubyObject op_mod19(ThreadContext context, IRubyObject other) {
  return op_mod(context, other);
}
origin: org.jruby/jruby-core

@Deprecated
public IRubyObject op_mod19(ThreadContext context, IRubyObject other) {
  return op_mod(context, other);
}
origin: org.jruby/jruby-core

/** rb_big_modulo
 *
 */
@JRubyMethod(name = {"%", "modulo"}, required = 1)
public IRubyObject op_mod(ThreadContext context, IRubyObject other) {
  if (other instanceof RubyFixnum) {
    return op_mod(context, ((RubyFixnum) other).getLongValue());
  }
  final BigInteger otherValue;
  if (other instanceof RubyBignum) {
    otherValue = ((RubyBignum) other).value;
    if (otherValue.signum() == 0) throw context.runtime.newZeroDivisionError();
    BigInteger result = value.mod(otherValue.abs());
    if (otherValue.signum() == -1 && result.signum() != 0) result = otherValue.add(result);
    return bignorm(context.runtime, result);
  }
  if (other instanceof RubyFloat && ((RubyFloat) other).getDoubleValue() == 0) {
    throw context.runtime.newZeroDivisionError();
  }
  return coerceBin(context, sites(context).op_mod, other);
}
origin: org.jruby/jruby-complete

/** rb_big_modulo
 *
 */
@JRubyMethod(name = {"%", "modulo"}, required = 1)
public IRubyObject op_mod(ThreadContext context, IRubyObject other) {
  if (other instanceof RubyFixnum) {
    return op_mod(context, ((RubyFixnum) other).getLongValue());
  }
  final BigInteger otherValue;
  if (other instanceof RubyBignum) {
    otherValue = ((RubyBignum) other).value;
    if (otherValue.signum() == 0) throw context.runtime.newZeroDivisionError();
    BigInteger result = value.mod(otherValue.abs());
    if (otherValue.signum() == -1 && result.signum() != 0) result = otherValue.add(result);
    return bignorm(context.runtime, result);
  }
  if (other instanceof RubyFloat && ((RubyFloat) other).getDoubleValue() == 0) {
    throw context.runtime.newZeroDivisionError();
  }
  return coerceBin(context, sites(context).op_mod, other);
}
origin: org.kill-bill.billing/killbill-osgi-bundles-jruby

/** rb_big_modulo
 *
 */
@JRubyMethod(name = {"%", "modulo"}, required = 1, compat = RUBY1_9)
public IRubyObject op_mod19(ThreadContext context, IRubyObject other) {
  if (!other.isNil() && other instanceof RubyFloat
      && ((RubyFloat)other).getDoubleValue() == 0) {
    throw context.runtime.newZeroDivisionError();
  }
  return op_mod(context, other);
}
origin: com.ning.billing/killbill-osgi-bundles-jruby

/** rb_big_modulo
 *
 */
@JRubyMethod(name = {"%", "modulo"}, required = 1, compat = RUBY1_9)
public IRubyObject op_mod19(ThreadContext context, IRubyObject other) {
  if (!other.isNil() && other instanceof RubyFloat
      && ((RubyFloat)other).getDoubleValue() == 0) {
    throw context.runtime.newZeroDivisionError();
  }
  return op_mod(context, other);
}
org.jrubyRubyBignumop_mod

Javadoc

rb_big_modulo

Popular methods of RubyBignum

  • newBignum
  • getLongValue
  • getValue
    Getter for property value.
  • <init>
  • addFloat
  • addOther
  • big2dbl
    rb_big2dbl
  • big2long
    rb_big2long
  • bignorm
    rb_big_norm
  • checkShiftDown
  • coerceBin
  • coerceCmp
  • coerceBin,
  • coerceCmp,
  • compareTo,
  • convertToDouble,
  • createBignumClass,
  • dbl_cmp,
  • divmod,
  • even_p,
  • fix2big,
  • getBigIntegerValue

Popular in Java

  • Updating database using SQL prepared statement
  • startActivity (Activity)
  • notifyDataSetChanged (ArrayAdapter)
  • getSharedPreferences (Context)
  • Socket (java.net)
    Provides a client-side TCP socket.
  • Stack (java.util)
    Stack is a Last-In/First-Out(LIFO) data structure which represents a stack of objects. It enables u
  • TimerTask (java.util)
    The TimerTask class represents a task to run at a specified time. The task may be run once or repeat
  • TimeUnit (java.util.concurrent)
    A TimeUnit represents time durations at a given unit of granularity and provides utility methods to
  • Filter (javax.servlet)
    A filter is an object that performs filtering tasks on either the request to a resource (a servlet o
  • DataSource (javax.sql)
    An interface for the creation of Connection objects which represent a connection to a database. This
  • Top Vim plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now