From 92c81f9fdd43f175d302028b56e7edbab81a7d06 Mon Sep 17 00:00:00 2001 From: David Parkhurst Date: Wed, 7 Nov 2018 15:04:54 -0700 Subject: [PATCH] Revised logic for nmix --- transport.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/transport.cpp b/transport.cpp index 0f573de4..457b9aff 100644 --- a/transport.cpp +++ b/transport.cpp @@ -1108,15 +1108,14 @@ init_mix(void) } else { - const int max_int = (int) (std::numeric_limits::max)(); - if ((int)round(2.25 * maxmix) > max_int) + if (2.25 * maxmix + 1.0 > (double)INT_MAX) { char token[MAX_LENGTH]; sprintf(token, "Calculated number of mixes %g, is beyond program limit,\nERROR: please decrease time_step.", 2.25 * maxmix); error_msg(token, STOP); } if (bcon_first == 1 || bcon_last == 1) - l_nmix = 1 + (long int) floorl(2.25 * maxmix); + l_nmix = 1 + (int) floor(2.25 * maxmix); else l_nmix = 1 + (int) floor(1.5 * maxmix);