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

How to use
coerceBin
method
in
org.jruby.RubyBignum

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

origin: com.ning.billing/killbill-osgi-bundles-jruby

private IRubyObject addOther(ThreadContext context, IRubyObject other) {
  return coerceBin(context, "+", other);
}
origin: org.kill-bill.billing/killbill-osgi-bundles-jruby

private IRubyObject subtractOther(ThreadContext context, IRubyObject other) {
  return coerceBin(context, "-", other);
}
origin: com.ning.billing/killbill-osgi-bundles-jruby

private IRubyObject subtractOther(ThreadContext context, IRubyObject other) {
  return coerceBin(context, "-", other);
}
origin: org.kill-bill.billing/killbill-osgi-bundles-jruby

private IRubyObject addOther(ThreadContext context, IRubyObject other) {
  return coerceBin(context, "+", other);
}
origin: org.jruby/jruby-complete

private IRubyObject subtractOther(ThreadContext context, IRubyObject other) {
  return coerceBin(context, sites(context).op_minus, other);
}
origin: org.jruby/jruby-complete

private IRubyObject addOther(ThreadContext context, IRubyObject other) {
  return coerceBin(context, sites(context).op_plus, other);
}
origin: org.jruby/jruby-core

private IRubyObject subtractOther(ThreadContext context, IRubyObject other) {
  return coerceBin(context, sites(context).op_minus, other);
}
origin: org.jruby/jruby-core

private IRubyObject addOther(ThreadContext context, IRubyObject other) {
  return coerceBin(context, sites(context).op_plus, other);
}
origin: com.ning.billing/killbill-osgi-bundles-jruby

public IRubyObject opMulOther(ThreadContext context, IRubyObject other) {
  if (other instanceof RubyFloat) {
    return RubyFloat.newFloat(getRuntime(), big2dbl(this) * ((RubyFloat) other).getDoubleValue());
  }
  return coerceBin(context, "*", other);
}
origin: org.kill-bill.billing/killbill-osgi-bundles-jruby

public IRubyObject opMulOther(ThreadContext context, IRubyObject other) {
  if (other instanceof RubyFloat) {
    return RubyFloat.newFloat(getRuntime(), big2dbl(this) * ((RubyFloat) other).getDoubleValue());
  }
  return coerceBin(context, "*", other);
}
origin: com.ning.billing/killbill-osgi-bundles-jruby

/** rb_big_and
 *
 */
@JRubyMethod(name = "&", required = 1, compat = RUBY1_8)
public IRubyObject op_and(ThreadContext context, IRubyObject other) {
  other = other.convertToInteger();
  if (other instanceof RubyBignum) {
    return bignorm(getRuntime(), value.and(((RubyBignum) other).value));
  } else if (other instanceof RubyFixnum) {
    return bignorm(getRuntime(), value.and(fix2big((RubyFixnum)other)));
  }
  return coerceBin(context, "&", other);
}
origin: org.kill-bill.billing/killbill-osgi-bundles-jruby

/** rb_big_and
 *
 */
@JRubyMethod(name = "&", required = 1, compat = RUBY1_8)
public IRubyObject op_and(ThreadContext context, IRubyObject other) {
  other = other.convertToInteger();
  if (other instanceof RubyBignum) {
    return bignorm(getRuntime(), value.and(((RubyBignum) other).value));
  } else if (other instanceof RubyFixnum) {
    return bignorm(getRuntime(), value.and(fix2big((RubyFixnum)other)));
  }
  return coerceBin(context, "&", other);
}
origin: org.kill-bill.billing/killbill-osgi-bundles-jruby

/** rb_big_quo
 *
 */
@JRubyMethod(name = "quo", required = 1, compat = RUBY1_8)
@Override
public IRubyObject quo(ThreadContext context, IRubyObject other) {
  if (other instanceof RubyNumeric) {
    return RubyFloat.newFloat(getRuntime(), big2dbl(this) / ((RubyNumeric) other).getDoubleValue());
  } else {
    return coerceBin(context, "quo", other);
  }
}
origin: com.ning.billing/killbill-osgi-bundles-jruby

/** rb_big_quo
 *
 */
@JRubyMethod(name = "quo", required = 1, compat = RUBY1_8)
@Override
public IRubyObject quo(ThreadContext context, IRubyObject other) {
  if (other instanceof RubyNumeric) {
    return RubyFloat.newFloat(getRuntime(), big2dbl(this) / ((RubyNumeric) other).getDoubleValue());
  } else {
    return coerceBin(context, "quo", other);
  }
}
origin: org.jruby/jruby-complete

/** rb_big_mul
 *
 */
