Skip to content

Commit

Permalink
Showing 1 changed file with 1 addition and 12 deletions.
13 changes: 1 addition & 12 deletions core/src/main/java/org/jruby/truffle/nodes/core/FloatNodes.java
Original file line number Diff line number Diff line change
@@ -613,9 +613,6 @@ public abstract static class ToINode extends CoreMethodNode {

@Child protected FixnumOrBignumNode fixnumOrBignum;

private final BranchProfile greaterZero = new BranchProfile();
private final BranchProfile lessZero = new BranchProfile();

public ToINode(RubyContext context, SourceSection sourceSection) {
super(context, sourceSection);
fixnumOrBignum = new FixnumOrBignumNode();
@@ -636,15 +633,7 @@ public Object toI(double value) {
throw new RaiseException(getContext().getCoreLibrary().floatDomainError("NaN", this));
}

double truncated = value;

if (value > 0.0) {
truncated = Math.floor(value);
} else if (value < 0.0) {
truncated = Math.ceil(value);
}

return fixnumOrBignum.fixnumOrBignum(getContext(), truncated);
return fixnumOrBignum.fixnumOrBignum(getContext(), value);
}

}

0 comments on commit 40ba655

Please sign in to comment.