mirror of
https://github.com/ziglang/zig.git
synced 2025-12-27 08:33:15 +00:00
also start prefering NtDll API. so far: * NtQueryInformationFile * NtClose adds a performance workaround for windows unicode conversion. but that should probably be removed before merging
12 lines
258 B
C
Vendored
12 lines
258 B
C
Vendored
#include <math.h>
|
|
#include <stdint.h>
|
|
|
|
int __fpclassify(double x)
|
|
{
|
|
union {double f; uint64_t i;} u = {x};
|
|
int e = u.i>>52 & 0x7ff;
|
|
if (!e) return u.i<<1 ? FP_SUBNORMAL : FP_ZERO;
|
|
if (e==0x7ff) return u.i<<12 ? FP_NAN : FP_INFINITE;
|
|
return FP_NORMAL;
|
|
}
|