congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
RubyBignum.op_mul
Code IndexAdd Tabnine to your IDE (free)

How to use
op_mul
method
in
org.jruby.RubyBignum

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

origin: org.jruby/jruby-complete

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

@Deprecated
public final IRubyObject op_mul19(ThreadContext context, IRubyObject other) {
  return op_mul(context, other);
}
origin: org.jruby/jruby-complete

@Override
public IRubyObject op_mul(ThreadContext context, long otherValue) {
  Ruby runtime = context.runtime;
  try {
    return newFixnum(runtime, Math.multiplyExact(value, otherValue));
  } catch (ArithmeticException ae) {
    return RubyBignum.newBignum(runtime, value).op_mul(context, otherValue);
  }
}
origin: org.jruby/jruby-core

@Override
public IRubyObject op_mul(ThreadContext context, long otherValue) {
  Ruby runtime = context.runtime;
  try {
    return newFixnum(runtime, Math.multiplyExact(value, otherValue));
  } catch (ArithmeticException ae) {
    return RubyBignum.newBignum(runtime, value).op_mul(context, otherValue);
  }
}
origin: com.ning.billing/killbill-osgi-bundles-jruby

private IRubyObject multiplyOther(ThreadContext context, IRubyObject other) {
  Ruby runtime = context.runtime;
  if (other instanceof RubyBignum) {
    return ((RubyBignum) other).op_mul(context, this);
  } else if (other instanceof RubyFloat) {
    return runtime.newFloat((double) value * ((RubyFloat) other).getDoubleValue());
  }
  return coerceBin(context, "*", other);
}
origin: org.kill-bill.billing/killbill-osgi-bundles-jruby

private IRubyObject multiplyOther(ThreadContext context, IRubyObject other) {
  Ruby runtime = context.runtime;
  if (other instanceof RubyBignum) {
    return ((RubyBignum) other).op_mul(context, this);
  } else if (other instanceof RubyFloat) {
    return runtime.newFloat((double) value * ((RubyFloat) other).getDoubleValue());
  }
  return coerceBin(context, "*", other);
}
origin: org.jruby/jruby-complete

private IRubyObject multiplyOther(ThreadContext context, IRubyObject other) {
  Ruby runtime = context.runtime;
  if (other instanceof RubyBignum) {
    return ((RubyBignum) other).op_mul(context, this.value);
  }
  if (other instanceof RubyFloat) {
    return runtime.newFloat((double) value * ((RubyFloat) other).getDoubleValue());
  }
  return coerceBin(context, sites(context).op_times, other);
}
origin: org.jruby/jruby-core

private IRubyObject multiplyOther(ThreadContext context, IRubyObject other) {
  Ruby runtime = context.runtime;
  if (other instanceof RubyBignum) {
    return ((RubyBignum) other).op_mul(context, this.value);
  }
  if (other instanceof RubyFloat) {
    return runtime.newFloat((double) value * ((RubyFloat) other).getDoubleValue());
  }
  return coerceBin(context, sites(context).op_times, other);
}
origin: org.jruby/jruby-complete

/** f_imul
 * 
 */
private static RubyInteger f_imul(ThreadContext context, long a, long b) {
  Ruby runtime = context.runtime;
  if (a == 0 || b == 0) {
    return RubyFixnum.zero(runtime);
  }
  if (a == 1) {
    return RubyFixnum.newFixnum(runtime, b);
  }
  if (b == 1) {
    return RubyFixnum.newFixnum(runtime, a);
  }
  long c = a * b;
  if (c / a != b) {
    return (RubyInteger) RubyBignum.newBignum(runtime, a).op_mul(context, b);
  }
  return RubyFixnum.newFixnum(runtime, c);
}

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

/** f_imul
 * 
 */
private static RubyInteger f_imul(ThreadContext context, long a, long b) {
  Ruby runtime = context.runtime;
  if (a == 0 || b == 0) {
    return RubyFixnum.zero(runtime);
  }
  if (a == 1) {
    return RubyFixnum.newFixnum(runtime, b);
  }
  if (b == 1) {
    return RubyFixnum.newFixnum(runtime, a);
  }
  long c = a * b;
  if (c / a != b) {
    return (RubyInteger) RubyBignum.newBignum(runtime, a).op_mul(context, b);
  }
  return RubyFixnum.newFixnum(runtime, c);
}

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: org.jruby/jruby-complete

