diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-03-25 16:41:58 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-03-25 16:41:58 +0400 |
commit | 53d32a0bd2ca038c8fc6f82fac0009395c3d2490 (patch) | |
tree | b024b98c37bd3f2ad1f0f803a2f7eb80b02dc1ce /source/blender/blenlib/intern/math_base.c | |
parent | e99a23fc6b33b5097eab44aac19c2a089ddebce6 (diff) |
style cleanup: conform to style guide - mostly operator whitespace changes
Diffstat (limited to 'source/blender/blenlib/intern/math_base.c')
-rw-r--r-- | source/blender/blenlib/intern/math_base.c | 8 |
1 files changed, 3 insertions, 5 deletions
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; } - |