[PATCH 1/3] _cairo_round: Fix documentation
Uli Schlachter
psychon at znc.in
Fri Oct 22 07:33:55 PDT 2010
Despite what the comment says, this function rounds halfway cases towards
positive infinity.
_cairo_round ( 0.5) => floor ( 1.0) => 1.0
_cairo_round (-0.5) => floor ( 0.0) => 0.0
_cairo_round (-1.5) => floor (-1.0) => -1.0
Signed-off-by: Uli Schlachter <psychon at znc.in>
---
src/cairoint.h | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/src/cairoint.h b/src/cairoint.h
index 5836101..53c87e5 100644
--- a/src/cairoint.h
+++ b/src/cairoint.h
@@ -956,7 +956,7 @@ _cairo_restrict_value (double value, double min, double max)
}
/* C99 round() rounds to the nearest integral value with halfway cases rounded
- * away from 0. _cairo_round rounds halfway cases toward negative infinity.
+ * away from 0. _cairo_round rounds halfway cases toward positive infinity.
* This matches the rounding behaviour of _cairo_lround. */
static inline double cairo_const
_cairo_round (double r)
--
1.7.2.3
--------------000402080900070308030407
Content-Type: text/x-diff;
name="0002-Make-both-versions-of-_cairo_lround-consistent-again.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
filename*0="0002-Make-both-versions-of-_cairo_lround-consistent-again.pa";
filename*1="tch"
More information about the cairo
mailing list