if (!fitSqrtLong(x)) {
  IRubyObject v = RubyBignum.newBignum(runtime, x).op_pow(context, y);
  if (z != 1) v = RubyBignum.newBignum(runtime, neg ? -z : z).op_mul(context, v);
  return (RubyNumeric) v;
if (z != 1) v = RubyBignum.newBignum(runtime, neg ? -z : z).op_mul(context, v);
return (RubyNumeric) v;
origin: org.jruby/jruby-core

if (!fitSqrtLong(x)) {
  IRubyObject v = RubyBignum.newBignum(runtime, x).op_pow(context, y);
  if (z != 1) v = RubyBignum.newBignum(runtime, neg ? -z : z).op_mul(context, v);
  return (RubyNumeric) v;
if (z != 1) v = RubyBignum.newBignum(runtime, neg ? -z : z).op_mul(context, v);
return (RubyNumeric) v;
origin: com.ning.billing/killbill-osgi-bundles-jruby

/** f_imul
 * 
 */
private static IRubyObject f_imul(ThreadContext context, long a, long b) {
  Ruby runtime = context.runtime;
  if (a == 0 || b == 0) {
    return RubyFixnum.zero(runtime);
  } else if (a == 1) {
    return RubyFixnum.newFixnum(runtime, b);
  } else if (b == 1) {
    return RubyFixnum.newFixnum(runtime, a);
  }
  long c = a * b;
  if(c / a != b) {
    return RubyBignum.newBignum(runtime, a).op_mul(context, RubyBignum.newBignum(runtime, b));
  }
  return RubyFixnum.newFixnum(runtime, c);
}

origin: org.kill-bill.billing/killbill-osgi-bundles-jruby

/** f_imul
 * 
 */
private static IRubyObject f_imul(ThreadContext context, long a, long b) {
  Ruby runtime = context.runtime;
  if (a == 0 || b == 0) {
    return RubyFixnum.zero(runtime);
  } else if (a == 1) {
    return RubyFixnum.newFixnum(runtime, b);
  } else if (b == 1) {
    return RubyFixnum.newFixnum(runtime, a);
  }
  long c = a * b;
  if(c / a != b) {
    return RubyBignum.newBignum(runtime, a).op_mul(context, RubyBignum.newBignum(runtime, b));
  }
  return RubyFixnum.newFixnum(runtime, c);
}

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

return RubyBignum.newBignum(runtime, value).op_mul(context, otherValue);
origin: org.kill-bill.billing/killbill-osgi-bundles-jruby

return RubyBignum.newBignum(runtime, value).op_mul(context, otherValue);
origin: com.ning.billing/killbill-osgi-bundles-jruby

RubyBignum big = RubyBignum.newBignum(runtime, ul);
while(occurrences > 0 && pos < encode.limit()) {
  big = (RubyBignum)big.op_mul(runtime.getCurrentContext(), big128);
  IRubyObject v = big.op_plus(runtime.getCurrentContext(),
      RubyBignum.newBignum(runtime, encode.get(pos) & 0x7f));
origin: org.jruby/jruby-complete

RubyBignum big = RubyBignum.newBignum(runtime, ul);
while(occurrences > 0 && pos < encode.limit()) {
  IRubyObject mulResult = big.op_mul(runtime.getCurrentContext(), big128);
  IRubyObject v = mulResult.callMethod(runtime.getCurrentContext(), "+",
      RubyBignum.newBignum(runtime, encode.get(pos) & 0x7f));
org.jrubyRubyBignumop_mul

Javadoc

rb_big_mul

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

  • Running tasks concurrently on multiple threads
  • getContentResolver (Context)
  • scheduleAtFixedRate (Timer)
  • notifyDataSetChanged (ArrayAdapter)
  • FileNotFoundException (java.io)
    Thrown when a file specified by a program cannot be found.
  • BigDecimal (java.math)
    An immutable arbitrary-precision signed decimal.A value is represented by an arbitrary-precision "un
  • SQLException (java.sql)
    An exception that indicates a failed JDBC operation. It provides the following information about pro
  • ZipFile (java.util.zip)
    This class provides random read access to a zip file. You pay more to read the zip file's central di
  • JList (javax.swing)
  • JOptionPane (javax.swing)
  • Top PhpStorm 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