Skip to content

Commit 92d200e

Browse files
Merge pull request #241 from araujoms/deadcode3
remove remaining dead code
2 parents 29dca92 + f15db11 commit 92d200e

4 files changed

Lines changed: 0 additions & 108 deletions

File tree

src/extras/misc.jl

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,6 @@
55
(32.5 sig bits must match)
66
77
=#
8-
releps(::Type{Float64}) = ldexp(0.5, -31)
9-
releps(::Type{Float32}) = ldexp(inv(sqrt(2.0f0)), -17)
10-
releps(::Type{Double64}) = ldexp(0.5, -62)
11-
releps(::Type{Double32}) = ldexp(inv(sqrt(2.0f0)), -34)
128

139
function Base.isapprox(x::DoubleFloat{T}, y::Real; atol::Real=0.0, rtol::Real=Base.rtoldefault(HI(x),y,atol), nans::Bool=false) where {T<:IEEEFloat}
1410
return isapprox(x, DoubleFloat{T}(y), atol=atol, rtol=rtol, nans=nans)
@@ -44,11 +40,6 @@ function Base.clamp(x::T, lo::DoubleFloat{T}, hi::DoubleFloat{T}) where {T}
4440
return lo
4541
end
4642

47-
abs2(x::DoubleFloat{T}) where {T} =
48-
let absx = abs(x)
49-
absx * absx
50-
end
51-
5243
# for compatibility with old or unrevised outside linalg functions
5344
function Base.:(+)(v::Vector{DoubleFloat{T}}, x::T) where {T}
5445
return v .+ x

src/type/intraconstructors.jl

Lines changed: 0 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -47,47 +47,3 @@ function Double64(x::T) where {T<:Signed}
4747
throw(DomainError("$x"))
4848
end
4949
end
50-
51-
52-
53-
#=
54-
55-
e.g. DoubleFloat{Float16}(65519.0) does not work properly in these
56-
57-
function Double32(x::Double64)
58-
hi64, lo64 = HILO(x)
59-
hi64a = reinterpret(Float64, (reinterpret(UInt64, hi64) & 0xFFFFFFFF00000000))
60-
hi64b = hi64 - hi64a
61-
lo64a = reinterpret(Float64, (reinterpret(UInt64, lo64) & 0xFFFFFFFF00000000))
62-
lo64b = lo64 - lo64b
63-
hi32a, hi32b = Float32(hi64a), Float32(hi64b)
64-
lo32a, lo32b = Float32(lo64a), Float32(lo64b)
65-
hi32, lo32 = two_hilo_sum(hi32a, hi32b, lo32a, lo32b)
66-
return Double32(hi32, lo32)
67-
end
68-
69-
function Double16(x::Double64)
70-
hi64, lo64 = HILO(x)
71-
hi64a = reinterpret(Float64, (reinterpret(UInt64, hi64) & 0xFFFFFFFF00000000))
72-
hi64b = hi64 - hi64a
73-
lo64a = reinterpret(Float64, (reinterpret(UInt64, lo64) & 0xFFFFFFFF00000000))
74-
lo64b = lo64 - lo64b
75-
hi16a, hi16b = Float16(hi64a), Float16(hi64b)
76-
lo16a, lo16b = Float16(lo64a), Float16(lo64b)
77-
hi16, lo16 = two_hilo_sum(hi16a, hi16b, lo16a, lo16b)
78-
return Double16(hi16, lo16)
79-
end
80-
81-
function Double16(x::Double32)
82-
hi32, lo32 = HILO(x)
83-
hi32a = reinterpret(Float32, (reinterpret(UInt32, hi32) & 0xFFFF0000))
84-
hi32b = hi32 - hi32a
85-
lo32a = reinterpret(Float32, (reinterpret(UInt32, lo32) & 0xFFFF0000))
86-
lo32b = lo32 - lo32b
87-
hi16a, hi16b = Float16(hi64a), Float16(hi64b)
88-
lo16a, lo16b = Float16(lo64a), Float16(lo64b)
89-
hi16, lo16 = two_hilo_sum(hi16a, hi16b, lo16a, lo16b)
90-
return Double16(hi16, lo16)
91-
end
92-
93-
=#

src/type/predicates.jl

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,3 @@ iseven(x::DoubleFloat{T}) where {T<:IEEEFloat} =
133133
else
134134
false
135135
end
136-
137-
iseven(x::T) where {T<:IEEEFloat} = isinteger(x) && iseven(BigInt(x))
138-
isodd(x::T) where {T<:IEEEFloat} = isinteger(x) && isodd(BigInt(x))

src/type/string.jl

Lines changed: 0 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -54,55 +54,3 @@ function stringtyped(x::Complex{DoubleFloat{Float16}})
5454
str = string("ComplexDF16(", stringtyped(rea), ", ", stringtyped(imag(x)), ")")
5555
return str
5656
end
57-
58-
#= NOT NEEDED
59-
60-
"""
61-
BigFloatBits(::IEEEType)
62-
63-
significand bit precision for BigFloat when converting from DoubleFloat{IEEEType} into a string
64-
""" BigFloatBits
65-
66-
"""
67-
BigFloatDigits(::IEEEType)
68-
69-
significant digits of BigFloat when converting to DoubleFloat{IEEEType} from a string
70-
""" BigFloatDigits
71-
72-
# Float63 -> 106, Float32 -> 48, Float16 -> 22
73-
minprecdblfloat(::Type{T}) where {T<:IEEEFloat} =
74-
(trailing_ones(Base.significand_mask(T))+1)*2
75-
76-
77-
#=
78-
The effective precision of some DoubleFloat{T} may be larger than this
79-
where all bits betweeen the lsb of the HI oart and Lthe msb of the lo part
80-
are 0b0 and there are more than 22 zero bits interposed for eg Double64.
81-
When a DoubleFloat is the result of an arithmetic operation between DoubleFloats,
82-
the effective precision is almost never expected be larger than this.
83-
=#
84-
# Float63 -> 128, Float32 -> 58, Float16 -> 27
85-
lrgprecdblfloat(::Type{T}) where {T<:IEEEFloat} =
86-
Int(ceil(Int, minprecdblfloat(T) * 1.2))
87-
88-
bigfloatbits(::Type{T}) where {T<:IEEEFloat} =
89-
nextpow(2, (trailing_ones(Base.significand_mask(T))+1)*2) - 1
90-
91-
BigFloatBits(::Type{Float64}) = 127 # bigfloatbits(Float64)
92-
BigFloatBits(::Type{Float32}) = 63 # bigfloatbits(Float32)
93-
BigFloatBits(::Type{Float16}) = 31 # bigfloatbits(Float16)
94-
95-
BigFloatDigits(::Type{Float64}) = 35 # bigfloatbits(Float64)
96-
BigFloatDigits(::Type{Float32}) = 16 # bigfloatbits(Float32)
97-
BigFloatDigits(::Type{Float16}) = 8 # bigfloatbits(Float16)
98-
99-
#= old
100-
@inline BigFloatBits(::Type{Float64}) = 512
101-
@inline BigFloatBits(::Type{Float32}) = 256
102-
@inline BigFloatBits(::Type{Float16}) = 128
103-
@inline BigFloatDigits(::Type{Float64}) = 35
104-
@inline BigFloatDigits(::Type{Float32}) = 18
105-
@inline BigFloatDigits(::Type{Float16}) = 9
106-
=#
107-
108-
=#

0 commit comments

Comments
 (0)