summaryrefslogtreecommitdiffstats
path: root/src/util
diff options
context:
space:
mode:
Diffstat (limited to 'src/util')
-rw-r--r--src/util/mathfns.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/util/mathfns.h b/src/util/mathfns.h
index 20c06145a..e208ca93f 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;
}