Fix finite precision bug

Use nearest function also when checking if a point is in the simulation
box to make it the same as when creating the grid. Up to now, a DELTA of
1e-12 was used, which can lead to a bug when the spacing differs by less
than that.
Status Job ID Name Coverage
  External
passed codecov/patch

100.0%
passed codecov/project

68.80023%
passed distcheck

00:06:31

failed foss-2018a

00:16:09

failed foss-2018a_debug

00:22:32

failed foss-2018a_min

00:15:43

failed foss-2018a_mpi

00:18:10

failed foss-2018a_mpi_debug

00:24:06

failed foss-2018a_mpi_min

00:17:31

failed foss-2018a_mpi_opt

00:18:54

failed foss-2018a_opt

00:16:58

failed foss-2018a_ppc

00:22:22

failed foss-2018a_ppc_mpi

00:16:42

canceled foss-2018a_valgrind

21:03:35

failed foss-2018b

00:16:19

failed foss-2018b_mpi

00:18:24

failed foss-2019a

00:16:23

failed foss-2019a_mpi

00:16:15

failed intel-2018a

00:20:45

failed intel-2018a_impi

00:18:35

failed intel-2018a_impi_omp

00:27:17

failed intel-2018a_omp

00:23:44

failed intel-2018b

00:17:33

failed intel-2018b_impi

00:18:38

failed intel-2019a

00:18:30

failed intel-2019a_impi

00:17:47

failed pgi-2017.10

00:50:33

failed pgi-2017.10_mpi

00:34:25

canceled tests

23:07:56

passed codecov/project

65.97589%
passed codecov/project

65.94479%
passed codecov/project

68.12461%
passed codecov/project

68.73361%
passed codecov/project

68.96733%
passed codecov/project

68.98265%
passed codecov/project

68.97453%