1 /* Generated by Nim Compiler v1.6.2 */
2 #define NIM_INTBITS 32
3 #define NIM_EmulateOverflowChecks
4
5 #include "nimbase.h"
6 #include <math.h>
7 #undef LANGUAGE_C
8 #undef MIPSEB
9 #undef MIPSEL
10 #undef PPC
11 #undef R3000
12 #undef R4000
13 #undef i386
14 #undef linux
15 #undef mips
16 #undef near
17 #undef far
18 #undef powerpc
19 #undef unix
20 #define nimfr_(x, y)
21 #define nimln_(x, y)
22 typedef NU8 tyEnum_FloatClass__pPga1yW9b8J9cwNnm9b1aPRnA;
23 static N_INLINE(NF, abs__system_3474)(NF x);
N_NIMCALL(NI,nextPowerOfTwo__pureZmath_176)24 N_LIB_PRIVATE N_NIMCALL(NI, nextPowerOfTwo__pureZmath_176)(NI x) {
25 NI result;
26 result = (NI)0;
27 result = (NI)(x - ((NI) 1));
28 result = (NI)(result | (NI)((NI32)(result) >> (NU32)(((NI) 16))));
29 result = (NI)(result | (NI)((NI32)(result) >> (NU32)(((NI) 8))));
30 result = (NI)(result | (NI)((NI32)(result) >> (NU32)(((NI) 4))));
31 result = (NI)(result | (NI)((NI32)(result) >> (NU32)(((NI) 2))));
32 result = (NI)(result | (NI)((NI32)(result) >> (NU32)(((NI) 1))));
33 result += (NI)(((NI) 1) + (x <= ((NI) 0)));
34 return result;
35 }
N_INLINE(NF,abs__system_3474)36 static N_INLINE(NF, abs__system_3474)(NF x) {
37 NF result;
38 result = (NF)0;
39 result = fabs(x);
40 return result;
41 }
N_NIMCALL(tyEnum_FloatClass__pPga1yW9b8J9cwNnm9b1aPRnA,classify__pureZmath_147)42 N_LIB_PRIVATE N_NIMCALL(tyEnum_FloatClass__pPga1yW9b8J9cwNnm9b1aPRnA, classify__pureZmath_147)(NF x) {
43 tyEnum_FloatClass__pPga1yW9b8J9cwNnm9b1aPRnA result;
44 { result = (tyEnum_FloatClass__pPga1yW9b8J9cwNnm9b1aPRnA)0;
45 {
46 if (!(x == 0.0)) goto LA3_;
47 {
48 if (!(((NF)(1.0) / (NF)(x)) == INF)) goto LA7_;
49 result = ((tyEnum_FloatClass__pPga1yW9b8J9cwNnm9b1aPRnA) 2);
50 goto BeforeRet_;
51 }
52 goto LA5_;
53 LA7_: ;
54 {
55 result = ((tyEnum_FloatClass__pPga1yW9b8J9cwNnm9b1aPRnA) 3);
56 goto BeforeRet_;
57 }
58 LA5_: ;
59 }
60 LA3_: ;
61 {
62 if (!(((NF)(x) * (NF)(0.5)) == x)) goto LA12_;
63 {
64 if (!(0.0 < x)) goto LA16_;
65 result = ((tyEnum_FloatClass__pPga1yW9b8J9cwNnm9b1aPRnA) 5);
66 goto BeforeRet_;
67 }
68 goto LA14_;
69 LA16_: ;
70 {
71 result = ((tyEnum_FloatClass__pPga1yW9b8J9cwNnm9b1aPRnA) 6);
72 goto BeforeRet_;
73 }
74 LA14_: ;
75 }
76 LA12_: ;
77 {
78 if (!!((x == x))) goto LA21_;
79 result = ((tyEnum_FloatClass__pPga1yW9b8J9cwNnm9b1aPRnA) 4);
80 goto BeforeRet_;
81 }
82 LA21_: ;
83 {
84 NF T25_;
85 T25_ = (NF)0;
86 T25_ = abs__system_3474(x);
87 if (!(T25_ < 2.225073858507201e-308)) goto LA26_;
88 result = ((tyEnum_FloatClass__pPga1yW9b8J9cwNnm9b1aPRnA) 1);
89 goto BeforeRet_;
90 }
91 LA26_: ;
92 result = ((tyEnum_FloatClass__pPga1yW9b8J9cwNnm9b1aPRnA) 0);
93 goto BeforeRet_;
94 }BeforeRet_: ;
95 return result;
96 }
N_NIMCALL(NIM_BOOL,isPowerOfTwo__pureZmath_173)97 N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, isPowerOfTwo__pureZmath_173)(NI x) {
98 NIM_BOOL result;
99 NIM_BOOL T1_;
100 { result = (NIM_BOOL)0;
101 T1_ = (NIM_BOOL)0;
102 T1_ = (((NI) 0) < x);
103 if (!(T1_)) goto LA2_;
104 T1_ = ((NI)(x & (NI)(x - ((NI) 1))) == ((NI) 0));
105 LA2_: ;
106 result = T1_;
107 goto BeforeRet_;
108 }BeforeRet_: ;
109 return result;
110 }
111