harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From telli...@apache.org
Subject svn commit: r492144 - in /harmony/enhanced/classlib/trunk/modules/math/src: main/java/java/math/ test/java/org/apache/harmony/tests/java/math/ test/java/tests/api/java/math/
Date Wed, 03 Jan 2007 13:36:38 GMT
Author: tellison
Date: Wed Jan  3 05:36:37 2007
New Revision: 492144

URL: http://svn.apache.org/viewvc?view=rev&rev=492144
Log:
Apply patch HARMONY-2864 ([Classlib][math] Wrong words in math module)

Modified:
    harmony/enhanced/classlib/trunk/modules/math/src/main/java/java/math/BigDecimal.java
    harmony/enhanced/classlib/trunk/modules/math/src/main/java/java/math/BigInteger.java
    harmony/enhanced/classlib/trunk/modules/math/src/main/java/java/math/Conversion.java
    harmony/enhanced/classlib/trunk/modules/math/src/main/java/java/math/Elementary.java
    harmony/enhanced/classlib/trunk/modules/math/src/main/java/java/math/Logical.java
    harmony/enhanced/classlib/trunk/modules/math/src/main/java/java/math/Multiplication.java
    harmony/enhanced/classlib/trunk/modules/math/src/main/java/java/math/Primality.java
    harmony/enhanced/classlib/trunk/modules/math/src/main/java/java/math/RoundingMode.java
    harmony/enhanced/classlib/trunk/modules/math/src/test/java/org/apache/harmony/tests/java/math/BigIntegerDivideTest.java
    harmony/enhanced/classlib/trunk/modules/math/src/test/java/tests/api/java/math/BigDecimalTest.java
    harmony/enhanced/classlib/trunk/modules/math/src/test/java/tests/api/java/math/BigIntegerTest.java

Modified: harmony/enhanced/classlib/trunk/modules/math/src/main/java/java/math/BigDecimal.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/math/src/main/java/java/math/BigDecimal.java?view=diff&rev=492144&r1=492143&r2=492144
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/math/src/main/java/java/math/BigDecimal.java (original)
+++ harmony/enhanced/classlib/trunk/modules/math/src/main/java/java/math/BigDecimal.java Wed
Jan  3 05:36:37 2007
@@ -182,7 +182,7 @@
             LONG_TEN_POW_BIT_LENGTH[j] = bitLength(LONG_TEN_POW[j]);
         }
         
-        // Taking the references of usefull powers.
+        // Taking the references of useful powers.
         TEN_POW = Multiplication.bigTenPows;
         FIVE_POW = Multiplication.bigFivePows;
     }
@@ -247,7 +247,7 @@
             offset++;
             begin++;
         }
-        // Acumulating all digits until a possible decimal point
+        // Accumulating all digits until a possible decimal point
         for (; (offset <= last) && (in[offset] != '.')
         && (in[offset] != 'e') && (in[offset] != 'E'); offset++) {
             ;
@@ -256,7 +256,7 @@
         // A decimal point was found
         if ((offset <= last) && (in[offset] == '.')) {
             offset++;
-            // Acumulating all digits until a possible exponent
+            // Accumulating all digits until a possible exponent
             begin = offset;
             for (; (offset <= last) && (in[offset] != 'e')
             && (in[offset] != 'E'); offset++) {
@@ -270,7 +270,7 @@
         // An exponent was found
         if ((offset <= last) && ((in[offset] == 'e') || (in[offset] == 'E')))
{
             offset++;
-            // Checking for a posible sign of scale
+            // Checking for a possible sign of scale
             begin = offset;
             if ((offset <= last) && (in[offset] == '+')) {
                 offset++;
@@ -278,7 +278,7 @@
                     begin++;
                 }
             }
-            // Acumulating all reminaining digits
+            // Accumulating all remaining digits
             scaleString = String.valueOf(in, begin, last + 1 - begin);
             // Checking if the scale is defined            
             newScale = (long)scale - Integer.parseInt(scaleString);
@@ -601,7 +601,7 @@
                     tempBI = Multiplication.multiplyByPositiveInt(tempBI, 10)
                     .add(BigInteger.valueOf(thisSignum * 9));
                 }
-                // Rounding the improved substracting
+                // Rounding the improved subtracting
                 leftOperand = new BigDecimal(tempBI, this.scale + 1);
                 return leftOperand.round(mc);
             }
@@ -887,7 +887,7 @@
         if ((divisor.aproxPrecision() + newScale > this.aproxPrecision() + 1L)
         || (this.isZero())) {
             /* If the divisor's integer part is greater than this's integer part,
-             * the result must be zero with the apropriate scale */
+             * the result must be zero with the appropriate scale */
             integralValue = BigInteger.ZERO;
         } else if (newScale == 0) {
             integralValue = getUnscaledValue().divide( divisor.getUnscaledValue() );
@@ -898,7 +898,7 @@
         } else {// (newScale < 0)
             powerOfTen = Multiplication.powerOf10(-newScale);
             integralValue = getUnscaledValue().multiply(powerOfTen).divide( divisor.getUnscaledValue()
);
-            // To strip trailing zeros aproximating to the preferred scale
+            // To strip trailing zeros approximating to the preferred scale
             while (!integralValue.testBit(0)) {
                 quotAndRem = integralValue.divideAndRemainder(TEN_POW[i]);
                 if ((quotAndRem[1].signum() == 0)
@@ -950,7 +950,7 @@
             // To calculate: (u1 / (u2 * 10^(s1-s2)) * 10^newScale
             quotAndRem[0] = quotAndRem[0].multiply(Multiplication.powerOf10(newScale));
         } else {// CASE s2 > s1:   
-            /* To calculate the minimus power of ten, such that the quotient 
+            /* To calculate the minimum power of ten, such that the quotient 
              *   (u1 * 10^exp) / u2   has at least 'mc.precision()' digits. */
             long exp = Math.min(-diffScale, Math.max((long)mcPrecision - diffPrecision, 0));
             long compRemDiv;
@@ -1215,7 +1215,7 @@
             return new BigDecimal(Multiplication.multiplyByTenPow(getUnscaledValue(),(int)diffScale),
newScale);
         }
         // diffScale < 0
-        // return  [u,s] / [1,newScale]  with the apropiate scale and rounding
+        // return  [u,s] / [1,newScale]  with the appropriate scale and rounding
         if(this.bitLength < 64 && -diffScale < LONG_TEN_POW.length) {
             return dividePrimitiveLongs(this.smallValue, LONG_TEN_POW[(int)-diffScale], newScale,roundingMode);
         }
@@ -1724,7 +1724,7 @@
     private void inplaceRound(MathContext mc) {
         int mcPrecision = mc.getPrecision();
         int discardedPrecision = precision() - mcPrecision;
-        // If no rounding is necessary it returns inmediatly
+        // If no rounding is necessary it returns immediately
         if ((discardedPrecision <= 0) || (mcPrecision == 0)) {
             return;
         }
@@ -1733,7 +1733,7 @@
             smallRound(mc, discardedPrecision);
             return;
         }
-        // Getting the interger part and the discarded fraction
+        // Getting the integer part and the discarded fraction
         BigInteger sizeOfFraction = Multiplication.powerOf10(discardedPrecision);
         BigInteger[] integerAndFraction = getUnscaledValue().divideAndRemainder(sizeOfFraction);
         long newScale = (long)scale - discardedPrecision;
@@ -1757,7 +1757,7 @@
                 newScale--;
             }
         }
-        // To update all inernal fields
+        // To update all internal fields
         scale = toIntScale(newScale);
         precision = mcPrecision;
         setUnscaledValue(integerAndFraction[0]);
@@ -1777,7 +1777,7 @@
         long sizeOfFraction = LONG_TEN_POW[discardedPrecision];
         long newScale = (long)scale - discardedPrecision;
         long unscaledVal = smallValue;
-        // Getting the interger part and the discarded fraction
+        // Getting the integer part and the discarded fraction
         long integer = unscaledVal / sizeOfFraction;
         long fraction = unscaledVal % sizeOfFraction;
         int compRem;
@@ -1795,7 +1795,7 @@
                 newScale--;
             }
         }
-        // To update all inernal fields
+        // To update all internal fields
         scale = toIntScale(newScale);
         precision = mc.getPrecision();
         smallValue = integer;
