mirror of
https://github.com/reactos/reactos.git
synced 2025-07-02 04:01:28 +00:00
[CRT:MATH] Implement _dsign and _dsignf
This commit is contained in:
parent
0e5d6af68e
commit
50028685dc
4 changed files with 44 additions and 2 deletions
|
@ -306,7 +306,7 @@
|
||||||
@ cdecl -stub _dpcomp(double double)
|
@ cdecl -stub _dpcomp(double double)
|
||||||
@ cdecl -stub _dpoly(double ptr long)
|
@ cdecl -stub _dpoly(double ptr long)
|
||||||
@ cdecl -stub _dscale(ptr long)
|
@ cdecl -stub _dscale(ptr long)
|
||||||
@ cdecl -stub _dsign(double)
|
@ cdecl _dsign(double)
|
||||||
@ cdecl -stub _dsin(double long)
|
@ cdecl -stub _dsin(double long)
|
||||||
@ cdecl _dtest(ptr)
|
@ cdecl _dtest(ptr)
|
||||||
@ cdecl -stub _dunscale(ptr ptr)
|
@ cdecl -stub _dunscale(ptr ptr)
|
||||||
|
@ -349,7 +349,7 @@
|
||||||
@ cdecl -stub _fdpcomp(float float)
|
@ cdecl -stub _fdpcomp(float float)
|
||||||
@ cdecl -stub _fdpoly(float ptr long)
|
@ cdecl -stub _fdpoly(float ptr long)
|
||||||
@ cdecl -stub _fdscale(ptr long)
|
@ cdecl -stub _fdscale(ptr long)
|
||||||
@ cdecl -stub _fdsign(float)
|
@ cdecl _fdsign(float)
|
||||||
@ cdecl -stub _fdsin(float long)
|
@ cdecl -stub _fdsin(float long)
|
||||||
@ cdecl _fdtest(ptr)
|
@ cdecl _fdtest(ptr)
|
||||||
@ cdecl -stub _fdunscale(ptr ptr)
|
@ cdecl -stub _fdunscale(ptr ptr)
|
||||||
|
|
20
sdk/lib/crt/math/_dsign.c
Normal file
20
sdk/lib/crt/math/_dsign.c
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
/*
|
||||||
|
* PROJECT: ReactOS CRT
|
||||||
|
* LICENSE: MIT (https://spdx.org/licenses/MIT)
|
||||||
|
* PURPOSE: Implementation of _dsign.
|
||||||
|
* COPYRIGHT: Copyright 2025 Timo Kreuzer <timo.kreuzer@reactos.org>
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <math.h>
|
||||||
|
#include <stdint.h>
|
||||||
|
|
||||||
|
_Check_return_
|
||||||
|
int
|
||||||
|
__cdecl
|
||||||
|
_dsign(_In_ double _X)
|
||||||
|
{
|
||||||
|
union { double f; uint64_t ui64; } u = { _X };
|
||||||
|
|
||||||
|
// This is what Windows returns
|
||||||
|
return (u.ui64 >> 48) & 0x8000;
|
||||||
|
}
|
20
sdk/lib/crt/math/_fdsign.c
Normal file
20
sdk/lib/crt/math/_fdsign.c
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
/*
|
||||||
|
* PROJECT: ReactOS CRT
|
||||||
|
* LICENSE: MIT (https://spdx.org/licenses/MIT)
|
||||||
|
* PURPOSE: Implementation of _fdsign.
|
||||||
|
* COPYRIGHT: Copyright 2025 Timo Kreuzer <timo.kreuzer@reactos.org>
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <math.h>
|
||||||
|
#include <stdint.h>
|
||||||
|
|
||||||
|
_Check_return_
|
||||||
|
int
|
||||||
|
__cdecl
|
||||||
|
_fdsign(_In_ float _X)
|
||||||
|
{
|
||||||
|
union { float f; uint32_t ui32; } u = { _X };
|
||||||
|
|
||||||
|
// This is what Windows returns
|
||||||
|
return (u.ui32 >> 16) & 0x8000;
|
||||||
|
}
|
|
@ -3,6 +3,8 @@ include_directories(libm_sse2)
|
||||||
|
|
||||||
list(APPEND LIBCNTPR_MATH_SOURCE
|
list(APPEND LIBCNTPR_MATH_SOURCE
|
||||||
math/_chgsignf.c
|
math/_chgsignf.c
|
||||||
|
math/_dsign.c
|
||||||
|
math/_fdsign.c
|
||||||
math/_invoke_matherr.c
|
math/_invoke_matherr.c
|
||||||
math/abs.c
|
math/abs.c
|
||||||
math/div.c
|
math/div.c
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue