BigInteger result = value.add(other);
if (value.signum() > 0 && other.signum() > 0) return new RubyBignum(getRuntime(), result);
return bignorm(getRuntime(), result);
BigInteger result = value.subtract(other);
if (value.signum() < 0 && other.signum() > 0) return new RubyBignum(getRuntime(), result);
return bignorm(getRuntime(), result);
Clone fragments detected by clone detection tool
File path: /jruby-1.4.0/src/org/jruby/RubyBignum.java
|
|
File path: /jruby-1.4.0/src/org/jruby/RubyBignum.java
|
Method name: IRubyObject addBignum(BigInteger)
|
|
Method name: IRubyObject subtractBignum(BigInteger)
|
Number of AST nodes: 4
|
|
Number of AST nodes: 4
|
|
1 | BigInteger result = value.add(other);↵ | | 1 | BigInteger result = value.subtract(other);↵
|
2 | if (value.signum() > 0 && other.signum() > 0) return new RubyBignum(getRuntime(), result);↵ | | 2 | if (value.signum() < 0 && other.signum() > 0) return new RubyBignum(getRuntime(), result);↵
|
3 | return bignorm(getRuntime(), result); | | 3 | return bignorm(getRuntime(), result);
|
See real code fragment |
|
See real code fragment |
Summary
Number of common nesting structure subtrees | 0 |
Number of refactorable cases | 0 |
Number of non-refactorable cases | 0 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.2 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 1 |