@@ -1806,7 +1806,7 @@
     /**
      * Return an increment that can be -1,0 or 1, depending of <code>roundingMode</code>.
      * @param parityBit can be 0 or 1, it's only used in the case <code>HALF_EVEN</code>.
 
-     * @param fraction the mantisa to be analized.
+     * @param fraction the mantisa to be analyzed.
      * @param roundingMode the type of rounding.
      * @return the carry propagated after rounding.
      */
@@ -1876,11 +1876,11 @@
     }
 
     /**
-     * If the precion already was calculated it returns that value, otherwise
-     * it calculates a very good aproximization efficiently . Note that this 
+     * If the precision already was calculated it returns that value, otherwise
+     * it calculates a very good approximation efficiently . Note that this 
      * value will be <code>precision()</code> or <code>precision()-1</code>
      * in the worst case.
-     * @return an aproximization of <code>precision()</code> value
+     * @return an approximation of <code>precision()</code> value
      */
     private int aproxPrecision() {
         return ((precision > 0)
@@ -1911,7 +1911,7 @@
     }
 
     /**
-     * It returns the value 0 with the most aproximated scale of type 
+     * It returns the value 0 with the most approximated scale of type 
      * <code>int</code>. if <code>longScale > Integer.MAX_VALUE</code>

      * the scale will be <code>Integer.MAX_VALUE</code>; if 
      * <code>longScale < Integer.MIN_VALUE</code> the scale will be

Modified: harmony/enhanced/classlib/trunk/modules/math/src/main/java/java/math/BigInteger.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/math/src/main/java/java/math/BigInteger.java?view=diff&rev=492144&r1=492143&r2=492144
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/math/src/main/java/java/math/BigInteger.java (original)
+++ harmony/enhanced/classlib/trunk/modules/math/src/main/java/java/math/BigInteger.java Wed
Jan  3 05:36:37 2007
@@ -209,7 +209,7 @@
 
     /** 
      * Constructs a number without to create new space.
-     * This constrcut should be used only if the three fields 
+     * This construct should be used only if the three fields 
      * of representation are known. 
      * @param sign the sign of the number
      * @param numberLength the length of the internal array

Modified: harmony/enhanced/classlib/trunk/modules/math/src/main/java/java/math/Conversion.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/math/src/main/java/java/math/Conversion.java?view=diff&rev=492144&r1=492143&r2=492144
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/math/src/main/java/java/math/Conversion.java (original)
+++ harmony/enhanced/classlib/trunk/modules/math/src/main/java/java/math/Conversion.java Wed
Jan  3 05:36:37 2007
@@ -234,7 +234,7 @@
         // +7 - For "special case 2" (see below) we have 7 free chars for
         // inserting necessary scaled digits.
         result = new char[resLengthInChars + 1];
-        // alocated [resLengthInChars+1] charactes.
+        // allocated [resLengthInChars+1] characters.
         // a free latest character may be used for "special case 1" (see
         // below)
         currentChar = resLengthInChars;

Modified: harmony/enhanced/classlib/trunk/modules/math/src/main/java/java/math/Elementary.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/math/src/main/java/java/math/Elementary.java?view=diff&rev=492144&r1=492143&r2=492144
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/math/src/main/java/java/math/Elementary.java (original)
+++ harmony/enhanced/classlib/trunk/modules/math/src/main/java/java/math/Elementary.java Wed
Jan  3 05:36:37 2007
@@ -245,7 +245,7 @@
      * the result (i.e. {@code op1.bitLength() >= op2.bitLength()}). Both
      * should be positive (i.e. {@code op1 >= op2}).
      * 
-     * @param op1 the input minuend, and the ouput result.
+     * @param op1 the input minuend, and the output result.
      * @param op2 the addend
      */
     static void inplaceAdd(BigInteger op1, BigInteger op2) {
@@ -293,7 +293,7 @@
 	 * should be positive (what implies that {@code op1 >= op2}).
 	 * 
 	 * @param op1
-	 *            the input minuend, and the ouput result.
+	 *            the input minuend, and the output result.
 	 * @param op2
 	 *            the subtrahend
 	 */

Modified: harmony/enhanced/classlib/trunk/modules/math/src/main/java/java/math/Logical.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/math/src/main/java/java/math/Logical.java?view=diff&rev=492144&r1=492143&r2=492144
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/math/src/main/java/java/math/Logical.java (original)
+++ harmony/enhanced/classlib/trunk/modules/math/src/main/java/java/math/Logical.java Wed
Jan  3 05:36:37 2007
@@ -273,7 +273,7 @@
         return result;
     }
     
-    /** @return sign = 1, magniutde = positive.magnitude & ~(-negative.magnitude)*/
+    /** @return sign = 1, magnitude = positive.magnitude & ~(-negative.magnitude)*/
     static BigInteger andNotPositiveNegative(BigInteger positive, BigInteger negative) {
         // PRE: positive > 0 && negative < 0
         int iNeg = negative.getFirstNonzeroDigit();
@@ -528,7 +528,7 @@
     
     /** @return sign = -1, magnitude = -(positive.magnitude | -negative.magnitude) */
     static BigInteger orDiffSigns(BigInteger positive, BigInteger negative){
-        // Jumping over the least significative zero bits
+        // Jumping over the least significant zero bits
         int iNeg = negative.getFirstNonzeroDigit();
         int iPos = positive.getFirstNonzeroDigit();
         int i;
@@ -748,7 +748,7 @@
                     resDigits[i] = -1;
                 }
                 for ( ; i < negative.numberLength; i++) {
-                    //resDigits[i] = ~(~negative.digts[i] ^ 0)
+                    //resDigits[i] = ~(~negative.digits[i] ^ 0)
                     resDigits[i] = negative.digits[i];
                 }
             }
@@ -791,7 +791,7 @@
             resDigits[i] = positive.digits[i];
         }
         for ( ; i < negative.numberLength; i++) { 
-            // resDidigts[i] = ~(0 ^ ~negative.digits[i])
+            // resDigits[i] = ~(0 ^ ~negative.digits[i])
             resDigits[i] = negative.digits[i];
         }
         

