mirror of
https://github.com/reactos/reactos.git
synced 2025-07-31 23:43:39 +00:00
[CRT:MATH] Implement _isnan and _isnanf
This commit is contained in:
parent
e01231bd49
commit
3f71ab80ad
6 changed files with 37 additions and 43 deletions
17
sdk/lib/crt/math/_isnan.c
Normal file
17
sdk/lib/crt/math/_isnan.c
Normal file
|
@ -0,0 +1,17 @@
|
|||
/*
|
||||
* PROJECT: ReactOS CRT
|
||||
* LICENSE: MIT (https://spdx.org/licenses/MIT)
|
||||
* PURPOSE: Implementation of _isnan.
|
||||
* COPYRIGHT: Copyright 2025 Timo Kreuzer <timo.kreuzer@reactos.org>
|
||||
*/
|
||||
|
||||
#include <float.h>
|
||||
#include <stdint.h>
|
||||
|
||||
int
|
||||
__cdecl
|
||||
_isnan(_In_ double _X)
|
||||
{
|
||||
union { double f; uint64_t ui64; } u = { _X };
|
||||
return (u.ui64 & ~0x8000000000000000ull) > 0x7FF0000000000000ull;
|
||||
}
|
17
sdk/lib/crt/math/_isnanf.c
Normal file
17
sdk/lib/crt/math/_isnanf.c
Normal file
|
@ -0,0 +1,17 @@
|
|||
/*
|
||||
* PROJECT: ReactOS CRT
|
||||
* LICENSE: MIT (https://spdx.org/licenses/MIT)
|
||||
* PURPOSE: Implementation of _isnanf.
|
||||
* COPYRIGHT: Copyright 2025 Timo Kreuzer <timo.kreuzer@reactos.org>
|
||||
*/
|
||||
|
||||
#include <math.h>
|
||||
#include <stdint.h>
|
||||
|
||||
int
|
||||
__cdecl
|
||||
_isnanf(_In_ float _X)
|
||||
{
|
||||
union { float f; uint32_t ui32; } u = { _X };
|
||||
return (u.ui32 & ~0x80000000) > 0x7F800000;
|
||||
}
|
|
@ -7,6 +7,8 @@ list(APPEND LIBCNTPR_MATH_SOURCE
|
|||
math/_fdsign.c
|
||||
math/_finite.c
|
||||
math/_finitef.c
|
||||
math/_isnan.c
|
||||
math/_isnanf.c
|
||||
math/_invoke_matherr.c
|
||||
math/abs.c
|
||||
math/div.c
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue