diff options
author | Daniel Wilhelm <daniel@wili.li> | 2014-04-18 17:27:42 +0200 |
---|---|---|
committer | Daniel Wilhelm <daniel@wili.li> | 2014-04-18 17:27:42 +0200 |
commit | b916407a2a06f8452e82b74dc44c54acbcc572b0 (patch) | |
tree | 46358e0bb035fca0f42edb4b5b8aa5f1613814af /zen/basic_math.h | |
parent | 5.20 (diff) | |
download | FreeFileSync-b916407a2a06f8452e82b74dc44c54acbcc572b0.tar.gz FreeFileSync-b916407a2a06f8452e82b74dc44c54acbcc572b0.tar.bz2 FreeFileSync-b916407a2a06f8452e82b74dc44c54acbcc572b0.zip |
5.21
Diffstat (limited to 'zen/basic_math.h')
-rw-r--r-- | zen/basic_math.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/zen/basic_math.h b/zen/basic_math.h index 05d892ee..56cfd923 100644 --- a/zen/basic_math.h +++ b/zen/basic_math.h @@ -228,6 +228,8 @@ bool isNull(T value) inline int round(double d) { + assert(d - 0.5 >= std::numeric_limits<int>::min() && //if double is larger than what int can represent: + d + 0.5 <= std::numeric_limits<int>::max()); //=> undefined behavior! return static_cast<int>(d < 0 ? d - 0.5 : d + 0.5); } |