Author: aandrejevic Date: Thu May 21 17:27:47 2015 New Revision: 67841
URL: http://svn.reactos.org/svn/reactos?rev=67841&view=rev Log: [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).
Modified: trunk/reactos/lib/fast486/fpu.c
Modified: trunk/reactos/lib/fast486/fpu.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/lib/fast486/fpu.c?rev=67841... ============================================================================== --- trunk/reactos/lib/fast486/fpu.c [iso-8859-1] (original) +++ trunk/reactos/lib/fast486/fpu.c [iso-8859-1] Thu May 21 17:27:47 2015 @@ -1085,8 +1085,8 @@
/* * Calculates using the identities: - * log2(x) = log10(x) / log10(2) - * log10(x)= sum { -1^(n+1) * x^n / n!, n >= 1 } + * log2(x) = ln(x) / ln(2) + * ln(x)= sum { -1^(n+1) * x^n / n!, n >= 1 } */ static inline BOOLEAN FASTCALL Fast486FpuCalculateLogBase2(PFAST486_STATE State, @@ -1144,7 +1144,7 @@ /* Subtract one from the value */ if (!Fast486FpuSubtract(State, &Value, &FpuOne, &Value)) return FALSE;
- /* Calculate the base 10 logarithm */ + /* Calculate the natural logarithm */ SeriesElement = TempResult = Value;
for (i = 2; i < INVERSE_NUMBERS_COUNT / 2; i++) @@ -1173,8 +1173,8 @@ } }
- /* Now convert the base 10 logarithm into a base 2 logarithm */ - if (!Fast486FpuDivide(State, &TempResult, &FpuLgTwo, &TempResult)) return FALSE; + /* Now convert the natural logarithm into a base 2 logarithm */ + if (!Fast486FpuDivide(State, &TempResult, &FpuLnTwo, &TempResult)) return FALSE;
/* * Add the exponent to the result