Wrap single line statements inside braces.
This commit is contained in:
+10
-5
@@ -18,26 +18,30 @@ double round(double x)
|
||||
double floor(double x)
|
||||
{
|
||||
if (x > -1.0 && x < 1.0) {
|
||||
if (x >= 0)
|
||||
if (x >= 0) {
|
||||
return 0.0;
|
||||
}
|
||||
return -1.0;
|
||||
}
|
||||
int i = (int)x;
|
||||
if (x < 0)
|
||||
if (x < 0) {
|
||||
return (double)(i - 1);
|
||||
}
|
||||
return (double)i;
|
||||
}
|
||||
|
||||
double ceil(double x)
|
||||
{
|
||||
if (x > -1.0 && x < 1.0) {
|
||||
if (x <= 0)
|
||||
if (x <= 0) {
|
||||
return 0.0;
|
||||
}
|
||||
return 1.0;
|
||||
}
|
||||
int i = (int)x;
|
||||
if (x > 0)
|
||||
if (x > 0) {
|
||||
return (double)(i + 1);
|
||||
}
|
||||
return (double)i;
|
||||
}
|
||||
|
||||
@@ -145,8 +149,9 @@ double ln(double x)
|
||||
double logx(double x, double y)
|
||||
{
|
||||
// Base may not equal 1 or be negative.
|
||||
if (y == 1.f || y < 0.f || ln(y) == 0.f)
|
||||
if (y == 1.f || y < 0.f || ln(y) == 0.f) {
|
||||
return 0.f;
|
||||
}
|
||||
return ln(x) / ln(y);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user