title: Julia: How to change the type of an argument in the Bessel function?
body: <p>Here is my code:</p>
  <pre><code>using Plots
  using SpecialFunctions
  using QuadGK
  
  kappa = 1
  B = 1
  xi = (kappa/B)^4
  
  function correlation(x)
      quadgk(q -&gt; q * SpecialFunctions.besselj0(x*q)/(q^4 + xi), 0, 1e6)[1]/kappa 
  end
  
  r = range(-20, 20, length = 1001)
  
  plot(r, correlation(r))
  </code></pre>
  <p>I get an error on the Bessel function. I get that the argument is the problem and that it should be of the format <code>::BigFloat</code>, <code>::Float16</code>, or <code>::Float32</code>, but I don't know how to do it. I tried to write <code>x .* q</code> instead, but the problem remains the same, I get the error:</p>
  <pre><code>ERROR: MethodError: no method matching besselj0(::StepRangeLen{Float64,Base.TwicePrecision{Float64},Base.TwicePrecision{Float64}})
  </code></pre>
  <p>Also, I'm searching for a way to write +infinity instead of <code>1e6</code>.</p>