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
df9c11ff
Commit
df9c11ff
authored
May 03, 2021
by
Piotr Caban
Committed by
Alexandre Julliard
May 03, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msvcrt: Fix round implementation when 24-bit precision is used.
Signed-off-by:
Piotr Caban
<
piotr@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
e19ad985
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
28 deletions
+14
-28
math.c
dlls/msvcrt/math.c
+14
-28
No files found.
dlls/msvcrt/math.c
View file @
df9c11ff
...
...
@@ -87,14 +87,6 @@ static inline float fp_barrierf(float x)
return
y
;
}
#if _MSVCR_VER>=120
static
inline
double
fp_barrier
(
double
x
)
{
volatile
double
y
=
x
;
return
y
;
}
#endif
static
inline
double
CDECL
ret_nan
(
BOOL
update_sw
)
{
double
x
=
1
.
0
;
...
...
@@ -4330,32 +4322,26 @@ short CDECL _dclass(double x)
/*********************************************************************
* round (MSVCR120.@)
*
*
Copied from musl
: src/math/round.c
*
Based on musl implementation
: src/math/round.c
*/
double
CDECL
round
(
double
x
)
{
static
const
double
toint
=
1
/
DBL_EPSILON
;
ULONGLONG
llx
=
*
(
ULONGLONG
*
)
&
x
,
tmp
;
int
e
=
(
llx
>>
52
&
0x7ff
)
-
0x3ff
;
ULONGLONG
llx
=
*
(
ULONGLONG
*
)
&
x
;
int
e
=
llx
>>
52
&
0x7ff
;
double
y
;
if
(
e
>=
52
)
return
x
;
if
(
e
<
-
1
)
return
0
*
x
;
else
if
(
e
==
-
1
)
return
signbit
(
x
)
?
-
1
:
1
;
if
(
e
>=
0x3ff
+
52
)
tmp
=
0x000fffffffffffffULL
>>
e
;
if
(
!
(
llx
&
tmp
))
return
x
;
if
(
llx
>>
63
)
x
=
-
x
;
if
(
e
<
0x3ff
-
1
)
return
0
*
*
(
double
*
)
&
llx
;
y
=
fp_barrier
(
x
+
toint
)
-
toint
-
x
;
if
(
y
>
0
.
5
)
y
=
y
+
x
-
1
;
else
if
(
y
<=
-
0
.
5
)
y
=
y
+
x
+
1
;
else
y
=
y
+
x
;
if
(
llx
>>
63
)
y
=
-
y
;
return
y
;
llx
+=
0x0008000000000000ULL
>>
e
;
llx
&=
~
tmp
;
return
*
(
double
*
)
&
llx
;
}
/*********************************************************************
...
...
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