File tree Expand file tree Collapse file tree 5 files changed +41
-17
lines changed
Expand file tree Collapse file tree 5 files changed +41
-17
lines changed Original file line number Diff line number Diff line change 371371@ cdecl _findnext64 (long ptr )
372372@ cdecl _findnext64i32 (long ptr )
373373@ cdecl _finite (double )
374- @ cdecl - stub - arch = !i386 _finitef (float )
374+ @ cdecl - arch = !i386 _finitef (float )
375375@ cdecl _flushall ()
376376@ cdecl _fpclass (double )
377377@ cdecl - stub - arch = !i386 _fpclassf (float )
Original file line number Diff line number Diff line change @@ -36,19 +36,3 @@ int CDECL _isnan(double __x)
3636 x .__x = & __x ;
3737 return ( x .x -> exponent == 0x7ff && ( x .x -> mantissah != 0 || x .x -> mantissal != 0 ));
3838}
39-
40- /*
41- * @implemented
42- */
43- int CDECL _finite (double __x )
44- {
45- union
46- {
47- double * __x ;
48- double_s * x ;
49- } x ;
50-
51- x .__x = & __x ;
52-
53- return ((x .x -> exponent & 0x7ff ) != 0x7ff );
54- }
Original file line number Diff line number Diff line change 1+ /*
2+ * PROJECT: ReactOS CRT
3+ * LICENSE: MIT (https://spdx.org/licenses/MIT)
4+ * PURPOSE: Implementation of _finite.
5+ * COPYRIGHT: Copyright 2025 Timo Kreuzer <[email protected] > 6+ */
7+
8+ #include <float.h>
9+ #include <stdint.h>
10+
11+ _Check_return_
12+ int
13+ __cdecl
14+ _finite (_In_ double _X )
15+ {
16+ union { double f ; uint64_t ui64 ; } u = { _X };
17+ uint64_t exp = u .ui64 & 0x7FF0000000000000 ;
18+ return (exp != 0x7FF0000000000000 );
19+ }
Original file line number Diff line number Diff line change 1+ /*
2+ * PROJECT: ReactOS CRT
3+ * LICENSE: MIT (https://spdx.org/licenses/MIT)
4+ * PURPOSE: Implementation of _finitef.
5+ * COPYRIGHT: Copyright 2025 Timo Kreuzer <[email protected] > 6+ */
7+
8+ #include <float.h>
9+ #include <stdint.h>
10+
11+ _Check_return_
12+ int
13+ __cdecl
14+ _finitef (_In_ float _X )
15+ {
16+ union { float f ; uint32_t ui32 ; } u = { _X };
17+ uint32_t exp = u .ui32 & 0x7F800000 ;
18+ return (exp != 0x7F800000 );
19+ }
Original file line number Diff line number Diff line change @@ -5,6 +5,8 @@ list(APPEND LIBCNTPR_MATH_SOURCE
55 math /_chgsignf.c
66 math /_dsign.c
77 math /_fdsign.c
8+ math /_finite.c
9+ math /_finitef.c
810 math /_invoke_matherr.c
911 math /abs.c
1012 math /div.c
You can’t perform that action at this time.
0 commit comments