bessel/bits/40_wrapper.js
SheetJS 73ee33e402 version bump 0.3.0: cleanup
- eliminated array reduce (performance improvement)
- explicit treatment of divergent values
- better handling of non-integral order (fixes #3, h/t @vron)
- reorganized source, removed voc dependency (fixes #2, h/t @hmalphettes)
- new browser demo
- more detailed test suite and coverage tests
- updated travis versions for test
- miscellaneous adjustments to tooling
2016-09-24 02:15:52 -04:00

15 lines
529 B
JavaScript

function _bessel_wrap(bessel0/*:BesselN*/, bessel1/*:BesselN*/, name/*:string*/, nonzero/*:number*/, sign/*:number*/)/*:BesselF*/ {
return function bessel(x/*:number*/,n/*:number*/) {
if(nonzero) {
if(x === 0) return (nonzero == 1 ? -Infinity : Infinity);
else if(x < 0) return NaN;
}
if(n === 0) return bessel0(x);
if(n === 1) return bessel1(x);
if(n < 0) return NaN;
n|=0;
var b0/*:number*/ = bessel0(x), b1/*:number*/ = bessel1(x);
return _bessel_iter(x, n, b0, b1, sign);
};
}