Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
71aa14af
Commit
71aa14af
authored
Aug 29, 2008
by
Henri Verbeet
Committed by
Alexandre Julliard
Aug 29, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msvcrt: Don't depend on the system's implementation of acos() & asin().
parent
5c1edcfa
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
2 deletions
+7
-2
math.c
dlls/msvcrt/math.c
+7
-2
No files found.
dlls/msvcrt/math.c
View file @
71aa14af
...
...
@@ -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
a
sin
(
x
);
return
a
tan2
(
x
,
sqrt
((
1
-
x
)
*
(
1
+
x
))
);
}
/*********************************************************************
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment