summaryrefslogtreecommitdiffstats
path: root/dive.h
diff options
context:
space:
mode:
Diffstat (limited to 'dive.h')
-rw-r--r--dive.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/dive.h b/dive.h
index a5c760640..f06791cc5 100644
--- a/dive.h
+++ b/dive.h
@@ -134,9 +134,10 @@ static inline int interpolate(int a, int b, int part, int whole)
return rint(x / whole);
}
-static inline depth_t gas_mod(struct gasmix *mix, pressure_t po2_limit) {
+/* MOD rounded to multiples of roundto mm */
+static inline depth_t gas_mod(struct gasmix *mix, pressure_t po2_limit, int roundto) {
depth_t depth;
- depth.mm = po2_limit.mbar * 1000 / get_o2(mix) * 10 - 10000;
+ depth.mm = ((po2_limit.mbar * 1000 / get_o2(mix) * 10 - 10000) / roundto) * roundto;
return depth;
}