diff options
author | Thomas White <taw@physics.org> | 2010-01-08 14:55:13 +0100 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2010-01-08 14:55:13 +0100 |
commit | a374cdb2396659d711f85851cb0904ccf7c9731d (patch) | |
tree | 5b63c80820293aa5b25c805352dc2c928a5f9a30 /src/utils.c | |
parent | ed795ee42e10c2fc3176d960a5c8b8ea29d3ea8a (diff) |
Small fixes
Diffstat (limited to 'src/utils.c')
-rw-r--r-- | src/utils.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/utils.c b/src/utils.c index 1f72c558..cad7ff1b 100644 --- a/src/utils.c +++ b/src/utils.c @@ -102,11 +102,11 @@ int poisson_noise(double expected) int k = 0; double p = 1.0; - L = exp(-expected); - /* For large values of the mean, we get big problems with arithmetic. * In such cases, fall back on a Gaussian with the right variance. */ - if ( !isnormal(L) ) return fake_poisson_noise(expected); + if ( L > 100.0 ) return fake_poisson_noise(expected); + + L = exp(-expected); do { |