forked from JuliaMath/DoubleFloats.jl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
runtests.jl
72 lines (55 loc) · 1.64 KB
/
runtests.jl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
using DoubleFloats, LinearAlgebra
using Test
using Base: IEEEFloat
import Base: isapprox
using Random
const phi = Base.MathConstants.golden
const gamma = Base.MathConstants.eulergamma
const phi_df64 = Double64(phi)
const phi_df32 = Double32(phi)
const gamma_df64 = Double64(gamma)
const gamma_df32 = Double32(gamma)
const phi_df64hi = HI(phi_df64); const phi_df64lo = LO(phi_df64)
const phi_df32hi = HI(phi_df32); const phi_df32lo = LO(phi_df32)
const gamma_df64hi = HI(gamma_df64); const gamma_df64lo = LO(gamma_df64)
const gamma_df32hi = HI(gamma_df32); const gamma_df32lo = LO(gamma_df32)
function isapprox(a::T, b::T) where {T<:IEEEFloat}
(iszero(a) && (0 < abs(b) < eps(T)^2) ||
iszero(b) && (0 < abs(a) < eps(T)^2) ||
isapprox(a, b, atol=eps(T)^2, rtol = eps(T)))
end
# isapprox(lo,eps(one(Float64)),atol=eps(one(Float64)))
# to cover functions that are not exported
macro df(func)
:(DoubleFloats.$func)
end
macro df(func, arg)
:(DoubleFloats.$func($arg))
end
macro df(func, arg1, arg2)
:(DoubleFloats.$func($arg1, $arg2))
end
macro df(func, arg1, arg2, arg3)
:(DoubleFloats.$func($arg1, $arg2, $arg3))
end
macro df(func, arg1, arg2, arg3, arg4)
:(DoubleFloats.$func($arg1, $arg2, $arg3, $arg4))
end
include("specialvalues.jl")
include("construct.jl")
include("compare.jl")
include("promote.jl")
include("prearith.jl")
include("arithmetic.jl")
include("fma.jl")
include("modrem.jl")
include("functions.jl")
include("matmul.jl")
include("complex.jl")
include("linearalgebra.jl")
include("concrete_accuracy.jl")
include("function_accuracy.jl")
include("coverage.jl")
include("op_.jl")
include("string.jl")
include("parse.jl")