@JRubyMethod(name = "*", required = 1)
public IRubyObject op_mul(ThreadContext context, IRubyObject other) {
  if (other instanceof RubyFixnum) {
    return op_mul(context, ((RubyFixnum) other).getLongValue());
  }
  if (other instanceof RubyBignum) {
    return bignorm(context.runtime, value.multiply(((RubyBignum) other).value));
  }
  if (other instanceof RubyFloat) {
    return RubyFloat.newFloat(context.runtime, big2dbl(this) * ((RubyFloat) other).getDoubleValue());
  }
  return coerceBin(context, sites(context).op_times, other);
}
origin: org.jruby/jruby-core

/** rb_big_mul
 *
 */
@JRubyMethod(name = "*", required = 1)
public IRubyObject op_mul(ThreadContext context, IRubyObject other) {
  if (other instanceof RubyFixnum) {
    return op_mul(context, ((RubyFixnum) other).getLongValue());
  }
  if (other instanceof RubyBignum) {
    return bignorm(context.runtime, value.multiply(((RubyBignum) other).value));
  }
  if (other instanceof RubyFloat) {
    return RubyFloat.newFloat(context.runtime, big2dbl(this) * ((RubyFloat) other).getDoubleValue());
  }
  return coerceBin(context, sites(context).op_times, other);
}
origin: com.ning.billing/killbill-osgi-bundles-jruby

/** rb_big_xor
 *
 */
@JRubyMethod(name = "^", required = 1, compat = RUBY1_8)
public IRubyObject op_xor(ThreadContext context, IRubyObject other) {
  other = other.convertToInteger();
  if (other instanceof RubyBignum) {
    return bignorm(getRuntime(), value.xor(((RubyBignum) other).value));
  }
  if (other instanceof RubyFixnum) {
    return bignorm(getRuntime(), value.xor(BigInteger.valueOf(((RubyFixnum) other).getLongValue())));
  }
  return coerceBin(context, "^", other);
}
origin: org.kill-bill.billing/killbill-osgi-bundles-jruby

/** rb_big_xor
 *
 */
@JRubyMethod(name = "^", required = 1, compat = RUBY1_8)
public IRubyObject op_xor(ThreadContext context, IRubyObject other) {
  other = other.convertToInteger();
  if (other instanceof RubyBignum) {
    return bignorm(getRuntime(), value.xor(((RubyBignum) other).value));
  }
  if (other instanceof RubyFixnum) {
    return bignorm(getRuntime(), value.xor(BigInteger.valueOf(((RubyFixnum) other).getLongValue())));
  }
  return coerceBin(context, "^", other);
}
origin: com.ning.billing/killbill-osgi-bundles-jruby

/** rb_big_or
 *
 */
@JRubyMethod(name = "|", required = 1, compat = RUBY1_8)
public IRubyObject op_or(ThreadContext context, IRubyObject other) {
  other = other.convertToInteger();
  if (other instanceof RubyBignum) {
    return bignorm(getRuntime(), value.or(((RubyBignum) other).value));
  }
  if (other instanceof RubyFixnum) { // no bignorm here needed
    return bignorm(getRuntime(), value.or(fix2big((RubyFixnum)other)));
  }
  return coerceBin(context, "|", other);
}
origin: org.kill-bill.billing/killbill-osgi-bundles-jruby

/** rb_big_or
 *
 */
@JRubyMethod(name = "|", required = 1, compat = RUBY1_8)
public IRubyObject op_or(ThreadContext context, IRubyObject other) {
  other = other.convertToInteger();
  if (other instanceof RubyBignum) {
    return bignorm(getRuntime(), value.or(((RubyBignum) other).value));
  }
  if (other instanceof RubyFixnum) { // no bignorm here needed
    return bignorm(getRuntime(), value.or(fix2big((RubyFixnum)other)));
  }
  return coerceBin(context, "|", other);
}
org.jrubyRubyBignumcoerceBin

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
  • coerceCmp
  • compareTo
  • coerceCmp,
  • compareTo,
  • convertToDouble,
  • createBignumClass,
  • dbl_cmp,
  • divmod,
  • even_p,
  • fix2big,
  • getBigIntegerValue

Popular in Java

  • Making http requests using okhttp
  • runOnUiThread (Activity)
  • setContentView (Activity)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • HttpServer (com.sun.net.httpserver)
    This class implements a simple HTTP server. A HttpServer is bound to an IP address and port number a
  • System (java.lang)
    Provides access to system-related information and resources including standard input and output. Ena
  • URLConnection (java.net)
    A connection to a URL for reading or writing. For HTTP connections, see HttpURLConnection for docume
  • ConcurrentHashMap (java.util.concurrent)
    A plug-in replacement for JDK1.5 java.util.concurrent.ConcurrentHashMap. This version is based on or
  • ExecutorService (java.util.concurrent)
    An Executor that provides methods to manage termination and methods that can produce a Future for tr
  • Executors (java.util.concurrent)
    Factory and utility methods for Executor, ExecutorService, ScheduledExecutorService, ThreadFactory,
  • From CI to AI: The AI layer in your organization
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