diff --git a/src/cmdstan/arguments/arg_single_real_bounded.hpp b/src/cmdstan/arguments/arg_single_real_bounded.hpp index fc071cc567..46feb2e93c 100644 --- a/src/cmdstan/arguments/arg_single_real_bounded.hpp +++ b/src/cmdstan/arguments/arg_single_real_bounded.hpp @@ -3,6 +3,7 @@ #include #include +#include /** Generic bounded real value argument */ @@ -21,7 +22,10 @@ class arg_single_real_bounded : public real_argument { _validity = std::to_string(lb).append(" <= ").append(name).append(" <= ").append( std::to_string(ub)); - _default = std::to_string(def); + + std::stringstream def_ss; + def_ss << def; + _default = def_ss.str(); _default_value = def; _value = _default_value; _lb = lb; diff --git a/src/cmdstan/arguments/arg_single_real_pos.hpp b/src/cmdstan/arguments/arg_single_real_pos.hpp index 3387aaa9f7..b97b27cca7 100644 --- a/src/cmdstan/arguments/arg_single_real_pos.hpp +++ b/src/cmdstan/arguments/arg_single_real_pos.hpp @@ -3,6 +3,7 @@ #include #include +#include /** Generic pos real value argument */ @@ -15,7 +16,10 @@ class arg_single_real_pos : public real_argument { _name = name; _description = desc; _validity = std::string("0 < ").append(name); - _default = std::to_string(def); + + std::stringstream def_ss; + def_ss << def; + _default = def_ss.str(); _default_value = def; _value = _default_value; }