aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/detector.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/detector.c b/src/detector.c
index 5b12b007..3da5c643 100644
--- a/src/detector.c
+++ b/src/detector.c
@@ -202,8 +202,10 @@ void record_image(struct image *image, int do_water, int do_poisson,
if ( do_poisson ) {
counts = poisson_noise(intensity * ph_per_e * sa * DQE);
} else {
+ double rounded;
cf = intensity * ph_per_e * sa * DQE;
- counts = (int)cf;
+ rounded = rint(cf);
+ counts = (int)rounded;
}
image->hdr[x + image->width*y] = counts;