File tree Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Original file line number Diff line number Diff line change 62
62
function Base.:(- )(m:: Matrix{DoubleFloat{T}} , x:: T ) where {T}
63
63
return m .- x
64
64
end
65
+
66
+ # for getting fast floatmin2, used in Givens rotations in LinearAlgebra
67
+ # these values were computed with the existing code saved
68
+ # floatmin2(::Type{T}) where {T} = (twopar = 2one(T); twopar^trunc(Integer,log(floatmin(T)/eps(T))/log(twopar)/twopar))
69
+ LinearAlgebra. floatmin2 (:: Type{Double64} ) = Double64 (reinterpret (Float64, 0x2350000000000000 ), 0.0 )
70
+ LinearAlgebra. floatmin2 (:: Type{Double32} ) = Double32 (reinterpret (Float32, 0x2c000000 ), 0.0f0 )
71
+ LinearAlgebra. floatmin2 (:: Type{Double16} ) = Double16 (Float16 (8.0 ), Float16 (0.0 ))
Original file line number Diff line number Diff line change 61
61
@test isnan (asech (T (NaN )))
62
62
@test isnan (acoth (T (NaN )))
63
63
end
64
+
65
+ @testset " floatmin2 $T " for T in (Double16, Double32, Double64)
66
+ trueval = (twopar = 2 one (T); twopar^ trunc (Integer,log (floatmin (T)/ eps (T))/ log (twopar)/ twopar))
67
+ @test LinearAlgebra. floatmin2 (T) == trueval
68
+ end
You can’t perform that action at this time.
0 commit comments