From ac61b031a819b3039b6ed3bf1dd87c6b4b56e0d5 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Fri, 4 Mar 2011 19:46:27 +0100 Subject: Fix aliasing issues in CPU simulation --- src/diffraction.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/diffraction.c b/src/diffraction.c index 6b9daf7f..76dce6b6 100644 --- a/src/diffraction.c +++ b/src/diffraction.c @@ -388,11 +388,13 @@ void get_diffraction(struct image *image, int na, int nb, int nc, double I_molecule; struct rvec q; double twotheta; - const double dfs = fs + (fs_step / SAMPLING); - const double dss = ss + (ss_step / SAMPLING); + const double dfs = (double)fs + + ((double)fs_step / SAMPLING); + const double dss = (double)ss + + ((double)ss_step / SAMPLING); /* Calculate k this time round */ - k = klow + kstep * bwstep; + k = klow + (double)kstep * bwstep; q = get_q(image, dfs, dss, &twotheta, k); -- cgit v1.2.3