From 53d32a0bd2ca038c8fc6f82fac0009395c3d2490 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 25 Mar 2012 12:41:58 +0000 Subject: style cleanup: conform to style guide - mostly operator whitespace changes --- source/blender/blenlib/intern/math_base.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'source/blender/blenlib/intern/math_base.c') diff --git a/source/blender/blenlib/intern/math_base.c b/source/blender/blenlib/intern/math_base.c index f2df36202fe..9efcb3dbcae 100644 --- a/source/blender/blenlib/intern/math_base.c +++ b/source/blender/blenlib/intern/math_base.c @@ -60,7 +60,6 @@ double round(double x) double round(double x); #endif - /* from python 3.1 floatobject.c * ndigits must be between 0 and 21 */ double double_round(double x, int ndigits) @@ -69,7 +68,7 @@ double double_round(double x, int ndigits) if (ndigits >= 0) { pow1 = pow(10.0, (double)ndigits); pow2 = 1.0; - y = (x*pow1)*pow2; + y = (x * pow1) * pow2; /* if y overflows, then rounded value is exactly x */ if (!finite(y)) return x; @@ -81,9 +80,9 @@ double double_round(double x, int ndigits) } z = round(y); - if (fabs(y-z) == 0.5) + if (fabs(y - z) == 0.5) /* halfway between two integers; use round-half-even */ - z = 2.0*round(y/2.0); + z = 2.0 * round(y / 2.0); if (ndigits >= 0) z = (z / pow2) / pow1; @@ -93,4 +92,3 @@ double double_round(double x, int ndigits) /* if computation resulted in overflow, raise OverflowError */ return z; } - -- cgit v1.2.3