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

How to use
num2long
method
in
org.jruby.RubyBignum

Best Java code snippets using org.jruby.RubyBignum.num2long (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-core

/** rb_big_aref
 *
 */
@Override
public RubyFixnum op_aref(ThreadContext context, IRubyObject other) {
  if (other instanceof RubyBignum) {
    // Need to normalize first
    other = bignorm(context.runtime, ((RubyBignum) other).value);
    if (other instanceof RubyBignum) {
      // '!=' for negative value
      if ((((RubyBignum) other).value.signum() >= 0) != (value.signum() == -1)) {
        return RubyFixnum.zero(context.runtime);
      }
      return RubyFixnum.one(context.runtime);
    }
  }
  long position = num2long(other);
  if (position < 0 || position > Integer.MAX_VALUE) {
    return RubyFixnum.zero(context.runtime);
  }
  return value.testBit((int)position) ? RubyFixnum.one(context.runtime) : RubyFixnum.zero(context.runtime);
}
origin: org.jruby/jruby-complete

/** rb_big_aref
 *
 */
@Override
public RubyFixnum op_aref(ThreadContext context, IRubyObject other) {
  if (other instanceof RubyBignum) {
    // Need to normalize first
    other = bignorm(context.runtime, ((RubyBignum) other).value);
    if (other instanceof RubyBignum) {
      // '!=' for negative value
      if ((((RubyBignum) other).value.signum() >= 0) != (value.signum() == -1)) {
        return RubyFixnum.zero(context.runtime);
      }
      return RubyFixnum.one(context.runtime);
    }
  }
  long position = num2long(other);
  if (position < 0 || position > Integer.MAX_VALUE) {
    return RubyFixnum.zero(context.runtime);
  }
  return value.testBit((int)position) ? RubyFixnum.one(context.runtime) : RubyFixnum.zero(context.runtime);
}
origin: com.ning.billing/killbill-osgi-bundles-jruby

/** rb_big_aref
 *
 */
@JRubyMethod(name = "[]", required = 1)
public RubyFixnum op_aref(IRubyObject other) {
  if (other instanceof RubyBignum) {
    // Need to normalize first
    other = bignorm(getRuntime(), ((RubyBignum) other).value);
    if (other instanceof RubyBignum) {
      // '!=' for negative value
      if ((((RubyBignum) other).value.signum() >= 0) != (value.signum() == -1)) {
        return RubyFixnum.zero(getRuntime());
      }
      return RubyFixnum.one(getRuntime());
    }
  }
  long position = num2long(other);
  if (position < 0 || position > Integer.MAX_VALUE) {
    return RubyFixnum.zero(getRuntime());
  }
  return value.testBit((int)position) ? RubyFixnum.one(getRuntime()) : RubyFixnum.zero(getRuntime());
}
origin: org.kill-bill.billing/killbill-osgi-bundles-jruby

/** rb_big_aref
 *
 */
@JRubyMethod(name = "[]", required = 1)
public RubyFixnum op_aref(IRubyObject other) {
  if (other instanceof RubyBignum) {
    // Need to normalize first
    other = bignorm(getRuntime(), ((RubyBignum) other).value);
    if (other instanceof RubyBignum) {
      // '!=' for negative value
      if ((((RubyBignum) other).value.signum() >= 0) != (value.signum() == -1)) {
        return RubyFixnum.zero(getRuntime());
      }
      return RubyFixnum.one(getRuntime());
    }
  }
  long position = num2long(other);
  if (position < 0 || position > Integer.MAX_VALUE) {
    return RubyFixnum.zero(getRuntime());
  }
  return value.testBit((int)position) ? RubyFixnum.one(getRuntime()) : RubyFixnum.zero(getRuntime());
}
org.jrubyRubyBignumnum2long

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

  • Start an intent from android
  • setScale (BigDecimal)
  • addToBackStack (FragmentTransaction)
  • getContentResolver (Context)
  • BigDecimal (java.math)
    An immutable arbitrary-precision signed decimal.A value is represented by an arbitrary-precision "un
  • 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
  • JComboBox (javax.swing)
  • JLabel (javax.swing)
  • JTextField (javax.swing)
  • IOUtils (org.apache.commons.io)
    General IO stream manipulation utilities. This class provides static utility methods for input/outpu
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