2525#line 8 "nan_test.pgc"
2626
2727
28+ #ifdef WIN32
29+ #define isinf (x ) ((_fpclass(x) == _FPCLASS_PINF) || (_fpclass(x) == _FPCLASS_NINF))
30+ #define isnan (x ) _isnan(x)
31+ #endif /* WIN32 */
32+
2833int
2934main (void )
3035{
@@ -34,54 +39,54 @@ main(void)
3439
3540
3641
37- #line 14 "nan_test.pgc"
42+ #line 19 "nan_test.pgc"
3843 int id ;
3944
40- #line 15 "nan_test.pgc"
45+ #line 20 "nan_test.pgc"
4146 double d ;
4247
43- #line 16 "nan_test.pgc"
48+ #line 21 "nan_test.pgc"
4449 numeric * num ;
4550
46- #line 17 "nan_test.pgc"
51+ #line 22 "nan_test.pgc"
4752 char val [ 16 ] ;
4853/* exec sql end declare section */
49- #line 18 "nan_test.pgc"
54+ #line 23 "nan_test.pgc"
5055
5156
5257 ECPGdebug (1 , stderr );
5358 /* exec sql whenever sqlerror do sqlprint ( ) ; */
54- #line 21 "nan_test.pgc"
59+ #line 26 "nan_test.pgc"
5560
5661
5762 { ECPGconnect (__LINE__ , 0 , "regress1" , NULL , NULL , NULL , 0 );
58- #line 23 "nan_test.pgc"
63+ #line 28 "nan_test.pgc"
5964
6065if (sqlca .sqlcode < 0 ) sqlprint ( );}
61- #line 23 "nan_test.pgc"
66+ #line 28 "nan_test.pgc"
6267
6368
6469 { ECPGdo (__LINE__ , 0 , 1 , NULL , 0 , ECPGst_normal , "create table nantest1 ( id int4 , d float8 )" , ECPGt_EOIT , ECPGt_EORT );
65- #line 25 "nan_test.pgc"
70+ #line 30 "nan_test.pgc"
6671
6772if (sqlca .sqlcode < 0 ) sqlprint ( );}
68- #line 25 "nan_test.pgc"
73+ #line 30 "nan_test.pgc"
6974
7075 { ECPGdo (__LINE__ , 0 , 1 , NULL , 0 , ECPGst_normal , "insert into nantest1 ( id , d ) values ( 1 , 'nan' :: float8 ) , ( 2 , 'infinity' :: float8 ) , ( 3 , '-infinity' :: float8 )" , ECPGt_EOIT , ECPGt_EORT );
71- #line 26 "nan_test.pgc"
76+ #line 31 "nan_test.pgc"
7277
7378if (sqlca .sqlcode < 0 ) sqlprint ( );}
74- #line 26 "nan_test.pgc"
79+ #line 31 "nan_test.pgc"
7580
7681
7782 /* declare cur cursor for select id , d , d from nantest1 */
78- #line 28 "nan_test.pgc"
83+ #line 33 "nan_test.pgc"
7984
8085 { ECPGdo (__LINE__ , 0 , 1 , NULL , 0 , ECPGst_normal , "declare cur cursor for select id , d , d from nantest1" , ECPGt_EOIT , ECPGt_EORT );
81- #line 29 "nan_test.pgc"
86+ #line 34 "nan_test.pgc"
8287
8388if (sqlca .sqlcode < 0 ) sqlprint ( );}
84- #line 29 "nan_test.pgc"
89+ #line 34 "nan_test.pgc"
8590
8691 while (1 )
8792 {
@@ -92,10 +97,10 @@ if (sqlca.sqlcode < 0) sqlprint ( );}
9297 ECPGt_NO_INDICATOR , NULL , 0L , 0L , 0L ,
9398 ECPGt_char ,(val ),(long )16 ,(long )1 ,(16 )* sizeof (char ),
9499 ECPGt_NO_INDICATOR , NULL , 0L , 0L , 0L , ECPGt_EORT );
95- #line 32 "nan_test.pgc"
100+ #line 37 "nan_test.pgc"
96101
97102if (sqlca .sqlcode < 0 ) sqlprint ( );}
98- #line 32 "nan_test.pgc"
103+ #line 37 "nan_test.pgc"
99104
100105 if (sqlca .sqlcode )
101106 break ;
@@ -109,34 +114,34 @@ if (sqlca.sqlcode < 0) sqlprint ( );}
109114 ECPGt_NO_INDICATOR , NULL , 0L , 0L , 0L ,
110115 ECPGt_double ,& (d ),(long )1 ,(long )1 ,sizeof (double ),
111116 ECPGt_NO_INDICATOR , NULL , 0L , 0L , 0L , ECPGt_EOIT , ECPGt_EORT );
112- #line 40 "nan_test.pgc"
117+ #line 45 "nan_test.pgc"
113118
114119if (sqlca .sqlcode < 0 ) sqlprint ( );}
115- #line 40 "nan_test.pgc"
120+ #line 45 "nan_test.pgc"
116121
117122 { ECPGdo (__LINE__ , 0 , 1 , NULL , 0 , ECPGst_normal , "insert into nantest1 ( id , d ) values ( $1 + 6 , $2 )" ,
118123 ECPGt_int ,& (id ),(long )1 ,(long )1 ,sizeof (int ),
119124 ECPGt_NO_INDICATOR , NULL , 0L , 0L , 0L ,
120125 ECPGt_char ,(val ),(long )16 ,(long )1 ,(16 )* sizeof (char ),
121126 ECPGt_NO_INDICATOR , NULL , 0L , 0L , 0L , ECPGt_EOIT , ECPGt_EORT );
122- #line 41 "nan_test.pgc"
127+ #line 46 "nan_test.pgc"
123128
124129if (sqlca .sqlcode < 0 ) sqlprint ( );}
125- #line 41 "nan_test.pgc"
130+ #line 46 "nan_test.pgc"
126131
127132 }
128133 { ECPGdo (__LINE__ , 0 , 1 , NULL , 0 , ECPGst_normal , "close cur" , ECPGt_EOIT , ECPGt_EORT );
129- #line 43 "nan_test.pgc"
134+ #line 48 "nan_test.pgc"
130135
131136if (sqlca .sqlcode < 0 ) sqlprint ( );}
132- #line 43 "nan_test.pgc"
137+ #line 48 "nan_test.pgc"
133138
134139
135140 { ECPGdo (__LINE__ , 0 , 1 , NULL , 0 , ECPGst_normal , "declare cur cursor for select id , d , d from nantest1" , ECPGt_EOIT , ECPGt_EORT );
136- #line 45 "nan_test.pgc"
141+ #line 50 "nan_test.pgc"
137142
138143if (sqlca .sqlcode < 0 ) sqlprint ( );}
139- #line 45 "nan_test.pgc"
144+ #line 50 "nan_test.pgc"
140145
141146 while (1 )
142147 {
@@ -147,10 +152,10 @@ if (sqlca.sqlcode < 0) sqlprint ( );}
147152 ECPGt_NO_INDICATOR , NULL , 0L , 0L , 0L ,
148153 ECPGt_char ,(val ),(long )16 ,(long )1 ,(16 )* sizeof (char ),
149154 ECPGt_NO_INDICATOR , NULL , 0L , 0L , 0L , ECPGt_EORT );
150- #line 48 "nan_test.pgc"
155+ #line 53 "nan_test.pgc"
151156
152157if (sqlca .sqlcode < 0 ) sqlprint ( );}
153- #line 48 "nan_test.pgc"
158+ #line 53 "nan_test.pgc"
154159
155160 if (sqlca .sqlcode )
156161 break ;
@@ -160,25 +165,25 @@ if (sqlca.sqlcode < 0) sqlprint ( );}
160165 printf ("%d NaN '%s'\n" , id , val );
161166 }
162167 { ECPGdo (__LINE__ , 0 , 1 , NULL , 0 , ECPGst_normal , "close cur" , ECPGt_EOIT , ECPGt_EORT );
163- #line 56 "nan_test.pgc"
168+ #line 61 "nan_test.pgc"
164169
165170if (sqlca .sqlcode < 0 ) sqlprint ( );}
166- #line 56 "nan_test.pgc"
171+ #line 61 "nan_test.pgc"
167172
168173
169174 num = PGTYPESnumeric_new ();
170175
171176 { ECPGdo (__LINE__ , 0 , 1 , NULL , 0 , ECPGst_normal , "create table nantest2 ( id int4 , d numeric )" , ECPGt_EOIT , ECPGt_EORT );
172- #line 60 "nan_test.pgc"
177+ #line 65 "nan_test.pgc"
173178
174179if (sqlca .sqlcode < 0 ) sqlprint ( );}
175- #line 60 "nan_test.pgc"
180+ #line 65 "nan_test.pgc"
176181
177182 { ECPGdo (__LINE__ , 0 , 1 , NULL , 0 , ECPGst_normal , "insert into nantest2 ( id , d ) values ( 4 , 'nan' :: numeric )" , ECPGt_EOIT , ECPGt_EORT );
178- #line 61 "nan_test.pgc"
183+ #line 66 "nan_test.pgc"
179184
180185if (sqlca .sqlcode < 0 ) sqlprint ( );}
181- #line 61 "nan_test.pgc"
186+ #line 66 "nan_test.pgc"
182187
183188
184189 { ECPGdo (__LINE__ , 0 , 1 , NULL , 0 , ECPGst_normal , "select id , d , d from nantest2 where id = 4" , ECPGt_EOIT ,
@@ -188,39 +193,39 @@ if (sqlca.sqlcode < 0) sqlprint ( );}
188193 ECPGt_NO_INDICATOR , NULL , 0L , 0L , 0L ,
189194 ECPGt_char ,(val ),(long )16 ,(long )1 ,(16 )* sizeof (char ),
190195 ECPGt_NO_INDICATOR , NULL , 0L , 0L , 0L , ECPGt_EORT );
191- #line 63 "nan_test.pgc"
196+ #line 68 "nan_test.pgc"
192197
193198if (sqlca .sqlcode < 0 ) sqlprint ( );}
194- #line 63 "nan_test.pgc"
199+ #line 68 "nan_test.pgc"
195200
196201
197202 printf ("%d %s '%s'\n" , id , (num -> sign == NUMERIC_NAN ? "NaN" : "not NaN" ), val );
198203
199204 { ECPGdo (__LINE__ , 0 , 1 , NULL , 0 , ECPGst_normal , "insert into nantest2 ( id , d ) values ( 5 , $1 )" ,
200205 ECPGt_numeric ,& (num ),(long )1 ,(long )0 ,sizeof (numeric ),
201206 ECPGt_NO_INDICATOR , NULL , 0L , 0L , 0L , ECPGt_EOIT , ECPGt_EORT );
202- #line 67 "nan_test.pgc"
207+ #line 72 "nan_test.pgc"
203208
204209if (sqlca .sqlcode < 0 ) sqlprint ( );}
205- #line 67 "nan_test.pgc"
210+ #line 72 "nan_test.pgc"
206211
207212 { ECPGdo (__LINE__ , 0 , 1 , NULL , 0 , ECPGst_normal , "insert into nantest2 ( id , d ) values ( 6 , $1 )" ,
208213 ECPGt_char ,(val ),(long )16 ,(long )1 ,(16 )* sizeof (char ),
209214 ECPGt_NO_INDICATOR , NULL , 0L , 0L , 0L , ECPGt_EOIT , ECPGt_EORT );
210- #line 68 "nan_test.pgc"
215+ #line 73 "nan_test.pgc"
211216
212217if (sqlca .sqlcode < 0 ) sqlprint ( );}
213- #line 68 "nan_test.pgc"
218+ #line 73 "nan_test.pgc"
214219
215220
216221 /* declare cur1 cursor for select id , d , d from nantest2 */
217- #line 70 "nan_test.pgc"
222+ #line 75 "nan_test.pgc"
218223
219224 { ECPGdo (__LINE__ , 0 , 1 , NULL , 0 , ECPGst_normal , "declare cur1 cursor for select id , d , d from nantest2" , ECPGt_EOIT , ECPGt_EORT );
220- #line 71 "nan_test.pgc"
225+ #line 76 "nan_test.pgc"
221226
222227if (sqlca .sqlcode < 0 ) sqlprint ( );}
223- #line 71 "nan_test.pgc"
228+ #line 76 "nan_test.pgc"
224229
225230 while (1 )
226231 {
@@ -231,33 +236,33 @@ if (sqlca.sqlcode < 0) sqlprint ( );}
231236 ECPGt_NO_INDICATOR , NULL , 0L , 0L , 0L ,
232237 ECPGt_char ,(val ),(long )16 ,(long )1 ,(16 )* sizeof (char ),
233238 ECPGt_NO_INDICATOR , NULL , 0L , 0L , 0L , ECPGt_EORT );
234- #line 74 "nan_test.pgc"
239+ #line 79 "nan_test.pgc"
235240
236241if (sqlca .sqlcode < 0 ) sqlprint ( );}
237- #line 74 "nan_test.pgc"
242+ #line 79 "nan_test.pgc"
238243
239244 if (sqlca .sqlcode )
240245 break ;
241246 printf ("%d %s '%s'\n" , id , (num -> sign == NUMERIC_NAN ? "NaN" : "not NaN" ), val );
242247 }
243248 { ECPGdo (__LINE__ , 0 , 1 , NULL , 0 , ECPGst_normal , "close cur1" , ECPGt_EOIT , ECPGt_EORT );
244- #line 79 "nan_test.pgc"
249+ #line 84 "nan_test.pgc"
245250
246251if (sqlca .sqlcode < 0 ) sqlprint ( );}
247- #line 79 "nan_test.pgc"
252+ #line 84 "nan_test.pgc"
248253
249254
250255 { ECPGtrans (__LINE__ , NULL , "rollback" );
251- #line 81 "nan_test.pgc"
256+ #line 86 "nan_test.pgc"
252257
253258if (sqlca .sqlcode < 0 ) sqlprint ( );}
254- #line 81 "nan_test.pgc"
259+ #line 86 "nan_test.pgc"
255260
256261 { ECPGdisconnect (__LINE__ , "CURRENT" );
257- #line 82 "nan_test.pgc"
262+ #line 87 "nan_test.pgc"
258263
259264if (sqlca .sqlcode < 0 ) sqlprint ( );}
260- #line 82 "nan_test.pgc"
265+ #line 87 "nan_test.pgc"
261266
262267
263268 return (0 );
0 commit comments