|
76 | 76 | end |
77 | 77 | end |
78 | 78 |
|
79 | | -# https://github.com/JuliaLang/julia/pull/26670 |
80 | | -@static if VERSION < v"0.7.0-DEV.4062" |
81 | | - trunc(x; digits = 0, base = 10) = Base.trunc(x, digits, base) |
82 | | - floor(x; digits = 0, base = 10) = Base.floor(x, digits, base) |
83 | | - ceil(x; digits = 0, base = 10) = Base.ceil(x, digits, base) |
84 | | - function round(x; digits = nothing, sigdigits = nothing, base = 10) |
85 | | - if digits === nothing |
86 | | - if sigdigits === nothing |
87 | | - Base.round(x, 0, base) |
88 | | - else |
89 | | - Base.signif(x, sigdigits, base) |
90 | | - end |
91 | | - else |
92 | | - sigdigits === nothing || throw(AgrumentError("`round` cannot use both `digits` and `sigdigits` arguments")) |
93 | | - Base.round(x, digits, base) |
94 | | - end |
95 | | - end |
96 | | -elseif VERSION < v"0.7.0-DEV.4804" |
97 | | - trunc(x; digits = 0, base = 10) = Base.trunc(x, digits, base = base) |
98 | | - floor(x; digits = 0, base = 10) = Base.floor(x, digits, base = base) |
99 | | - ceil(x; digits = 0, base = 10) = Base.ceil(x, digits, base = base) |
100 | | - function round(x; digits = nothing, sigdigits = nothing, base = 10) |
101 | | - if digits === nothing |
102 | | - if sigdigits === nothing |
103 | | - Base.round(x, 0, base = base) |
104 | | - else |
105 | | - Base.signif(x, sigdigits, base = base) |
106 | | - end |
107 | | - else |
108 | | - sigdigits === nothing || throw(AgrumentError("`round` cannot use both `digits` and `sigdigits` arguments")) |
109 | | - Base.round(x, digits, base = base) |
110 | | - end |
111 | | - end |
112 | | -elseif VERSION < v"0.7.0-beta2.86" |
113 | | - # https://github.com/JuliaLang/julia/pull/28199 |
114 | | - trunc(x; digits = 0, base = 10) = Base.trunc(x, digits = digits, base = base) |
115 | | - floor(x; digits = 0, base = 10) = Base.floor(x, digits = digits, base = base) |
116 | | - ceil(x; digits = 0, base = 10) = Base.ceil(x, digits = digits, base = base) |
117 | | - function round(x; digits = nothing, sigdigits = nothing, base = 10) |
118 | | - if digits === nothing && sigdigits === nothing |
119 | | - Base.round(x, digits = 0, base = base) |
120 | | - else |
121 | | - Base.round(x, digits = digits, sigdigits = sigdigits, base = base) |
122 | | - end |
123 | | - end |
124 | | -else |
125 | | - trunc(x; digits = 0, base = 10) = Base.trunc(x, digits = digits, base = base) |
126 | | - floor(x; digits = 0, base = 10) = Base.floor(x, digits = digits, base = base) |
127 | | - ceil(x; digits = 0, base = 10) = Base.ceil(x, digits = digits, base = base) |
128 | | - round(x; digits = nothing, sigdigits = nothing, base = 10) = Base.round(x, digits = digits, sigdigits = sigdigits, base = base) |
129 | | -end |
130 | | - |
131 | 79 | # https://github.com/JuliaLang/julia/pull/25872 |
132 | 80 | if VERSION < v"0.7.0-DEV.3734" |
133 | 81 | if isdefined(Base, :open_flags) |
|
0 commit comments