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