Skip to content

Commit 35ac3d9

Browse files
committed
fix: add atan to ValidVector unary operators
1 parent afc6938 commit 35ac3d9

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

src/ComposableExpression.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,7 @@ function Base.literal_pow(::typeof(^), x::ValidVector, ::Val{p}) where {p}
372372
end
373373

374374
for op in (
375-
:sin, :cos, :tan, :sinh, :cosh, :tanh, :asin, :acos,
375+
:sin, :cos, :tan, :sinh, :cosh, :tanh, :asin, :acos, :atan,
376376
:asinh, :acosh, :atanh, :sec, :csc, :cot, :asec, :acsc, :acot, :sech, :csch,
377377
:coth, :asech, :acsch, :acoth, :sinc, :cosc, :cosd, :cotd, :cscd, :secd,
378378
:sinpi, :cospi, :sind, :tand, :acosd, :acotd, :acscd, :asecd, :asind,

test/test_composable_expression.jl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,9 +94,13 @@ end
9494
# Test unary operations on ValidVector
9595
@test sin(x).x sin.([1.0, 2.0, 3.0])
9696
@test cos(x).x cos.([1.0, 2.0, 3.0])
97+
@test atan(x).x atan.([1.0, 2.0, 3.0])
9798
@test abs(x).x [1.0, 2.0, 3.0]
9899
@test (-x).x [-1.0, -2.0, -3.0]
99100

101+
# Test binary atan (atan2)
102+
@test atan(y, x).x atan.([0.0, 2.0, 4.0], [1.0, 2.0, 3.0])
103+
100104
# Test propagation of invalid flag
101105
invalid_x = ValidVector([1.0, 2.0, 3.0], false)
102106
@test !((invalid_x + 2.0).valid)

0 commit comments

Comments
 (0)