11module DecFP
2+
3+ using Compat
4+
5+ if ! (VERSION < v " 0.7.0-DEV.3026" )
6+ using Printf
7+ end
8+
9+ if ! (VERSION < v " 0.7.0-DEV.2813" )
10+ using Unicode
11+ end
12+
213export Dec32, Dec64, Dec128, @d_str , @d32_str , @d64_str , @d128_str
314
415const libbid = joinpath (dirname (@__FILE__ ), " .." , " deps" , " libbid$(Sys. WORD_SIZE) " )
@@ -8,22 +19,6 @@ const _buffer = fill(0x00, 1024)
819import Base. promote_rule
920import Base. Grisu. DIGITS
1021
11- # https://github.com/JuliaLang/julia/pull/20005
12- if VERSION < v " 0.7.0-DEV.896"
13- Base. InexactError (name:: Symbol , T, val) = InexactError ()
14- end
15-
16- # https://github.com/JuliaLang/julia/pull/22751
17- if VERSION < v " 0.7.0-DEV.924"
18- Base. DomainError (val) = DomainError ()
19- Base. DomainError (val, msg) = DomainError ()
20- end
21-
22- # https://github.com/JuliaLang/julia/pull/222761
23- if VERSION < v " 0.7.0-DEV.1285"
24- Base. OverflowError (msg) = OverflowError ()
25- end
26-
2722# global pointers and dicts must be initialized at runtime (via __init__)
2823function __init__ ()
2924 global const rounding = cglobal ((:__bid_IDEC_glbround , libbid), Cuint) # rounding mode
@@ -226,7 +221,7 @@ for w in (32,64,128)
226221 end
227222 end
228223
229- for c in (:π , :e , :γ , :catalan , :φ )
224+ for c in (:π , :e , :ℯ , : γ , :catalan , :φ )
230225 @eval begin
231226 Base. convert (:: Type{$BID} , :: Irrational{$(QuoteNode(c))} ) = $ (_parse (T, setprecision (256 ) do
232227 string (BigFloat (isdefined (Base, :MathConstants ) ? eval (Base. MathConstants, c) : eval (c)))
0 commit comments