Skip to content

Commit

Permalink
use INFINITY and NAN instead of strtod
Browse files Browse the repository at this point in the history
  • Loading branch information
tkelman committed Apr 4, 2014
1 parent c4eeff3 commit c92eef6
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/support/libsupportinit.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include <locale.h>
#include <math.h>
#include "libsupport.h"

#ifdef __cplusplus
Expand All @@ -21,10 +22,10 @@ void libsupport_init(void)

ios_init_stdstreams();

D_PNAN = strtod("+NaN",NULL);
D_NNAN = -strtod("+NaN",NULL);
D_PINF = strtod("+Inf",NULL);
D_NINF = strtod("-Inf",NULL);
D_PNAN = +NAN;
D_NNAN = -NAN;
D_PINF = +INFINITY;
D_NINF = -INFINITY;
isInitialized=1;
}
}
Expand Down

0 comments on commit c92eef6

Please sign in to comment.