File tree Expand file tree Collapse file tree 2 files changed +19
-19
lines changed Expand file tree Collapse file tree 2 files changed +19
-19
lines changed Original file line number Diff line number Diff line change @@ -96,6 +96,25 @@ function ==(x::NCRingElem, y::NCRingElem)
96
96
97
97
== (x:: NCRingElement , y:: NCRingElem ) = parent (y)(x) == y
98
98
99
+ function isequal (a:: NCRingElem , b:: NCRingElem )
100
+ return parent (a) == parent (b) && a == b
101
+ end
102
+
103
+ # Implement `isapprox` for ring elements via equality by default. On the one
104
+ # hand, we need isapprox methods to be able to conformance test series rings.
105
+ # On the other hand this is essentially the only sensible thing to do in
106
+ # positive characteristic so we might as well do it in a generic method.
107
+ function Base. isapprox (x:: NCRingElem , y:: NCRingElem ;
108
+ atol:: Real = 0 , rtol:: Real = 0 ,
109
+ nans:: Bool = false , norm:: Function = abs)
110
+ if is_exact_type (typeof (x)) && is_exact_type (typeof (y))
111
+ @req is_zero (atol) " non-zero atol not supported"
112
+ @req is_zero (rtol) " non-zero rtol not supported"
113
+ return x == y
114
+ end
115
+ throw (NotImplementedError (:isapprox , x, y))
116
+ end
117
+
99
118
function divexact_left (x:: NCRingElem , y:: NCRingElem ; check:: Bool = true )
100
119
return divexact_left (promote (x, y)... )
101
120
end
Original file line number Diff line number Diff line change 4
4
#
5
5
# ##############################################################################
6
6
7
- function isequal (a:: RingElem , b:: RingElem )
8
- return parent (a) == parent (b) && a == b
9
- end
10
-
11
- # Implement `isapprox` for ring elements via equality by default. On the one
12
- # hand, we need isapprox methods to be able to conformance test series rings.
13
- # On the other hand this is essentially the only sensible thing to do in
14
- # positive characteristic so we might as well do it in a generic method.
15
- function Base. isapprox (x:: NCRingElem , y:: NCRingElem ;
16
- atol:: Real = 0 , rtol:: Real = 0 ,
17
- nans:: Bool = false , norm:: Function = abs)
18
- if is_exact_type (typeof (x)) && is_exact_type (typeof (y))
19
- @req is_zero (atol) " non-zero atol not supported"
20
- @req is_zero (rtol) " non-zero rtol not supported"
21
- return x == y
22
- end
23
- throw (NotImplementedError (:isapprox , x, y))
24
- end
25
-
26
7
"""
27
8
divexact(x, y; check::Bool=true)
28
9
You can’t perform that action at this time.
0 commit comments