Codota Logo
RubyBignum.coerceBin
Code IndexAdd Codota 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)

  • Common ways to obtain RubyBignum
private void myMethod () {
RubyBignum r =
  • Codota IconRubyRandom.RandomType rubyRandomRandomType;rubyRandomRandomType.getState()
  • Codota IconRuby runtime;String value;new RubyBignum(runtime, new BigInteger(value))
  • Codota IconRuby runtime;RubyBignum.newBignum(runtime, value)
  • Smart code suggestions by Codota
}
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: 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: 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_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

  • Creating JSON documents from java classes using gson
  • notifyDataSetChanged (ArrayAdapter)
  • setRequestProperty (URLConnection)
    Sets the general request property. If a property with the key already exists, overwrite its value wi
  • getExternalFilesDir (Context)
  • FlowLayout (java.awt)
    A flow layout arranges components in a left-to-right flow, much like lines of text in a paragraph. F
  • PrintWriter (java.io)
    Prints formatted representations of objects to a text-output stream. This class implements all of th
  • BitSet (java.util)
    This class implements a vector of bits that grows as needed. Each component of the bit set has a boo
  • ResourceBundle (java.util)
    Resource bundles contain locale-specific objects. When your program needs a locale-specific resource
  • Vector (java.util)
    The Vector class implements a growable array of objects. Like an array, it contains components that
  • Servlet (javax.servlet)
    Defines methods that all servlets must implement.A servlet is a small Java program that runs within
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now