Rev 8155 | Rev 8185 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 8155 | Rev 8171 | ||
---|---|---|---|
Line 25... | Line 25... | ||
25 | char buf[16]; |
25 | char buf[16]; |
26 | int i; |
26 | int i; |
27 | if(d==0) { |
27 | if(d==0) { |
28 | ovlstrcpy(p,"0"); return; |
28 | ovlstrcpy(p,"0"); return; |
29 | } |
29 | } |
30 | if(! |
30 | if(!isfinite(d)) { /* isinf, isnan possibly not available */ |
31 | if (d == d) ovlstrcpy(p, (d > 0)? "Inf": "-Inf"); else ovlstrcpy(p,"NaN"); |
31 | if (d == d) ovlstrcpy(p, (d > 0)? "Inf": "-Inf"); else ovlstrcpy(p,"NaN"); |
32 | return; |
32 | return; |
33 | } |
33 | } |
34 | if(d<1000000 && d>-1000000 && d==floor(d)) { |
34 | if(d<1000000 && d>-1000000 && d==floor(d)) { |
35 | mystrncpy(p,int2str(d),MAX_LINELEN); return; |
35 | mystrncpy(p,int2str(d),MAX_LINELEN); return; |
Line 199... | Line 199... | ||
199 | forstruct.from=0; forstruct.to=-1; forstruct.step=1; return 0; |
199 | forstruct.from=0; forstruct.to=-1; forstruct.step=1; return 0; |
200 | } |
200 | } |
201 | for(i=0, inp=bp; i<MAX_VALUE_LIST && inp!=NULL; inp=top) { |
201 | for(i=0, inp=bp; i<MAX_VALUE_LIST && inp!=NULL; inp=top) { |
202 | top=strparchr(inp,','); if(top) *top++=0; |
202 | top=strparchr(inp,','); if(top) *top++=0; |
203 | if(bufp==NULL) { |
203 | if(bufp==NULL) { |
204 | d=evalue(inp); if( |
204 | d=evalue(inp); if(isfinite(d)) forstruct.list[i++]=d; |
205 | else return 1; |
205 | else return 1; |
206 | } |
206 | } |
207 | else { |
207 | else { |
208 | strip_trailing_spaces(inp); |
208 | strip_trailing_spaces(inp); |
209 | forstruct.pos[i++]=find_word_start(inp); |
209 | forstruct.pos[i++]=find_word_start(inp); |
Line 229... | Line 229... | ||
229 | if(fromp==NULL) return -1; |
229 | if(fromp==NULL) return -1; |
230 | *fromp=0; fromp+=strlen("from"); |
230 | *fromp=0; fromp+=strlen("from"); |
231 | } |
231 | } |
232 | forstruct.from=evalue(fromp); |
232 | forstruct.from=evalue(fromp); |
233 | if(for_getvar(p)) return -1; |
233 | if(for_getvar(p)) return -1; |
234 | if(! |
234 | if(!isfinite(forstruct.from+forstruct.to+forstruct.step)) return 1; |
235 | else return 0; |
235 | else return 0; |
236 | } |
236 | } |
237 | 237 |