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
15b50e98
Commit
15b50e98
authored
Apr 03, 2023
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msvcrt: Use the hypot()/hypotf() implementation from the bundled musl library.
parent
406c583c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
101 deletions
+0
-101
math.c
dlls/msvcrt/math.c
+0
-101
No files found.
dlls/msvcrt/math.c
View file @
15b50e98
...
...
@@ -4599,107 +4599,6 @@ double CDECL _logb(double x)
return
__ilogb
(
x
);
}
static
void
sq
(
double
*
hi
,
double
*
lo
,
double
x
)
{
double
xh
,
xl
,
xc
;
xc
=
x
*
(
0x1
p27
+
1
);
xh
=
x
-
xc
+
xc
;
xl
=
x
-
xh
;
*
hi
=
x
*
x
;
*
lo
=
xh
*
xh
-
*
hi
+
2
*
xh
*
xl
+
xl
*
xl
;
}
/*********************************************************************
* _hypot (MSVCRT.@)
*
* Copied from musl: src/math/hypot.c
*/
double
CDECL
_hypot
(
double
x
,
double
y
)
{
UINT64
ux
=
*
(
UINT64
*
)
&
x
,
uy
=
*
(
UINT64
*
)
&
y
,
ut
;
double
hx
,
lx
,
hy
,
ly
,
z
;
int
ex
,
ey
;
/* arrange |x| >= |y| */
ux
&=
-
1ULL
>>
1
;
uy
&=
-
1ULL
>>
1
;
if
(
ux
<
uy
)
{
ut
=
ux
;
ux
=
uy
;
uy
=
ut
;
}
/* special cases */
ex
=
ux
>>
52
;
ey
=
uy
>>
52
;
x
=
*
(
double
*
)
&
ux
;
y
=
*
(
double
*
)
&
uy
;
/* note: hypot(inf,nan) == inf */
if
(
ey
==
0x7ff
)
return
y
;
if
(
ex
==
0x7ff
||
uy
==
0
)
return
x
;
/* note: hypot(x,y) ~= x + y*y/x/2 with inexact for small y/x */
/* 64 difference is enough for ld80 double_t */
if
(
ex
-
ey
>
64
)
return
x
+
y
;
/* precise sqrt argument in nearest rounding mode without overflow */
/* xh*xh must not overflow and xl*xl must not underflow in sq */
z
=
1
;
if
(
ex
>
0x3ff
+
510
)
{
z
=
0x1
p700
;
x
*=
0x1
p
-
700
;
y
*=
0x1
p
-
700
;
}
else
if
(
ey
<
0x3ff
-
450
)
{
z
=
0x1
p
-
700
;
x
*=
0x1
p700
;
y
*=
0x1
p700
;
}
sq
(
&
hx
,
&
lx
,
x
);
sq
(
&
hy
,
&
ly
,
y
);
return
z
*
sqrt
(
ly
+
lx
+
hy
+
hx
);
}
/*********************************************************************
* _hypotf (MSVCRT.@)
*
* Copied from musl: src/math/hypotf.c
*/
float
CDECL
_hypotf
(
float
x
,
float
y
)
{
UINT32
ux
=
*
(
UINT32
*
)
&
x
,
uy
=
*
(
UINT32
*
)
&
y
,
ut
;
float
z
;
ux
&=
-
1U
>>
1
;
uy
&=
-
1U
>>
1
;
if
(
ux
<
uy
)
{
ut
=
ux
;
ux
=
uy
;
uy
=
ut
;
}
x
=
*
(
float
*
)
&
ux
;
y
=
*
(
float
*
)
&
uy
;
if
(
uy
==
0xff
<<
23
)
return
y
;
if
(
ux
>=
0xff
<<
23
||
uy
==
0
||
ux
-
uy
>=
25
<<
23
)
return
x
+
y
;
z
=
1
;
if
(
ux
>=
(
0x7f
+
60
)
<<
23
)
{
z
=
0x1
p90f
;
x
*=
0x1
p
-
90
f
;
y
*=
0x1
p
-
90
f
;
}
else
if
(
uy
<
(
0x7f
-
60
)
<<
23
)
{
z
=
0x1
p
-
90
f
;
x
*=
0x1
p90f
;
y
*=
0x1
p90f
;
}
return
z
*
sqrtf
((
double
)
x
*
x
+
(
double
)
y
*
y
);
}
/*********************************************************************
* ceil (MSVCRT.@)
*
...
...
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