Use actual array sizes rather than magic numbers

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/branches/MATH_2_X@1066280 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Sebastian Bazley 2011-02-01 23:57:30 +00:00
parent 49aa29daa9
commit c6ac38c5bf
1 changed files with 3 additions and 3 deletions

View File

@ -206,7 +206,7 @@ public class FastMath {
// Generate an array of factorials
FACT[0] = 1.0;
for (i = 1; i < 20; i++) {
for (i = 1; i < FACT.length; i++) {
FACT[i] = FACT[i-1] * i;
}
@ -228,14 +228,14 @@ public class FastMath {
}
// Populate expFracTable
for (i = 0; i < 1025; i++) {
for (i = 0; i < EXP_FRAC_TABLE_A.length; i++) {
slowexp(i/1024.0, tmp);
EXP_FRAC_TABLE_A[i] = tmp[0];
EXP_FRAC_TABLE_B[i] = tmp[1];
}
// Populate lnMant table
for (i = 0; i < 1024; i++) {
for (i = 0; i < LN_MANT.length; i++) {
double d = Double.longBitsToDouble( (((long) i) << 42) | 0x3ff0000000000000L );
LN_MANT[i] = slowLog(d);
}