From eb53f06ee68436a7f537e8f12cea070f0c0daba5 Mon Sep 17 00:00:00 2001 From: jthorn Date: Sun, 13 Aug 2006 20:10:20 +0000 Subject: += a few more sanity checks git-svn-id: http://svn.aei.mpg.de/numrel/AEIThorns/AEILocalInterp/trunk@37 0f49ee68-0e4f-0410-9b9c-b2c123ded7ef --- src/molecule_posn.c | 7 +++++++ 1 file changed, 7 insertions(+) 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) -- cgit v1.2.3