The calculator utility bc has a minimal math library. For instance, there’s no tangent perform since you’re anticipated take the ratio of sine and cosine. (The Gnu model of bc does have a perform for tangent, however the POSIX model doesn’t.) And but bc contains help for Bessel features J(x).
The bc perform j takes two arguments. Is the primary argument n or x? Grok stated the perform arguments are j(n,x). I believed I ought to run man bc simply to verify, and it stated
j(x, n) Returns the bessel integer order n (truncated) of x.
So Grok says j(n,x) and the documentation that ships with the software program says j(x,n). Which one must you imagine? Neither! It is best to run somewhat check.
~$ bc -l >>> j(1, 0) 0 >>> j(0, 1) .76519768655796655144
Now J1(0) = 0, so apparently the primary argument is the order n. Grok was proper and the person web page was incorrect.
As additional affirmation, let’s see which argument is truncated.
>>> j(1.2, 3.4) .17922585168150711099 >>> j(1, 3.4) .17922585168150711099 >>> j(1.2, 3) .33905895852593645892
The primary argument is truncated to an integer worth, in order that’s the order n.
Turns on the market’s a bug within the man web page. The person web page textual content above comes from operating man bc on my Macbook. On my Linux field, the documentation is appropriate. It says
j(n,x) The Bessel perform of integer order n of x.
The software program produces the identical outcomes on each computer systems. It’s only a documentation bug.
The model operating on my Macbook is the model that ships with the OS. It’s not the Gnu model, although the documentation says “This bc is suitable with each the GNU bc and the POSIX bc spec.” It has a perform t for tangent, for instance, which a POSIX model doesn’t. However should you run bc --standard -l making an attempt to name t produces an error.
