Skip to content

Commit 555b258

Browse files
authored
Remove bad generic sqrt method (#2068)
Method dispatch does not take keyword arguments into account. Therefore the kind of dispatch used by this method is risky and can result in an infinite recursion.
1 parent d1a13cb commit 555b258

File tree

1 file changed

+0
-9
lines changed

1 file changed

+0
-9
lines changed

src/Rings.jl

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -179,15 +179,6 @@ function Base.sqrt(a::FieldElem; check::Bool=true)
179179
error("Element $a does not have a square root")
180180
end
181181

182-
# assumes the existence of sqrt without check argument for input
183-
function Base.sqrt(a::RingElem; check::Bool=true)
184-
s = sqrt(a)
185-
if check
186-
s != a^2 && error("Element $a does not have a square root")
187-
end
188-
return s
189-
end
190-
191182
# assumes the existence of is_square and sqrt for input
192183
function is_square_with_sqrt(a::RingElem)
193184
if is_square(a)

0 commit comments

Comments
 (0)