From d3419f2f4bcac79065a8067d41630bd702046eb8 Mon Sep 17 00:00:00 2001 From: "arseny.kapoulkine" Date: Sat, 29 May 2010 13:12:46 +0000 Subject: Added round_nearest_nzero explanation git-svn-id: http://pugixml.googlecode.com/svn/trunk@462 99668b35-9821-0410-8761-19e4c4f06640 --- src/pugixpath.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src/pugixpath.cpp') 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); } -- cgit v1.2.3