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
829e8931
Commit
829e8931
authored
Mar 24, 2015
by
Zheng Chen
Committed by
Alexandre Julliard
Mar 27, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msvcrt: Fix _copysign bugs for NAN/INF.
parent
b61d93a6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
9 deletions
+8
-9
math.c
dlls/msvcrt/math.c
+8
-9
No files found.
dlls/msvcrt/math.c
View file @
829e8931
...
...
@@ -46,8 +46,9 @@ WINE_DEFAULT_DEBUG_CHANNEL(msvcrt);
#endif
#endif
/* FIXME: Does not work with -NAN and -0. */
#ifndef signbit
#define signbit(x)
0
#define signbit(x)
((x) < 0)
#endif
typedef
int
(
CDECL
*
MSVCRT_matherr_func
)(
struct
MSVCRT__exception
*
);
...
...
@@ -88,10 +89,9 @@ float CDECL MSVCRT__chgsignf( float num )
*/
float
CDECL
MSVCRT__copysignf
(
float
num
,
float
sign
)
{
/* FIXME: Behaviour for Nan/Inf? */
if
(
sign
<
0
.
0
)
return
num
<
0
.
0
?
num
:
-
num
;
return
num
<
0
.
0
?
-
num
:
num
;
if
(
signbit
(
sign
))
return
signbit
(
num
)
?
num
:
-
num
;
return
signbit
(
num
)
?
-
num
:
num
;
}
/*********************************************************************
...
...
@@ -1227,10 +1227,9 @@ int CDECL _controlfp_s(unsigned int *cur, unsigned int newval, unsigned int mask
*/
double
CDECL
MSVCRT__copysign
(
double
num
,
double
sign
)
{
/* FIXME: Behaviour for Nan/Inf? */
if
(
sign
<
0
.
0
)
return
num
<
0
.
0
?
num
:
-
num
;
return
num
<
0
.
0
?
-
num
:
num
;
if
(
signbit
(
sign
))
return
signbit
(
num
)
?
num
:
-
num
;
return
signbit
(
num
)
?
-
num
:
num
;
}
/*********************************************************************
...
...
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