aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/molecule_posn.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/molecule_posn.c b/src/molecule_posn.c
index f078286..cfd0642 100644
--- a/src/molecule_posn.c
+++ b/src/molecule_posn.c
@@ -172,6 +172,8 @@ static const char *rcsid = "$Header$";
(i.e. x > the maximum allowable x)
MOLECULE_POSN_ERROR_GRID_TINY
if the grid is smaller than the molecule
+ MOLECULE_POSN_ERROR_NAN
+ if we encounter a NaN or other non-finite floating-point value
@endreturndesc
@@*/
int AEILocalInterp_molecule_posn(fp grid_origin, fp grid_delta,
@@ -225,6 +227,11 @@ if (molecule_size > HOW_MANY_IN_RANGE(grid_i_min,grid_i_max))
/* has someone passed us NaNs for coordinates etc? */
if (!finite(grid_origin) || !finite(grid_delta) || !finite(x))
then return MOLECULE_POSN_ERROR_NAN;
+if ( !finite(boundary_off_centering_tolerance_min)
+ || !finite(boundary_off_centering_tolerance_max)
+ || !finite(boundary_extrapolation_tolerance_min)
+ || !finite(boundary_extrapolation_tolerance_max) )
+ then return MOLECULE_POSN_ERROR_NAN;
/* ditto if the grid spacing is zero (we'll need to divide by it)! */
if (grid_delta == 0.0)