[pkg-wine-party] [SCM] Debian Wine packaging branch, lenny, updated. wine-1.0.0-1-126-gccc5cbd

Alexandre Julliard julliard at winehq.org
Thu Oct 30 14:44:10 UTC 2008


The following commit has been merged in the lenny branch:
commit 81c6271783a79ff1c836aaf3b1b5a1a00a264480
Author: Henri Verbeet <hverbeet at gmail.com>
Date:   Fri Aug 29 02:11:53 2008 +0200

    msvcrt: Don't depend on the system's implementation of acos() & asin().
    (cherry picked from commit 71aa14af993dd065b1882675fb9f01af44ed232a)

diff --git a/dlls/msvcrt/math.c b/dlls/msvcrt/math.c
index b449af5..25ac69f 100644
--- a/dlls/msvcrt/math.c
+++ b/dlls/msvcrt/math.c
@@ -57,7 +57,12 @@ static MSVCRT_matherr_func MSVCRT_default_matherr_func = NULL;
 double CDECL MSVCRT_acos( double x )
 {
   if (x < -1.0 || x > 1.0 || !finite(x)) *MSVCRT__errno() = MSVCRT_EDOM;
-  return acos(x);
+  /* glibc implements acos() as the FPU equivalent of atan2(sqrt(1 - x ^ 2), x).
+   * asin() uses a similar construction. This is bad because as x gets nearer to
+   * 1 the error in the expression "1 - x^2" can get relatively large due to
+   * cancellation. The sqrt() makes things worse. A safer way to calculate
+   * acos() is to use atan2(sqrt((1 - x) * (1 + x)), x). */
+  return atan2(sqrt((1 - x) * (1 + x)), x);
 }
 
 /*********************************************************************
@@ -66,7 +71,7 @@ double CDECL MSVCRT_acos( double x )
 double CDECL MSVCRT_asin( double x )
 {
   if (x < -1.0 || x > 1.0 || !finite(x)) *MSVCRT__errno() = MSVCRT_EDOM;
-  return asin(x);
+  return atan2(x, sqrt((1 - x) * (1 + x)));
 }
 
 /*********************************************************************

-- 
Debian Wine packaging



More information about the pkg-wine-party mailing list