summaryrefslogtreecommitdiffstats
path: root/src/util/mathfns.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/util/mathfns.h')
-rw-r--r--src/util/mathfns.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/util/mathfns.h b/src/util/mathfns.h
index 20c06145a..830e159da 100644
--- a/src/util/mathfns.h
+++ b/src/util/mathfns.h
@@ -48,7 +48,7 @@ inline double round_to_nearest_multiple_plus(double x, double const c1, double c
* If c1==0 (and c0 is finite), then returns +/-inf. This makes grid spacing of zero
* mean "ignore the grid in this dimension".
*/
-inline double round_to_lower_multiple_plus(double x, double const c1, double const c0)
+inline double round_to_lower_multiple_plus(double x, double const c1, double const c0 = 0)
{
return floor((x - c0) / c1) * c1 + c0;
}
@@ -60,7 +60,7 @@ inline double round_to_lower_multiple_plus(double x, double const c1, double con
* If c1==0 (and c0 is finite), then returns +/-inf. This makes grid spacing of zero
* mean "ignore the grid in this dimension".
*/
-inline double round_to_upper_multiple_plus(double x, double const c1, double const c0)
+inline double round_to_upper_multiple_plus(double x, double const c1, double const c0 = 0)
{
return ceil((x - c0) / c1) * c1 + c0;
}
@@ -80,4 +80,4 @@ inline double round_to_upper_multiple_plus(double x, double const c1, double con
fill-column:99
End:
*/
-// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :
+// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 :