CloneSet107


Previous CloneSetNext CloneSetBack to Main Report
Clone
Mass
Clones in
CloneSet
Parameter
Count
Clone
Similarity
Syntax Category
[Sequence Length]
30210.994StatementList[2]
Clone AbstractionParameter Bindings
Clone Instance
(Click to see clone)
Line CountSource Line
Source File
130607
Closure/closure/goog/math/integer.js
230648
Closure/closure/goog/math/long.js
Clone Instance
1
Line Count
30
Source Line
607
Source File
Closure/closure/goog/math/integer.js

  while (rem.greaterThanOrEqual(other)) {
    // Approximate the result of division. This may be a little greater or
    // smaller than the actual value.
    var approx=  Math.max(1, Math.floor(rem.toNumber( )/ other.toNumber( )));

    // We will tweak the approximate result by changing it in the 48-th digit or
    // the smallest non-fractional digit, whichever is larger.
    var log2=  Math.ceil(Math.log(approx)/  Math.LN2);
    var delta=  (log2<=  48)
                ?              1
                :                  Math.pow(2, log2-  48);
    // Decrease the approximation until it is smaller than the remainder.  Note
    // that if it is too large, the product overflows and is negative.
    var approxRes=  goog.math.Integer.fromNumber(approx);
    var approxRem=  approxRes.multiply(other);
    while (approxRem.isNegative( )
           ||                        approxRem.greaterThan(rem)) {
      approx-=  delta;
      approxRes=  goog.math.Integer.fromNumber(approx);
      approxRem=  approxRes.multiply(other);
                                                                 }
    // We know the answer can't be zero... and actually, zero would cause
    // infinite recursion since we would make no progress.
    if (approxRes.isZero( )){
      approxRes=  goog.math.Integer.ONE;
                            }
    res=  res.add(approxRes);
    rem=  rem.subtract(approxRem);
                                        }
  return res;


Clone Instance
2
Line Count
30
Source Line
648
Source File
Closure/closure/goog/math/long.js

  while (rem.greaterThanOrEqual(other)) {
    // Approximate the result of division. This may be a little greater or
    // smaller than the actual value.
    var approx=  Math.max(1, Math.floor(rem.toNumber( )/ other.toNumber( )));

    // We will tweak the approximate result by changing it in the 48-th digit or
    // the smallest non-fractional digit, whichever is larger.
    var log2=  Math.ceil(Math.log(approx)/  Math.LN2);
    var delta=  (log2<=  48)
                ?              1
                :                  Math.pow(2, log2-  48);
    // Decrease the approximation until it is smaller than the remainder.  Note
    // that if it is too large, the product overflows and is negative.
    var approxRes=  goog.math.Long.fromNumber(approx);
    var approxRem=  approxRes.multiply(other);
    while (approxRem.isNegative( )
           ||                        approxRem.greaterThan(rem)) {
      approx-=  delta;
      approxRes=  goog.math.Long.fromNumber(approx);
      approxRem=  approxRes.multiply(other);
                                                                 }
    // We know the answer can't be zero... and actually, zero would cause
    // infinite recursion since we would make no progress.
    if (approxRes.isZero( )){
      approxRes=  goog.math.Long.ONE;
                            }
    res=  res.add(approxRes);
    rem=  rem.subtract(approxRem);
                                        }
  return res;


Clone AbstractionParameter Count: 1Parameter Bindings

while (rem.greaterThanOrEqual(other))
  {
    // Approximate the result of division. This may be a little greater or
    // smaller than the actual value.
    var approx=Math.max(1,Math.floor(rem.toNumber( )/other.toNumber( )));
    // We will tweak the approximate result by changing it in the 48-th digit or
    // the smallest non-fractional digit, whichever is larger.
    var log2=Math.ceil(Math.log(approx)/Math.LN2);
    var delta=(log2<=48)
              ?1
              :Math.pow(2,log2-48);
    // Decrease the approximation until it is smaller than the remainder.  Note
    // that if it is too large, the product overflows and is negative.
    var approxRes=goog.math. [[#variable60d04d40]].fromNumber(approx);
    var approxRem=approxRes.multiply(other);
    while (approxRem.isNegative( )
           || approxRem.greaterThan(rem))
      { approx-=delta;
        approxRes=goog.math. [[#variable60d04d40]].fromNumber(approx);
        approxRem=approxRes.multiply(other);
      }
    // We know the answer can't be zero... and actually, zero would cause
    // infinite recursion since we would make no progress.
    if (approxRes.isZero( ))
      { approxRes=goog.math. [[#variable60d04d40]].ONE;
      }
    res=res.add(approxRes);
    rem=rem.subtract(approxRem);
  }
return res;
 

CloneAbstraction
Parameter Bindings
Parameter
Index
Clone
Instance
Parameter
Name
Value
11[[#60d04d40]]
Long 
12[[#60d04d40]]
Integer