aboutsummaryrefslogtreecommitdiff
path: root/src/check_hkl.c
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2018-12-18 11:09:32 +0100
committerThomas White <taw@physics.org>2018-12-18 15:38:13 +0100
commit9b9bc02ddc7a040b6367844498b5be87437d1ced (patch)
tree277322eb283dab4931977f03b9d7b498ac78433f /src/check_hkl.c
parent80f8f5927de74b87115fd7bab01c9d578f1685ca (diff)
check_hkl: Catch NaN L-value due to two zeroed negative intensities
Diffstat (limited to 'src/check_hkl.c')
-rw-r--r--src/check_hkl.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/check_hkl.c b/src/check_hkl.c
index 018200cf..ba577d45 100644
--- a/src/check_hkl.c
+++ b/src/check_hkl.c
@@ -95,6 +95,11 @@ static int add_ltest(RefList *list, double i1, int *bins, int nbins,
i2 = get_intensity(refl);
L = (i1-i2) / (i1+i2);
+ if ( isnan(L) ) {
+ /* This happens with --zero-negs and two negative intensities,
+ * because L=(0-0)/(0+0) */
+ return 0;
+ }
bin = fabs(L)/step;
if ( (bin < 0) || (isnan(L)) ) {