Fix handling of underflows and overflows in load_params_and_steady_state

Basically revert the change made in 30c205f418,
since it lead to preprocessor crashes (via C++ exceptions).
issue#70
Sébastien Villemot 2019-07-11 18:35:42 +02:00
parent 0988a1f755
commit e7b619c0ef
No known key found for this signature in database
GPG Key ID: 2CECE9350ECEBE4A
1 changed files with 4 additions and 1 deletions

View File

@ -619,5 +619,8 @@ void
LoadParamsAndSteadyStateStatement::fillEvalContext(eval_context_t &eval_context) const
{
for (const auto & it : content)
eval_context[it.first] = stod(it.second);
/* We use strtod() instead of stod() because we want overflows and
underflows to respectively yield 0 and ±Inf. See also the comment in
NumericalConstants.cc */
eval_context[it.first] = strtod(it.second.c_str(), nullptr);
}