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
parent
0988a1f755
commit
e7b619c0ef
|
@ -619,5 +619,8 @@ void
|
||||||
LoadParamsAndSteadyStateStatement::fillEvalContext(eval_context_t &eval_context) const
|
LoadParamsAndSteadyStateStatement::fillEvalContext(eval_context_t &eval_context) const
|
||||||
{
|
{
|
||||||
for (const auto & it : content)
|
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);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue