@@ -117,21 +117,22 @@ closedendpoints(d::TypedEndpointsInterval{:closed,:open}) = (true,false)
117
117
closedendpoints (d:: TypedEndpointsInterval{:open,:closed} ) = (false ,true )
118
118
closedendpoints (d:: TypedEndpointsInterval{:open,:open} ) = (false ,false )
119
119
120
-
121
- in (v, I:: TypedEndpointsInterval{:closed,:closed} ) = leftendpoint (I) ≤ v ≤ rightendpoint (I)
122
- in (v, I:: TypedEndpointsInterval{:open,:open} ) = leftendpoint (I) < v < rightendpoint (I)
123
- in (v, I:: TypedEndpointsInterval{:closed,:open} ) = leftendpoint (I) ≤ v < rightendpoint (I)
124
- in (v, I:: TypedEndpointsInterval{:open,:closed} ) = leftendpoint (I) < v ≤ rightendpoint (I)
125
-
126
- in (v:: Complex , I:: TypedEndpointsInterval{:closed,:closed} ) = isreal (v) && in (real (v), I)
127
- in (v:: Complex , I:: TypedEndpointsInterval{:open,:open} ) = isreal (v) && in (real (v), I)
128
- in (v:: Complex , I:: TypedEndpointsInterval{:closed,:open} ) = isreal (v) && in (real (v), I)
129
- in (v:: Complex , I:: TypedEndpointsInterval{:open,:closed} ) = isreal (v) && in (real (v), I)
130
-
131
- in (:: Missing , I:: TypedEndpointsInterval{:closed,:closed} ) = ! isempty (I) && missing
132
- in (:: Missing , I:: TypedEndpointsInterval{:open,:open} ) = ! isempty (I) && missing
133
- in (:: Missing , I:: TypedEndpointsInterval{:closed,:open} ) = ! isempty (I) && missing
134
- in (:: Missing , I:: TypedEndpointsInterval{:open,:closed} ) = ! isempty (I) && missing
120
+ # We dispatch to _in to avoid ambiguities if packages define in(v::CustomType, I::TypedEndpointsInterval)
121
+ in (v, I:: TypedEndpointsInterval ) = _in (v, I)
122
+ _in (v, I:: TypedEndpointsInterval{:closed,:closed} ) = leftendpoint (I) ≤ v ≤ rightendpoint (I)
123
+ _in (v, I:: TypedEndpointsInterval{:open,:open} ) = leftendpoint (I) < v < rightendpoint (I)
124
+ _in (v, I:: TypedEndpointsInterval{:closed,:open} ) = leftendpoint (I) ≤ v < rightendpoint (I)
125
+ _in (v, I:: TypedEndpointsInterval{:open,:closed} ) = leftendpoint (I) < v ≤ rightendpoint (I)
126
+
127
+ _in (v:: Complex , I:: TypedEndpointsInterval{:closed,:closed} ) = isreal (v) && in (real (v), I)
128
+ _in (v:: Complex , I:: TypedEndpointsInterval{:open,:open} ) = isreal (v) && in (real (v), I)
129
+ _in (v:: Complex , I:: TypedEndpointsInterval{:closed,:open} ) = isreal (v) && in (real (v), I)
130
+ _in (v:: Complex , I:: TypedEndpointsInterval{:open,:closed} ) = isreal (v) && in (real (v), I)
131
+
132
+ _in (:: Missing , I:: TypedEndpointsInterval{:closed,:closed} ) = ! isempty (I) && missing
133
+ _in (:: Missing , I:: TypedEndpointsInterval{:open,:open} ) = ! isempty (I) && missing
134
+ _in (:: Missing , I:: TypedEndpointsInterval{:closed,:open} ) = ! isempty (I) && missing
135
+ _in (:: Missing , I:: TypedEndpointsInterval{:open,:closed} ) = ! isempty (I) && missing
135
136
136
137
isempty (A:: TypedEndpointsInterval{:closed,:closed} ) = leftendpoint (A) > rightendpoint (A)
137
138
isempty (A:: TypedEndpointsInterval ) = leftendpoint (A) ≥ rightendpoint (A)
0 commit comments