diff options
author | Valerio Mariani <valerio.mariani@desy.de> | 2018-04-25 17:51:41 +0200 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2018-04-26 09:22:07 +0200 |
commit | 3060d089df6730be78e50949eda5e728959c997d (patch) | |
tree | f8bb9046f684ebc4739ea58b5071435f12fb7769 | |
parent | 56df3b6d76247b41de02bcd02c0c46d09eaeee0b (diff) |
Use max and mix float values to initialize variables
-rw-r--r-- | libcrystfel/src/peakfinder8.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/libcrystfel/src/peakfinder8.c b/libcrystfel/src/peakfinder8.c index 3747fda6..f96750de 100644 --- a/libcrystfel/src/peakfinder8.c +++ b/libcrystfel/src/peakfinder8.c @@ -32,6 +32,7 @@ #include <config.h> #endif +#include <float.h> #include <math.h> #include <stdlib.h> @@ -399,8 +400,8 @@ static void compute_radial_stats(float *rthreshold, if ( rcount[ri] == 0 ) { roffset[ri] = 0; rsigma[ri] = 0; - rthreshold[ri] = 1e9; - lthreshold[ri] = -1e9; + rthreshold[ri] = FLT_MAX; + lthreshold[ri] = FLT_MIN; } else { this_offset = roffset[ri] / rcount[ri]; this_sigma = rsigma[ri] / rcount[ri] - (this_offset * this_offset); |