From 412f5e32b460ba55adf2dbaf36a76e0f09f8e050 Mon Sep 17 00:00:00 2001 From: Marty Kraimer Date: Thu, 11 Apr 2002 15:49:24 +0000 Subject: [PATCH] allow for nan and inf --- src/dbStatic/dbStaticRun.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/dbStatic/dbStaticRun.c b/src/dbStatic/dbStaticRun.c index b566c8f02..104e28cdf 100644 --- a/src/dbStatic/dbStaticRun.c +++ b/src/dbStatic/dbStaticRun.c @@ -88,11 +88,16 @@ static void realToString(double value,char *preturn,int isdouble) if(value<0.0) {*preturn++ = '-'; value = -value;} logval = (int)log10(value); if(logval>6 || logval<-2 ) { + int nout; ise=TRUE; prec = precision[isdouble]; - sprintf(ptstr,"%.*e",prec,value); + nout = sprintf(ptstr,"%.*e",prec,value); loce = strchr(ptstr,'e'); - if(!loce) {errMessage(-1,"logic error in real to string"); return;} + if(!loce) { + ptstr[nout] = 0; + strcpy(preturn,ptstr); + return; + } *loce++ = 0; } else { prec = precision[isdouble]-logval;