congrats Icon
New! Announcing our next generation AI code completions
Read here
Tabnine Logo
RubyBignum.big2dbl
Code IndexAdd Tabnine to your IDE (free)

How to use
big2dbl
method
in
org.jruby.RubyBignum

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

origin: org.jruby/jruby-complete

@Override
public double getDoubleValue() {
  return big2dbl(this);
}
origin: org.jruby/jruby-core

@Override
public double getDoubleValue() {
  return big2dbl(this);
}
origin: org.kill-bill.billing/killbill-osgi-bundles-jruby

@Override
public double getDoubleValue() {
  return big2dbl(this);
}
origin: com.ning.billing/killbill-osgi-bundles-jruby

@Override
public double getDoubleValue() {
  return big2dbl(this);
}
origin: org.jruby/jruby-complete

private RubyNumeric pow(final Ruby runtime, final double d) {
  double pow = Math.pow(big2dbl(this), d);
  if (Double.isInfinite(pow)) {
    return RubyFloat.newFloat(runtime, pow);
  }
  return RubyNumeric.dbl2ival(runtime, pow);
}
origin: org.jruby/jruby-core

private RubyNumeric pow(final Ruby runtime, final double d) {
  double pow = Math.pow(big2dbl(this), d);
  if (Double.isInfinite(pow)) {
    return RubyFloat.newFloat(runtime, pow);
  }
  return RubyNumeric.dbl2ival(runtime, pow);
}
origin: org.jruby/jruby-complete

final RubyFloat fdivDouble(ThreadContext context, RubyBignum y) {
  double dx = getDoubleValue();
  double dy = RubyBignum.big2dbl(y);
  if (Double.isInfinite(dx) || Double.isInfinite(dy)) {
    return (RubyFloat) fdivInt(context, y);
  }
  return context.runtime.newFloat(dx / dy);
}
origin: org.jruby/jruby-core

final RubyFloat fdivDouble(ThreadContext context, RubyBignum y) {
  double dx = getDoubleValue();
  double dy = RubyBignum.big2dbl(y);
  if (Double.isInfinite(dx) || Double.isInfinite(dy)) {
    return (RubyFloat) fdivInt(context, y);
  }
  return context.runtime.newFloat(dx / dy);
}
origin: org.jruby/jruby-complete

static RubyFloat new_float(final Ruby runtime, RubyInteger num) {
  if (num instanceof RubyBignum) {
    return RubyFloat.newFloat(runtime, RubyBignum.big2dbl((RubyBignum) num));
  }
  return RubyFloat.newFloat(runtime, ((RubyFixnum) num).getDoubleValue());
}
origin: org.jruby/jruby-core

static RubyFloat new_float(final Ruby runtime, RubyInteger num) {
  if (num instanceof RubyBignum) {
    return RubyFloat.newFloat(runtime, RubyBignum.big2dbl((RubyBignum) num));
  }
  return RubyFloat.newFloat(runtime, ((RubyFixnum) num).getDoubleValue());
}
origin: com.ning.billing/killbill-osgi-bundles-jruby

public IRubyObject op_pow(ThreadContext context, long other) {
  // MRI issuses warning here on (RBIGNUM(x)->len * SIZEOF_BDIGITS * yy > 1024*1024)
  if (((value.bitLength() + 7) / 8) * 4 * Math.abs(other) > 1024 * 1024) {
    getRuntime().getWarnings().warn(ID.MAY_BE_TOO_BIG, "in a**b, b may be too big");
  }
  if (other >= 0) {
    return bignorm(getRuntime(), value.pow((int) other)); // num2int is also implemented
  } else {
    return RubyFloat.newFloat(getRuntime(), Math.pow(big2dbl(this), (double)other));
  }
}
origin: org.kill-bill.billing/killbill-osgi-bundles-jruby

public IRubyObject op_pow(ThreadContext context, long other) {
  // MRI issuses warning here on (RBIGNUM(x)->len * SIZEOF_BDIGITS * yy > 1024*1024)
  if (((value.bitLength() + 7) / 8) * 4 * Math.abs(other) > 1024 * 1024) {
    getRuntime().getWarnings().warn(ID.MAY_BE_TOO_BIG, "in a**b, b may be too big");
  }
  if (other >= 0) {
    return bignorm(getRuntime(), value.pow((int) other)); // num2int is also implemented
  } else {
    return RubyFloat.newFloat(getRuntime(), Math.pow(big2dbl(this), (double)other));
  }
}
origin: org.jruby/jruby-complete

private IRubyObject subtractFloat(RubyFloat other) {
  return RubyFloat.newFloat(getRuntime(), big2dbl(this) - other.getDoubleValue());
}
origin: com.ning.billing/killbill-osgi-bundles-jruby

private IRubyObject subtractFloat(RubyFloat other) {
  return RubyFloat.newFloat(getRuntime(), big2dbl(this) - other.getDoubleValue());
}
origin: org.jruby/jruby-complete

private IRubyObject addFloat(RubyFloat other) {
  return RubyFloat.newFloat(getRuntime(), big2dbl(this) + other.getDoubleValue());
}
origin: org.jruby/jruby-core

private IRubyObject subtractFloat(RubyFloat other) {
  return RubyFloat.newFloat(getRuntime(), big2dbl(this) - other.getDoubleValue());
}
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_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.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);
  }
}
org.jrubyRubyBignumbig2dbl

Javadoc

rb_big2dbl

Popular methods of RubyBignum

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

Popular in Java

  • Updating database using SQL prepared statement
  • getExternalFilesDir (Context)
  • runOnUiThread (Activity)
  • onRequestPermissionsResult (Fragment)
  • URLConnection (java.net)
    A connection to a URL for reading or writing. For HTTP connections, see HttpURLConnection for docume
  • Collections (java.util)
    This class consists exclusively of static methods that operate on or return collections. It contains
  • Dictionary (java.util)
    Note: Do not use this class since it is obsolete. Please use the Map interface for new implementatio
  • Map (java.util)
    A Map is a data structure consisting of a set of keys and values in which each key is mapped to a si
  • TimeUnit (java.util.concurrent)
    A TimeUnit represents time durations at a given unit of granularity and provides utility methods to
  • Scheduler (org.quartz)
    This is the main interface of a Quartz Scheduler. A Scheduler maintains a registry of org.quartz.Job
  • 14 Best Plugins for Eclipse
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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