aboutsummaryrefslogtreecommitdiff
path: root/src/util.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/util.c')
-rw-r--r--src/util.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/util.c b/src/util.c
index edb02f9b7..e41703475 100644
--- a/src/util.c
+++ b/src/util.c
@@ -608,7 +608,12 @@ do_atof_calc:
while( e<=-10 ){ e+=10; r *= 1.0e-10L; }
while( e<=-1 ){ e+=1; r *= 1.0e-01L; }
}
- *pResult = r;
+ assert( r>=0.0 );
+ if( r>+1.7976931348623157081452742373e+308L ){
+ *pResult = +INFINITY;
+ }else{
+ *pResult = (double)r;
+ }
}else{
double rr[2];
u64 s2;