Skip to content

Commit f54f41a

Browse files
authored
Add missing support to hypot and log(b,x) (#43601)
1 parent f5a5149 commit f54f41a

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

base/math.jl

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1318,9 +1318,12 @@ for f in (:sin, :cos, :tan, :asin, :atan, :acos,
13181318
end
13191319
@eval $(f)(::Missing) = missing
13201320
end
1321-
atan(::Missing, ::Missing) = missing
1322-
atan(::Number, ::Missing) = missing
1323-
atan(::Missing, ::Number) = missing
1321+
1322+
for f in (:atan, :hypot, :log)
1323+
@eval $(f)(::Missing, ::Missing) = missing
1324+
@eval $(f)(::Number, ::Missing) = missing
1325+
@eval $(f)(::Missing, ::Number) = missing
1326+
end
13241327

13251328
exp2(x::AbstractFloat) = 2^x
13261329
exp10(x::AbstractFloat) = 10^x

test/missing.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ end
110110
end
111111

112112
@testset "two-argument functions" begin
113-
two_argument_functions = [atan]
113+
two_argument_functions = [atan, hypot, log]
114114

115115
# All two-argument functions return missing when operating on two missing's
116116
# All two-argument functions return missing when operating on a scalar and an missing

0 commit comments

Comments
 (0)