summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorarseny.kapoulkine <arseny.kapoulkine@99668b35-9821-0410-8761-19e4c4f06640>2010-05-29 13:12:46 +0000
committerarseny.kapoulkine <arseny.kapoulkine@99668b35-9821-0410-8761-19e4c4f06640>2010-05-29 13:12:46 +0000
commitd3419f2f4bcac79065a8067d41630bd702046eb8 (patch)
tree7ea5eacaa28051d1d01ce4f76e0f746512e127d6
parentf262cbb6bea6b384a7fcdee837cda6c51a64fd99 (diff)
Added round_nearest_nzero explanation
git-svn-id: http://pugixml.googlecode.com/svn/trunk@462 99668b35-9821-0410-8761-19e4c4f06640
-rw-r--r--src/pugixpath.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/pugixpath.cpp b/src/pugixpath.cpp
index d20baad..2296814 100644
--- a/src/pugixpath.cpp
+++ b/src/pugixpath.cpp
@@ -444,6 +444,7 @@ namespace
double round_nearest_nzero(double value)
{
// same as round_nearest, but returns -0 for [-0.5, -0]
+ // ceil is used to differentiate between +0 and -0 (we return -0 for [-0.5, -0] and +0 for +0)
return (value >= -0.5 && value <= 0) ? ceil(value) : floor(value + 0.5);
}