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

How to use
dbl_cmp
method
in
org.jruby.RubyBignum

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

origin: org.jruby/jruby-complete

/** rb_big_cmp
 *
 */
@Override
public IRubyObject op_cmp(ThreadContext context, IRubyObject other) {
  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) {
    RubyFloat flt = (RubyFloat)other;
    if (flt.infinite_p().isTrue()) {
      if (flt.getDoubleValue() > 0.0) return RubyFixnum.minus_one(context.runtime);
      return RubyFixnum.one(context.runtime);
    }
    return dbl_cmp(context.runtime, big2dbl(this), flt.getDoubleValue());
  } else {
    return coerceCmp(context, sites(context).op_cmp, other);
  }
  // wow, the only time we can use the java protocol ;)
  return RubyFixnum.newFixnum(context.runtime, value.compareTo(otherValue));
}
origin: org.jruby/jruby-core

/** rb_big_cmp
 *
 */
@Override
public IRubyObject op_cmp(ThreadContext context, IRubyObject other) {
  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) {
    RubyFloat flt = (RubyFloat)other;
    if (flt.infinite_p().isTrue()) {
      if (flt.getDoubleValue() > 0.0) return RubyFixnum.minus_one(context.runtime);
      return RubyFixnum.one(context.runtime);
    }
    return dbl_cmp(context.runtime, big2dbl(this), flt.getDoubleValue());
  } else {
    return coerceCmp(context, sites(context).op_cmp, other);
  }
  // wow, the only time we can use the java protocol ;)
  return RubyFixnum.newFixnum(context.runtime, value.compareTo(otherValue));
}
origin: com.ning.billing/killbill-osgi-bundles-jruby

/** rb_big_cmp
 *
 */
@JRubyMethod(name = "<=>", required = 1)
public IRubyObject op_cmp(ThreadContext context, IRubyObject other) {
  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) {
    RubyFloat flt = (RubyFloat)other;
    if (flt.infinite_p().isTrue()) {
      if (flt.getDoubleValue() > 0.0) return RubyFixnum.minus_one(getRuntime());
      return RubyFixnum.one(getRuntime());
    }
    return dbl_cmp(getRuntime(), big2dbl(this), flt.getDoubleValue());
  } else {
    return coerceCmp(context, "<=>", other);
  }
  // wow, the only time we can use the java protocol ;)
  return RubyFixnum.newFixnum(getRuntime(), value.compareTo(otherValue));
}
origin: org.kill-bill.billing/killbill-osgi-bundles-jruby

/** rb_big_cmp
 *
 */
@JRubyMethod(name = "<=>", required = 1)
public IRubyObject op_cmp(ThreadContext context, IRubyObject other) {
  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) {
    RubyFloat flt = (RubyFloat)other;
    if (flt.infinite_p().isTrue()) {
      if (flt.getDoubleValue() > 0.0) return RubyFixnum.minus_one(getRuntime());
      return RubyFixnum.one(getRuntime());
    }
    return dbl_cmp(getRuntime(), big2dbl(this), flt.getDoubleValue());
  } else {
    return coerceCmp(context, "<=>", other);
  }
  // wow, the only time we can use the java protocol ;)
  return RubyFixnum.newFixnum(getRuntime(), value.compareTo(otherValue));
}
org.jrubyRubyBignumdbl_cmp

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,
  • divmod,
  • even_p,
  • fix2big,
  • getBigIntegerValue

Popular in Java

  • Parsing JSON documents to java classes using gson
  • requestLocationUpdates (LocationManager)
  • compareTo (BigDecimal)
  • runOnUiThread (Activity)
  • PrintStream (java.io)
    Fake signature of an existing Java class.
  • SocketException (java.net)
    This SocketException may be thrown during socket creation or setting options, and is the superclass
  • ArrayList (java.util)
    ArrayList is an implementation of List, backed by an array. All optional operations including adding
  • Iterator (java.util)
    An iterator over a sequence of objects, such as a collection.If a collection has been changed since
  • JComboBox (javax.swing)
  • Base64 (org.apache.commons.codec.binary)
    Provides Base64 encoding and decoding as defined by RFC 2045.This class implements section 6.8. Base
  • Top Vim 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