1 #ifndef STAN_IO_VALIDATE_ZERO_BUF_HPP
2 #define STAN_IO_VALIDATE_ZERO_BUF_HPP
4 #include <boost/lexical_cast/bad_lexical_cast.hpp>
22 for (
size_t i = 0; i < buf.size(); ++i) {
23 if (buf[i] ==
'e' || buf[i] ==
'E')
25 if (buf[i] >=
'1' && buf[i] <=
'9')
26 boost::conversion::detail::throw_bad_cast<std::string,
double>();
Probability, optimization and sampling library.
void validate_zero_buf(const B &buf)
Throw an bad-cast exception if the specified buffer contains a digit other than 0 before an e or E...