|
Boost Users : |
Subject: Re: [Boost-users] boost::math::cyl_bessel_j_zero: few NaN
From: John Maddock (jz.maddock_at_[hidden])
Date: 2015-11-02 10:23:18
On 02/11/2015 14:10, campagne wrote:
>
> double order = (double)lcur + 0.5;
> unsigned int n_zeros;
> vector<double> zeros;
> boost::math::cyl_bessel_j_zero(order,1,n_zeros, back_inserter(zeros));
>
> I'am running Boost 1.59 on Mac OS X Maverick
>
> for lcur = 0, I expect zeros filed with Pi, 2 Pi, 3Pi.... but the
> first two zeros I get NaN
> I get also other nan as for the 2nd zeros for lcur=1
>
> Have you experienced such problem or I have a memory leak somewhere ?
>
I tried:
double lcur = 0;
double order = (double)lcur + 0.5;
unsigned int n_zeros = 10;
std::vector<double> zeros;
boost::math::cyl_bessel_j_zero(order, 1, n_zeros, back_inserter(zeros));
for(unsigned i = 0; i < zeros.size(); ++i)
std::cout << std::setprecision(16) << zeros[i] << std::endl;
and got the expected output:
3.141592653589794
6.283185307179586
9.424777960769379
12.56637061435917
15.70796326794897
18.84955592153876
21.99114857512855
25.13274122871834
28.27433388230814
31.41592653589793
Which Boost version and compiler are you using?
John.
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net