version 1.7, 2000/09/23 15:47:07
|
version 1.9, 2007/12/31 17:34:59
|
Line 1
|
Line 1
|
/* cheap ecvt replacement |
/* cheap ecvt replacement |
|
|
Copyright (C) 1998,2000 Free Software Foundation, Inc. |
Copyright (C) 1998,2000,2007 Free Software Foundation, Inc. |
|
|
This file is part of Gforth. |
This file is part of Gforth. |
|
|
Line 33 char* ecvt(double x, int len, int* exp,
|
Line 33 char* ecvt(double x, int len, int* exp,
|
int i, j; |
int i, j; |
double z; |
double z; |
|
|
|
if (isnan(x)) { |
|
*sign=0; |
|
*exp=0; |
|
return "nan"; |
|
} |
|
if (isinf(x)) { |
|
*sign=0; /* this mimics the glibc ecvt */ |
|
*exp=0; |
|
if (x<0) |
|
return "-inf"; |
|
else |
|
return "inf"; |
|
} |
|
|
if(len > (MAXCONV-1)) len = MAXCONV-1; |
if(len > (MAXCONV-1)) len = MAXCONV-1; |
|
|
if(x<0) |
if(x<0) |