Browse Source

Avoid clobbering `r` variable in Bessel function

The `j` function uses `r` to accumulate its result, but did not
declare it with auto, causing the caller's value to be clobbered.

To fix this, declare `r` as auto to make it a local variable.
bessel
Michael Forney 2 years ago
parent
commit
0079ec0553
  1. 2
      gen/lib.bc

2
gen/lib.bc

@ -173,7 +173,7 @@ define a(x){
return((m*a+r)/n)
}
define j(n,x){
auto b,s,o,a,i,v,f
auto b,s,o,a,i,r,v,f
b=ibase
ibase=A
s=scale

Loading…
Cancel
Save