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

How to use
op_lshift
method
in
org.jruby.RubyBignum

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

origin: org.jruby/jruby-core

/** fix_lshift
 *
 */
@Override
public IRubyObject op_lshift(ThreadContext context, IRubyObject other) {
  if (!(other instanceof RubyFixnum)) {
    return RubyBignum.newBignum(context.runtime, value).op_lshift(context, other);
  }
  return op_lshift(context, ((RubyFixnum) other).value);
}
origin: org.jruby/jruby-complete

/** fix_lshift
 *
 */
@Override
public IRubyObject op_lshift(ThreadContext context, IRubyObject other) {
  if (!(other instanceof RubyFixnum)) {
    return RubyBignum.newBignum(context.runtime, value).op_lshift(context, other);
  }
  return op_lshift(context, ((RubyFixnum) other).value);
}
origin: org.jruby/jruby-complete

private RubyInteger lshift(ThreadContext context, final long width) {
  if (width > BIT_SIZE - 1 || ((~0L << BIT_SIZE - width - 1) & value) != 0) {
    return RubyBignum.newBignum(context.runtime, value).op_lshift(context, width);
  }
  return RubyFixnum.newFixnum(context.runtime, value << width);
}
origin: org.jruby/jruby-core

private RubyInteger lshift(ThreadContext context, final long width) {
  if (width > BIT_SIZE - 1 || ((~0L << BIT_SIZE - width - 1) & value) != 0) {
    return RubyBignum.newBignum(context.runtime, value).op_lshift(context, width);
  }
  return RubyFixnum.newFixnum(context.runtime, value << width);
}
origin: org.jruby/jruby-core

/** rb_big_lshift
 *
 */
@Override
public IRubyObject op_lshift(ThreadContext context, IRubyObject other) {
  long shift;
  for (;;) {
    if (other instanceof RubyFixnum) {
      shift = ((RubyFixnum) other).getLongValue();
      break;
    } else if (other instanceof RubyBignum) {
      RubyBignum otherBignum = (RubyBignum) other;
      if (otherBignum.value.signum() < 0) {
        IRubyObject tmp = otherBignum.checkShiftDown(context, this);
        if (tmp != null) return tmp;
      }
      shift = big2long(otherBignum);
      break;
    }
    other = other.convertToInteger();
  }
  return op_lshift(context, shift);
}
origin: org.jruby/jruby-complete

/** rb_big_lshift
 *
 */
@Override
public IRubyObject op_lshift(ThreadContext context, IRubyObject other) {
  long shift;
  for (;;) {
    if (other instanceof RubyFixnum) {
      shift = ((RubyFixnum) other).getLongValue();
      break;
    } else if (other instanceof RubyBignum) {
      RubyBignum otherBignum = (RubyBignum) other;
      if (otherBignum.value.signum() < 0) {
        IRubyObject tmp = otherBignum.checkShiftDown(context, this);
        if (tmp != null) return tmp;
      }
      shift = big2long(otherBignum);
      break;
    }
    other = other.convertToInteger();
  }
  return op_lshift(context, shift);
}
origin: com.ning.billing/killbill-osgi-bundles-jruby

/** fix_lshift 
 * 
 */
@JRubyMethod(name = "<<")
public IRubyObject op_lshift(IRubyObject other) {
  if (!(other instanceof RubyFixnum)) return RubyBignum.newBignum(getRuntime(), value).op_lshift(other);
  return op_lshift(((RubyFixnum)other).getLongValue());
}

origin: org.kill-bill.billing/killbill-osgi-bundles-jruby

/** fix_lshift 
 * 
 */
@JRubyMethod(name = "<<")
public IRubyObject op_lshift(IRubyObject other) {
  if (!(other instanceof RubyFixnum)) return RubyBignum.newBignum(getRuntime(), value).op_lshift(other);
  return op_lshift(((RubyFixnum)other).getLongValue());
}

origin: com.ning.billing/killbill-osgi-bundles-jruby

private IRubyObject lshift(long width) {
  if (width > BIT_SIZE - 1 || ((~0L << BIT_SIZE - width - 1) & value) != 0) {
    return RubyBignum.newBignum(getRuntime(), value).op_lshift(RubyFixnum.newFixnum(getRuntime(), width));
  }
  return RubyFixnum.newFixnum(getRuntime(), value << width);
}
origin: org.kill-bill.billing/killbill-osgi-bundles-jruby

private IRubyObject lshift(long width) {
  if (width > BIT_SIZE - 1 || ((~0L << BIT_SIZE - width - 1) & value) != 0) {
    return RubyBignum.newBignum(getRuntime(), value).op_lshift(RubyFixnum.newFixnum(getRuntime(), width));
  }
  return RubyFixnum.newFixnum(getRuntime(), value << width);
}
org.jrubyRubyBignumop_lshift

Javadoc

rb_big_lshift

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

  • Updating database using SQL prepared statement
  • setScale (BigDecimal)
  • putExtra (Intent)
  • startActivity (Activity)
  • OutputStream (java.io)
    A writable sink for bytes.Most clients will use output streams that write data to the file system (
  • Deque (java.util)
    A linear collection that supports element insertion and removal at both ends. The name deque is shor
  • Enumeration (java.util)
    A legacy iteration interface.New code should use Iterator instead. Iterator replaces the enumeration
  • TreeMap (java.util)
    Walk the nodes of the tree left-to-right or right-to-left. Note that in descending iterations, next
  • ThreadPoolExecutor (java.util.concurrent)
    An ExecutorService that executes each submitted task using one of possibly several pooled threads, n
  • Location (org.springframework.beans.factory.parsing)
    Class that models an arbitrary location in a Resource.Typically used to track the location of proble
  • From CI to AI: The AI layer in your organization
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