Typo in CNS calculation

Robert Helling helling at atdotde.de
Fri Aug 9 14:23:06 PDT 2019


Willem,

could you please have a look at the final computation in static double calculate_cns_dive(const struct dive *dive)
in divelist.c

It seems to me that the first minus in

		cns += (double)t / ((double)cns_table[j][SINGLE_EXP] - ((double)po2i - (double)cns_table[j][PO2VAL]) * (double)cns_table[j][SINGLE_SLOPE] / 10.0) * 100;

should be plus (at least according to the formula in the comment above. At least, with this minus, you get negative CNS values for a planned air dive to 80m of depth.

Best
Robert

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.subsurface-divelog.org/pipermail/subsurface/attachments/20190809/251d14a6/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: Message signed with OpenPGP
URL: <http://lists.subsurface-divelog.org/pipermail/subsurface/attachments/20190809/251d14a6/attachment.sig>


More information about the subsurface mailing list