mirror of
https://github.com/reactos/reactos.git
synced 2025-08-06 13:43:36 +00:00
[FAST486]
Due to some kind of mixup, I thought the series for log(x) was actually for log10(x). Fix Fast486FpuCalculateLogBase2 by dividing the result with log(2) and not log10(2). svn path=/trunk/; revision=67841
This commit is contained in:
parent
1e5d331ec6
commit
fe362794c6
1 changed files with 5 additions and 5 deletions
|
@ -1085,8 +1085,8 @@ Fast486FpuCalculateTwoPowerMinusOne(PFAST486_STATE State,
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Calculates using the identities:
|
* Calculates using the identities:
|
||||||
* log2(x) = log10(x) / log10(2)
|
* log2(x) = ln(x) / ln(2)
|
||||||
* log10(x)= sum { -1^(n+1) * x^n / n!, n >= 1 }
|
* ln(x)= sum { -1^(n+1) * x^n / n!, n >= 1 }
|
||||||
*/
|
*/
|
||||||
static inline BOOLEAN FASTCALL
|
static inline BOOLEAN FASTCALL
|
||||||
Fast486FpuCalculateLogBase2(PFAST486_STATE State,
|
Fast486FpuCalculateLogBase2(PFAST486_STATE State,
|
||||||
|
@ -1144,7 +1144,7 @@ Fast486FpuCalculateLogBase2(PFAST486_STATE State,
|
||||||
/* Subtract one from the value */
|
/* Subtract one from the value */
|
||||||
if (!Fast486FpuSubtract(State, &Value, &FpuOne, &Value)) return FALSE;
|
if (!Fast486FpuSubtract(State, &Value, &FpuOne, &Value)) return FALSE;
|
||||||
|
|
||||||
/* Calculate the base 10 logarithm */
|
/* Calculate the natural logarithm */
|
||||||
SeriesElement = TempResult = Value;
|
SeriesElement = TempResult = Value;
|
||||||
|
|
||||||
for (i = 2; i < INVERSE_NUMBERS_COUNT / 2; i++)
|
for (i = 2; i < INVERSE_NUMBERS_COUNT / 2; i++)
|
||||||
|
@ -1173,8 +1173,8 @@ Fast486FpuCalculateLogBase2(PFAST486_STATE State,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Now convert the base 10 logarithm into a base 2 logarithm */
|
/* Now convert the natural logarithm into a base 2 logarithm */
|
||||||
if (!Fast486FpuDivide(State, &TempResult, &FpuLgTwo, &TempResult)) return FALSE;
|
if (!Fast486FpuDivide(State, &TempResult, &FpuLnTwo, &TempResult)) return FALSE;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Add the exponent to the result
|
* Add the exponent to the result
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue