Handle edge cases in laplace functions

Avoid division by zero.
Avoid taking the log of zero.
Silence clang type conversion warnings using round and trunc.
The existing values returned by the laplace functions do not change.

Add tests for laplace edge cases.
These changes pass the existing unit tests without modification.

Related to HS stats in #13192.
This commit is contained in:
teor
2014-12-25 20:30:18 +11:00
parent e8db9d0c94
commit 6d54bdbdcf
3 changed files with 226 additions and 15 deletions
+7
View File
@@ -0,0 +1,7 @@
o Minor bugfixes:
- Handle edge cases in the laplace functions:
* avoid division by zero
* avoid taking the log of zero
* silence clang type conversion warnings using round and trunc
- Add tests for laplace edge cases.
Related to HS stats in #13192.