Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: jruby/jruby
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 9176fc8082ee
Choose a base ref
...
head repository: jruby/jruby
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 85212adf4aaf
Choose a head ref
  • 2 commits
  • 1 file changed
  • 2 contributors

Commits on Apr 27, 2016

  1. Copy the full SHA
    81ebc7e View commit details

Commits on Apr 28, 2016

  1. Merge pull request #3833 from lucasallan/fixnum-bitlength

    Fixnum#bit_length - uses bit inversion when the value is negative
    headius committed Apr 28, 2016
    Copy the full SHA
    85212ad View commit details
Showing with 1 addition and 1 deletion.
  1. +1 −1 core/src/main/java/org/jruby/RubyFixnum.java
2 changes: 1 addition & 1 deletion core/src/main/java/org/jruby/RubyFixnum.java
Original file line number Diff line number Diff line change
@@ -1194,7 +1194,7 @@ public IRubyObject succ(ThreadContext context) {
public IRubyObject bit_length(ThreadContext context) {
long tmpValue = value;
if (value < 0) {
tmpValue = Math.abs(value);
tmpValue = ~value;
}

return context.runtime.newFixnum(64 - Long.numberOfLeadingZeros(tmpValue));