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

How to use
divideImpl
method
in
org.jruby.RubyBignum

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

origin: org.jruby/jruby-complete

@Override
public IRubyObject idiv(ThreadContext context, long other) {
  return divideImpl(context.runtime, long2big(other));
}
origin: org.jruby/jruby-core

public IRubyObject op_div(ThreadContext context, long other) {
  return divideImpl(context.runtime, long2big(other));
}
origin: org.jruby/jruby-core

@Override
public IRubyObject idiv(ThreadContext context, long other) {
  return divideImpl(context.runtime, long2big(other));
}
origin: org.jruby/jruby-complete

public IRubyObject op_div(ThreadContext context, long other) {
  return divideImpl(context.runtime, long2big(other));
}
origin: org.jruby/jruby-core

/**
 * rb_big_divide. Shared part for both "/" and "div" operations.
 */
private IRubyObject op_divide(ThreadContext context, IRubyObject other, boolean slash) {
  Ruby runtime = context.runtime;
  final BigInteger otherValue;
  if (other instanceof RubyFixnum) {
    otherValue = fix2big((RubyFixnum) other);
  } else if (other instanceof RubyBignum) {
    otherValue = ((RubyBignum) other).value;
  } else if (other instanceof RubyFloat) {
    double otherFloatValue = ((RubyFloat) other).getDoubleValue();
    if (!slash) {
      if (otherFloatValue == 0.0) throw runtime.newZeroDivisionError();
    }
    double div = big2dbl(this) / otherFloatValue;
    if (slash) {
      return RubyFloat.newFloat(runtime, div);
    } else {
      return RubyNumeric.dbl2ival(runtime, div);
    }
  } else {
    return coerceBin(context, slash ? sites(context).op_quo : sites(context).div, other);
  }
  return divideImpl(runtime, otherValue);
}
origin: org.jruby/jruby-complete

/**
 * rb_big_divide. Shared part for both "/" and "div" operations.
 */
private IRubyObject op_divide(ThreadContext context, IRubyObject other, boolean slash) {
  Ruby runtime = context.runtime;
  final BigInteger otherValue;
  if (other instanceof RubyFixnum) {
    otherValue = fix2big((RubyFixnum) other);
  } else if (other instanceof RubyBignum) {
    otherValue = ((RubyBignum) other).value;
  } else if (other instanceof RubyFloat) {
    double otherFloatValue = ((RubyFloat) other).getDoubleValue();
    if (!slash) {
      if (otherFloatValue == 0.0) throw runtime.newZeroDivisionError();
    }
    double div = big2dbl(this) / otherFloatValue;
    if (slash) {
      return RubyFloat.newFloat(runtime, div);
    } else {
      return RubyNumeric.dbl2ival(runtime, div);
    }
  } else {
    return coerceBin(context, slash ? sites(context).op_quo : sites(context).div, other);
  }
  return divideImpl(runtime, otherValue);
}
org.jrubyRubyBignumdivideImpl

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 post requests using okhttp
  • getSupportFragmentManager (FragmentActivity)
  • putExtra (Intent)
  • notifyDataSetChanged (ArrayAdapter)
  • GridBagLayout (java.awt)
    The GridBagLayout class is a flexible layout manager that aligns components vertically and horizonta
  • OutputStream (java.io)
    A writable sink for bytes.Most clients will use output streams that write data to the file system (
  • SortedSet (java.util)
    SortedSet is a Set which iterates over its elements in a sorted order. The order is determined eithe
  • UUID (java.util)
    UUID is an immutable representation of a 128-bit universally unique identifier (UUID). There are mul
  • Manifest (java.util.jar)
    The Manifest class is used to obtain attribute information for a JarFile and its entries.
  • Project (org.apache.tools.ant)
    Central representation of an Ant project. This class defines an Ant project with all of its targets,
  • Top 25 Plugins for Webstorm
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