Skip to content

Commit

Permalink
test/math.jl: add test for vectorization of 2-argument functions.
Browse files Browse the repository at this point in the history
  • Loading branch information
StefanKarpinski committed May 15, 2015
1 parent c260ea9 commit 9c91b02
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions test/math.jl
Original file line number Diff line number Diff line change
Expand Up @@ -472,3 +472,18 @@ with_bigfloat_precision(10_000) do
@test log(2,big(2)^300) == 300
@test log(2,big(2)^400) == 400
end

# test vectorization of 2-arg vectorized functions
binary_math_functions = [
copysign, flipsign, log, atan2, hypot, max, min,
airy, airyx, besselh, hankelh1, hankelh2, hankelh1x, hankelh2x,
besseli, besselix, besselj, besseljx, besselk, besselkx, bessely, besselyx,
polygamma, zeta, beta, lbeta,
]
for f in binary_math_functions
x = y = 2
v = [f(x,y)]
@test f([x],y) == v
@test f(x,[y]) == v
@test f([x],[y]) == v
end

0 comments on commit 9c91b02

Please sign in to comment.