Codota Logo
RubyBignum.fdivDouble
Code IndexAdd Codota to your IDE (free)

How to use
fdivDouble
method
in
org.jruby.RubyBignum

Best Java code snippets using org.jruby.RubyBignum.fdivDouble (Showing top 4 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: org.jruby/jruby-complete

@Override
public IRubyObject fdivDouble(ThreadContext context, IRubyObject y) {
  double dx, dy;
  dx = getDoubleValue();
  if (y instanceof RubyFixnum) {
    long ly = ((RubyFixnum) y).getLongValue();
    if (Double.isInfinite(dx)) {
      return fdivInt(context.runtime, BigDecimal.valueOf(ly));
    }
    dy = (double) ly;
  } else if (y instanceof RubyBignum) {
    return fdivDouble(context, (RubyBignum) y);
  } else if (y instanceof RubyFloat) {
    dy = ((RubyFloat) y).getDoubleValue();
    if (Double.isNaN(dy)) {
      return context.runtime.newFloat(dy);
    }
    if (Double.isInfinite(dx)) {
      return fdivFloat(context, (RubyFloat) y);
    }
  } else {
    return coerceBin(context, sites(context).fdiv, y);
  }
  return context.runtime.newFloat(dx / dy);
}
origin: org.jruby/jruby-core

@Override
public IRubyObject fdivDouble(ThreadContext context, IRubyObject y) {
  double dx, dy;
  dx = getDoubleValue();
  if (y instanceof RubyFixnum) {
    long ly = ((RubyFixnum) y).getLongValue();
    if (Double.isInfinite(dx)) {
      return fdivInt(context.runtime, BigDecimal.valueOf(ly));
    }
    dy = (double) ly;
  } else if (y instanceof RubyBignum) {
    return fdivDouble(context, (RubyBignum) y);
  } else if (y instanceof RubyFloat) {
    dy = ((RubyFloat) y).getDoubleValue();
    if (Double.isNaN(dy)) {
      return context.runtime.newFloat(dy);
    }
    if (Double.isInfinite(dx)) {
      return fdivFloat(context, (RubyFloat) y);
    }
  } else {
    return coerceBin(context, sites(context).fdiv, y);
  }
  return context.runtime.newFloat(dx / dy);
}
origin: org.jruby/jruby-complete

@Override
public IRubyObject fdivDouble(ThreadContext context, IRubyObject y) {
  if (y instanceof RubyFixnum) {
    return context.runtime.newFloat(((double) value) / ((double) fix2long(y)));
  }
  if (y instanceof RubyBignum) {
    return RubyBignum.newBignum(context.runtime, value).fdivDouble(context, (RubyBignum) y);
  }
  if (y instanceof RubyFloat) {
    return context.runtime.newFloat(((double) value) / ((RubyFloat) y).getDoubleValue());
  }
  return coerceBin(context, sites(context).fdiv, y);
}
origin: org.jruby/jruby-core

@Override
public IRubyObject fdivDouble(ThreadContext context, IRubyObject y) {
  if (y instanceof RubyFixnum) {
    return context.runtime.newFloat(((double) value) / ((double) fix2long(y)));
  }
  if (y instanceof RubyBignum) {
    return RubyBignum.newBignum(context.runtime, value).fdivDouble(context, (RubyBignum) y);
  }
  if (y instanceof RubyFloat) {
    return context.runtime.newFloat(((double) value) / ((RubyFloat) y).getDoubleValue());
  }
  return coerceBin(context, sites(context).fdiv, y);
}
org.jrubyRubyBignumfdivDouble

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

  • Making http requests using okhttp
  • getContentResolver (Context)
  • getResourceAsStream (ClassLoader)
    Returns a stream for the resource with the specified name. See #getResource(String) for a descriptio
  • setRequestProperty (URLConnection)
    Sets the general request property. If a property with the key already exists, overwrite its value wi
  • Connection (java.sql)
    A connection represents a link from a Java application to a database. All SQL statements and results
  • Time (java.sql)
    Java representation of an SQL TIME value. Provides utilities to format and parse the time's represen
  • DateFormat (java.text)
    Formats or parses dates and times.This class provides factories for obtaining instances configured f
  • Comparator (java.util)
    A Comparator is used to compare two objects to determine their ordering with respect to each other.
  • HashMap (java.util)
    HashMap is an implementation of Map. All optional operations are supported.All elements are permitte
  • FileUtils (org.apache.commons.io)
    General file manipulation utilities. Facilities are provided in the following areas: * writing to a
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