Opened 8 years ago
Closed 7 years ago
#10950 closed Bugs (fixed)
Missing std:: qualifier on sqrt calls in boost/random/non_central_chi_squared_distribution.hpp
Reported by: | Owned by: | No-Maintainer | |
---|---|---|---|
Milestone: | To Be Determined | Component: | random |
Version: | Boost Development Trunk | Severity: | Problem |
Keywords: | Cc: |
Description
Compiling libs/random/test/test_non_central_chi_squared_distribution.cpp on Solaris 11.2 with Oracle Solaris Studio12.4 using -library=stlport4, we see the following error: "../boost/random/non_central_chi_squared_distribution.hpp", line 149: Error: The function "sqrt" must have a prototype.
In file boost/random/non_central_chi_squared_distribution.hpp, the following change resolves the issue. diff ./non_central_chi_squared_distribution.hpp ./non_central_chi_squared_distribution.hpp_new 18a19
#include <cmath>
149c150 < RealType term1 = _z + sqrt(_param.lambda()); ---
RealType term1 = _z + std::sqrt(_param.lambda());
Fixed in https://github.com/boostorg/random/commit/394439ae887611944d424558009c66ef1166af49