Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
f0d3a7d3
Commit
f0d3a7d3
authored
Oct 26, 2021
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Copy floor() implementation from msvcrt.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
fca34420
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
2 deletions
+23
-2
math.c
dlls/ntdll/math.c
+23
-2
No files found.
dlls/ntdll/math.c
View file @
f0d3a7d3
...
...
@@ -191,10 +191,31 @@ double CDECL fabs( double d )
/*********************************************************************
* floor (NTDLL.@)
*
* Based on musl: src/math/floorf.c
*/
double
CDECL
floor
(
double
d
)
double
CDECL
floor
(
double
x
)
{
return
unix_funcs
->
floor
(
d
);
union
{
double
f
;
UINT64
i
;}
u
=
{
x
};
int
e
=
(
int
)(
u
.
i
>>
52
&
0x7ff
)
-
0x3ff
;
UINT64
m
;
if
(
e
>=
52
)
return
x
;
if
(
e
>=
0
)
{
m
=
0x000fffffffffffffULL
>>
e
;
if
((
u
.
i
&
m
)
==
0
)
return
x
;
if
(
u
.
i
>>
63
)
u
.
i
+=
m
;
u
.
i
&=
~
m
;
}
else
{
if
(
u
.
i
>>
63
==
0
)
return
0
;
else
if
(
u
.
i
<<
1
)
return
-
1
;
}
return
u
.
f
;
}
/*********************************************************************
...
...
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