diff options
author | Robert C. Helling <helling@atdotde.de> | 2017-12-25 10:43:25 +0100 |
---|---|---|
committer | Jan Mulder <jlmulder@xs4all.nl> | 2017-12-25 19:47:45 +0100 |
commit | ca38644005bbb91d5bc05be4d571b4082563c5f2 (patch) | |
tree | 5709335203e8b321c02e053897725f85631a1737 /core/deco.c | |
parent | 5eec251be8c8d208fbee103988b9f660a1999354 (diff) | |
download | subsurface-ca38644005bbb91d5bc05be4d571b4082563c5f2.tar.gz |
Prevent overflow in effective GF calculation
For deep dives with long deco, the sum of deco stops could
overflow. This is prevent by turning it into long.
Signed-off-by: Robert C. Helling <helling@atdotde.de>
Diffstat (limited to 'core/deco.c')
-rw-r--r-- | core/deco.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/core/deco.c b/core/deco.c index 4eb3fcd8a..5c8b55e24 100644 --- a/core/deco.c +++ b/core/deco.c @@ -153,8 +153,8 @@ const double vpmb_conservatism_lvls[] = { 1.0, 1.05, 1.12, 1.22, 1.35 }; #define TISSUE_ARRAY_SZ sizeof(ds->tissue_n2_sat) -int sumx, sum1; -long sumxx; +int sum1; +long sumx, sumxx; double sumy, sumxy; double get_crit_radius_He() @@ -649,7 +649,7 @@ double regressionb() void reset_regression() { - sumx = sum1 = 0; - sumxx = 0L; + sum1 = 0; + sumxx = sumx = 0L; sumy = sumxy = 0.0; } |