# HG changeset patch # User JeanDo # Date 1323459830 -3600 # Node ID 6fa776a447681059e4869633b8b2c0a6bd872772 # Parent 48bbb1a8102723cafd817d2dab87239b9a13e2b0 BUGFIX spurious random NDL>0 during deco dive. diff -r 48bbb1a81027 -r 6fa776a44768 code_part1/OSTC_code_c_part2/p2_deco.c --- a/code_part1/OSTC_code_c_part2/p2_deco.c Fri Dec 09 20:43:46 2011 +0100 +++ b/code_part1/OSTC_code_c_part2/p2_deco.c Fri Dec 09 20:43:50 2011 +0100 @@ -1771,8 +1771,10 @@ } //---- ELSE make a linear approx for the last minute - // Usefull to have a meneaingfull rounding of NDL - ndl += (unsigned char)(0.5f + (M0-t)/(dTN2+dTHe)); + // Usefull to have a meaningfull rounding of NDL. + // But ONLY it positive (negativ casted to unsigned is bad). + if( M0 > t ) + ndl += (unsigned char)(0.5f + (M0-t)/(dTN2+dTHe)); break; } diff -r 48bbb1a81027 -r 6fa776a44768 code_part1/OSTC_code_c_part2/p2_deco.o Binary file code_part1/OSTC_code_c_part2/p2_deco.o has changed