Modified: harmony/enhanced/classlib/trunk/modules/math/src/main/java/java/math/Multiplication.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/math/src/main/java/java/math/Multiplication.java?view=diff&rev=492144&r1=492143&r2=492144
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/math/src/main/java/java/math/Multiplication.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/math/src/main/java/java/math/Multiplication.java
Wed Jan  3 05:36:37 2007
@@ -54,7 +54,7 @@
     };
 
     /**
-     * An array with the fisrt powers of ten in {@code BigInteger} version.
+     * An array with the first powers of ten in {@code BigInteger} version.
      * ({@code 10^0,10^1,...,10^31})
      */
     static final BigInteger[] bigTenPows = new BigInteger[32];

Modified: harmony/enhanced/classlib/trunk/modules/math/src/main/java/java/math/Primality.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/math/src/main/java/java/math/Primality.java?view=diff&rev=492144&r1=492143&r2=492144
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/math/src/main/java/java/math/Primality.java (original)
+++ harmony/enhanced/classlib/trunk/modules/math/src/main/java/java/math/Primality.java Wed
Jan  3 05:36:37 2007
@@ -83,7 +83,7 @@
 
     /**
      * It uses the sieve of Eratosthenes to discard several composite numbers in
-     * some appropiate range (at the moment {@code [this, this + 1024]}). After
+     * some appropriate range (at the moment {@code [this, this + 1024]}). After
      * this process it applies the Miller-Rabin test to the numbers that were
      * not discarded in the sieve.
      * 
@@ -108,7 +108,7 @@
             return BIprimes[i];
         }
         /*
-         * Creates a "N" enough big to hold the next probale prime Note that: N <
+         * Creates a "N" enough big to hold the next probable prime Note that: N <
          * "next prime" < 2*N
          */
         startPoint = new BigInteger(1, n.numberLength,
@@ -130,7 +130,7 @@
             modules[i] = Division.remainder(startPoint, primes[i]) - gapSize;
         }
         while (true) {
-            // At this point, all numbers in the gap are initializated as
+            // At this point, all numbers in the gap are initialized as
             // probably primes
             Arrays.fill(isDivisible, false);
             // To discard multiples of first primes
@@ -234,7 +234,7 @@
      * 
      * @param n the input number to be tested.
      * @param t the number of trials.
-     * @return {@code false} if the number is definitily compose, otherwise
+     * @return {@code false} if the number is definitely compose, otherwise
      *         {@code true} with probability {@code 1 - 4<sup>(-t)</sup>}.
      * @ar.org.fitc.ref "D. Knuth, The Art of Computer Programming Vo.2, Section
      *                  4.5.4., Algorithm P"

Modified: harmony/enhanced/classlib/trunk/modules/math/src/main/java/java/math/RoundingMode.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/math/src/main/java/java/math/RoundingMode.java?view=diff&rev=492144&r1=492143&r2=492144
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/math/src/main/java/java/math/RoundingMode.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/math/src/main/java/java/math/RoundingMode.java
Wed Jan  3 05:36:37 2007
@@ -52,7 +52,7 @@
     /** The old constant of <code>BigDecimal</code>. */
     protected final int bigDecimalRM;
 
-    /** It sets the old contant. */
+    /** It sets the old constant. */
     RoundingMode(int rm) {
         bigDecimalRM = rm;
     }

Modified: harmony/enhanced/classlib/trunk/modules/math/src/test/java/org/apache/harmony/tests/java/math/BigIntegerDivideTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/math/src/test/java/org/apache/harmony/tests/java/math/BigIntegerDivideTest.java?view=diff&rev=492144&r1=492143&r2=492144
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/math/src/test/java/org/apache/harmony/tests/java/math/BigIntegerDivideTest.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/math/src/test/java/org/apache/harmony/tests/java/math/BigIntegerDivideTest.java
Wed Jan  3 05:36:37 2007
@@ -84,7 +84,7 @@
     }
 
     /**
-     * Divide two equal in absolute value numbers of different signes.
+     * Divide two equal in absolute value numbers of different signs.
      */
     public void testCase4() {
         byte aBytes[] = {-127, 100, 56, 7, 98, -1, 39, -128, 127};

Modified: harmony/enhanced/classlib/trunk/modules/math/src/test/java/tests/api/java/math/BigDecimalTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/math/src/test/java/tests/api/java/math/BigDecimalTest.java?view=diff&rev=492144&r1=492143&r2=492144
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/math/src/test/java/tests/api/java/math/BigDecimalTest.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/math/src/test/java/tests/api/java/math/BigDecimalTest.java
Wed Jan  3 05:36:37 2007
@@ -591,7 +591,7 @@
 		BigDecimal setScale2 = setScale1.setScale(4);
 		assertTrue("the number 2.323E102 after setting scale is wrong",
 				setScale2.scale() == 4);
-		assertTrue("the resentation of the number 2.323E102 is wrong",
+		assertTrue("the representation of the number 2.323E102 is wrong",
 				setScale2.doubleValue() == 2.323E102);
 		setScale1 = new BigDecimal("-1.253E-12");
 		setScale2 = setScale1.setScale(17, BigDecimal.ROUND_CEILING);

Modified: harmony/enhanced/classlib/trunk/modules/math/src/test/java/tests/api/java/math/BigIntegerTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/math/src/test/java/tests/api/java/math/BigIntegerTest.java?view=diff&rev=492144&r1=492143&r2=492144
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/math/src/test/java/tests/api/java/math/BigIntegerTest.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/math/src/test/java/tests/api/java/math/BigIntegerTest.java
Wed Jan  3 05:36:37 2007
@@ -275,9 +275,9 @@
 	 * @tests java.math.BigInteger#valueOf(long)
 	 */
 	public void test_valueOfJ() {
-		assertTrue("Incorred number returned for 2", BigInteger.valueOf(2L)
+		assertTrue("Incurred number returned for 2", BigInteger.valueOf(2L)
 				.equals(two));
-		assertTrue("Incorred number returned for 200", BigInteger.valueOf(200L)
+		assertTrue("Incurred number returned for 200", BigInteger.valueOf(200L)
 				.equals(BigInteger.valueOf(139).add(BigInteger.valueOf(61))));
 	}
 



Mime
View raw message