@@ -28,14 +28,11 @@ const ∞ = Infinity()
28
28
show (io:: IO , :: Infinity ) = print (io, " ∞" )
29
29
string (:: Infinity ) = " ∞"
30
30
31
- convert (:: Type{Float64} , :: Infinity ) = Inf64
32
- convert (:: Type{Float32} , :: Infinity ) = Inf32
33
- convert (:: Type{Float16} , :: Infinity ) = Inf16
34
- Base. Float64 (:: Infinity ) = convert (Float64, ∞)
35
- Base. Float32 (:: Infinity ) = convert (Float32, ∞)
36
- Base. Float16 (:: Infinity ) = convert (Float16, ∞)
37
- Base. BigFloat (:: Infinity ) = BigFloat (Inf )
38
- convert (:: Type{AF} , :: Infinity ) where AF<: AbstractFloat = convert (AF, Inf )
31
+ _convert (:: Type{Float64} , :: Infinity ) = Inf64
32
+ _convert (:: Type{Float32} , :: Infinity ) = Inf32
33
+ _convert (:: Type{Float16} , :: Infinity ) = Inf16
34
+ _convert (:: Type{T} , :: Infinity ) where {T<: Real } = convert (T, Inf ):: T
35
+ (:: Type{T} )(x:: Infinity ) where {T<: Real } = _convert (T, x)
39
36
40
37
41
38
sign (y:: Infinity ) = 1
@@ -131,16 +128,13 @@ isinf(::RealInfinity) = true
131
128
isfinite (:: RealInfinity ) = false
132
129
133
130
promote_rule (:: Type{Infinity} , :: Type{RealInfinity} ) = RealInfinity
134
- convert (:: Type{RealInfinity} , :: Infinity ) = RealInfinity (false )
135
-
136
- convert (:: Type{Float64} , x:: RealInfinity ) = sign (x)* Inf64
137
- convert (:: Type{Float32} , x:: RealInfinity ) = sign (x)* Inf32
138
- convert (:: Type{Float16} , x:: RealInfinity ) = sign (x)* Inf16
139
- Base. Float64 (x:: RealInfinity ) = convert (Float64, x)
140
- Base. Float32 (x:: RealInfinity ) = convert (Float32, x)
141
- Base. Float16 (x:: RealInfinity ) = convert (Float16, x)
142
- Base. BigFloat (x:: RealInfinity ) = sign (x)* BigFloat (Inf )
143
- convert (:: Type{AF} , x:: RealInfinity ) where AF<: AbstractFloat = sign (x)* convert (AF, Inf )
131
+ _convert (:: Type{RealInfinity} , :: Infinity ) = RealInfinity (false )
132
+
133
+ _convert (:: Type{Float16} , x:: RealInfinity ) = sign (x)* Inf16
134
+ _convert (:: Type{Float32} , x:: RealInfinity ) = sign (x)* Inf32
135
+ _convert (:: Type{Float64} , x:: RealInfinity ) = sign (x)* Inf64
136
+ _convert (:: Type{T} , x:: RealInfinity ) where {T<: Real } = sign (x)* convert (T, Inf )
137
+ (:: Type{T} )(x:: RealInfinity ) where {T<: Real } = _convert (T, x)
144
138
145
139
146
140
signbit (y:: RealInfinity ) = y. signbit
4 commit comments
jishnub commentedon Oct 11, 2022
Coverage report seems inaccurate, as codecov isn't being able to fetch results. Maybe this can be tagged, as I don't think coverage should be affected. @dlfivefifty
jishnub commentedon Oct 13, 2022
Gentle bump @dlfivefifty
dlfivefifty commentedon Oct 13, 2022
@JuliaRegistrator register
JuliaRegistrator commentedon Oct 13, 2022
Registration pull request created: JuliaRegistries/General/70105
After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.
This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via: