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

  • Making http post requests using okhttp
  • setRequestProperty (URLConnection)
  • addToBackStack (FragmentTransaction)
  • getSharedPreferences (Context)
  • Rectangle (java.awt)
    A Rectangle specifies an area in a coordinate space that is enclosed by the Rectangle object's top-
  • BufferedWriter (java.io)
    Wraps an existing Writer and buffers the output. Expensive interaction with the underlying reader is
  • StringTokenizer (java.util)
    Breaks a string into tokens; new code should probably use String#split.> // Legacy code: StringTo
  • TreeSet (java.util)
    TreeSet is an implementation of SortedSet. All optional operations (adding and removing) are support
  • ExecutorService (java.util.concurrent)
    An Executor that provides methods to manage termination and methods that can produce a Future for tr
  • JFileChooser (javax.swing)
  • Top 17 Plugins for Android Studio
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