summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/planner.c2
-rw-r--r--core/plannernotes.c4
2 files changed, 3 insertions, 3 deletions
diff --git a/core/planner.c b/core/planner.c
index 8fb03015b..8ace46e35 100644
--- a/core/planner.c
+++ b/core/planner.c
@@ -610,7 +610,7 @@ bool enough_gas(int current_cylinder)
if (!cyl->start.mbar)
return true;
if (cyl->type.size.mliter)
- return (float)(cyl->end.mbar - prefs.reserve_gas) * cyl->type.size.mliter / 1000.0 > (float) cyl->deco_gas_used.mliter;
+ return (cyl->end.mbar - prefs.reserve_gas) / 1000.0 * cyl->type.size.mliter > cyl->deco_gas_used.mliter;
else
return true;
}
diff --git a/core/plannernotes.c b/core/plannernotes.c
index 2e38aaff9..1773705b4 100644
--- a/core/plannernotes.c
+++ b/core/plannernotes.c
@@ -401,8 +401,8 @@ void add_plan_to_notes(struct diveplan *diveplan, struct dive *dive, bool show_d
translate("gettextFromC", "Warning:"),
translate("gettextFromC", "this is more gas than available in the specified cylinder!"));
else
- if ((float) cyl->end.mbar * cyl->type.size.mliter / 1000.0 / gas_compressibility_factor(&cyl->gasmix, cyl->end.mbar / 1000.0)
- < (float) cyl->deco_gas_used.mliter)
+ if (cyl->end.mbar / 1000.0 * cyl->type.size.mliter / gas_compressibility_factor(&cyl->gasmix, cyl->end.mbar / 1000.0)
+ < cyl->deco_gas_used.mliter)
snprintf(warning, sizeof(warning), "<br>&nbsp;&mdash; <span style='color: red;'>%s </span> %s",
translate("gettextFromC", "Warning:"),
translate("gettextFromC", "not enough reserve for gas sharing on ascent!"));