Detect too large values
This commit is contained in:
parent
5a53ba3f50
commit
3e0eb5d58a
1 changed files with 9 additions and 0 deletions
|
@ -1,6 +1,10 @@
|
||||||
/* $Header$ */
|
/* $Header$ */
|
||||||
#ifndef NOFLOAT
|
#ifndef NOFLOAT
|
||||||
|
|
||||||
|
#if __STDC__
|
||||||
|
#include <float.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
static char *cvt();
|
static char *cvt();
|
||||||
#define NDIGITS 128
|
#define NDIGITS 128
|
||||||
|
|
||||||
|
@ -55,6 +59,11 @@ cvt(value, ndigit, decpt, sign, ecvtflag)
|
||||||
}
|
}
|
||||||
|
|
||||||
*decpt = 0;
|
*decpt = 0;
|
||||||
|
#if __STDC__
|
||||||
|
if (value >= DBL_MAX) {
|
||||||
|
value = DBL_MAX;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
if (value != 0.0) {
|
if (value != 0.0) {
|
||||||
register struct powers_of_10 *pp = &p10[0];
|
register struct powers_of_10 *pp = &p10[0];
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue