[PATCH] Fix CNS math, / vs. *
Anton Lundin
glance at acc.umu.se
Thu Jun 12 13:56:04 PDT 2014
Back in "Fix ATM-vs-bar confusion", e58f54cac, there was a typo that
broke CNS calculations.
This fixes them again.
Signed-off-by: Anton Lundin <glance at acc.umu.se>
---
divelist.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/divelist.c b/divelist.c
index decc07a..a075838 100644
--- a/divelist.c
+++ b/divelist.c
@@ -246,7 +246,7 @@ static int calculate_cns(struct dive *dive)
po2 = sample->po2.mbar;
} else {
int o2 = active_o2(dive, dc, sample->time);
- po2 = o2 / depth_to_atm(sample->depth.mm, dive);
+ po2 = o2 * depth_to_atm(sample->depth.mm, dive);
}
/* Find what table-row we should calculate % for */
for (j = 1; j < sizeof(cns_table) / (sizeof(int) * 3); j++)
--
1.9.1
More information about the subsurface
mailing list