Skip to content

Commit

Permalink
renaming bessel functions to avoid stealing names y0, etc. closes #256
Browse files Browse the repository at this point in the history
  • Loading branch information
JeffBezanson committed Nov 6, 2011
1 parent ce2083b commit 3ebcc68
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions j/math_libm.j
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,6 @@ end
@libfdmfunc_1arg_float Real floor
#@libfdmfunc_1arg_float Real rint
@libfdmfunc_1arg_float Number lgamma
@libfdmfunc_1arg_float Real j0
@libfdmfunc_1arg_float Real j1
@libfdmfunc_1arg_float Real y0
@libfdmfunc_1arg_float Real y1

@libmfunc_1arg_float Number sqrt
@libmfunc_1arg_float Number exp2
Expand Down Expand Up @@ -134,3 +130,17 @@ end

# alias
const pow = ^

besselj0(x::Float64) = ccall(dlsym(libfdm, :j0), Float64, (Float64,), x)
besselj0(x::Float32) = ccall(dlsym(libfdm, :j0f), Float32, (Float32,), x)
@vectorize_1arg Real besselj0
besselj1(x::Float64) = ccall(dlsym(libfdm, :j1), Float64, (Float64,), x)
besselj1(x::Float32) = ccall(dlsym(libfdm, :j1f), Float32, (Float32,), x)
@vectorize_1arg Real besselj1

bessely0(x::Float64) = ccall(dlsym(libfdm, :y0), Float64, (Float64,), x)
bessely0(x::Float32) = ccall(dlsym(libfdm, :y0f), Float32, (Float32,), x)
@vectorize_1arg Real bessely0
bessely1(x::Float64) = ccall(dlsym(libfdm, :y1), Float64, (Float64,), x)
bessely1(x::Float32) = ccall(dlsym(libfdm, :y1f), Float32, (Float32,), x)
@vectorize_1arg Real bessely1

0 comments on commit 3ebcc68

Please sign in to comment.