Add function to calculate gas maximum narcotic depth

Signed-off-by: Rick Walsh <rickmwalsh@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Rick Walsh 2016-07-06 22:40:31 +10:00 committed by Dirk Hohndel
parent 1ba61d7ad5
commit 9fbd11744f
6 changed files with 20 additions and 9 deletions

View file

@ -3661,7 +3661,7 @@ fraction_t best_He(depth_t depth, struct dive *dive)
{
fraction_t fhe;
int pnarcotic, ambient;
pnarcotic = depth_to_mbar(prefs.bestmixend, dive);
pnarcotic = depth_to_mbar(prefs.bestmixend.mm, dive);
ambient = depth_to_mbar(depth.mm, dive);
fhe.permille = (100 - 100 * pnarcotic / ambient) * 10; //use integer arithmetic to round up to nearest percent
if (fhe.permille < 0)