|
109 | 109 | tie_breaker_is_to_even(::MPFRRoundingMode) = true
|
110 | 110 |
|
111 | 111 | const ROUNDING_MODE = Ref{MPFRRoundingMode}(MPFRRoundNearest)
|
112 |
| -const CURRENT_ROUNDING_MODE = Base.ScopedValue{MPFRRoundingMode}() |
| 112 | +const CURRENT_ROUNDING_MODE = Base.ScopedValues.ScopedValue{MPFRRoundingMode}() |
113 | 113 | const DEFAULT_PRECISION = Ref{Clong}(256)
|
114 |
| -const CURRENT_PRECISION = Base.ScopedValue{Clong}() |
| 114 | +const CURRENT_PRECISION = Base.ScopedValues.ScopedValue{Clong}() |
115 | 115 | # Basic type and initialization definitions
|
116 | 116 |
|
117 | 117 | # Warning: the constants are MPFR implementation details from
|
@@ -162,7 +162,7 @@ significand_limb_count(x::BigFloat) = div(sizeof(x._d), sizeof(Limb), RoundToZer
|
162 | 162 | rounding_raw(::Type{BigFloat}) = something(Base.ScopedValues.get(CURRENT_ROUNDING_MODE), ROUNDING_MODE[])
|
163 | 163 | setrounding_raw(::Type{BigFloat}, r::MPFRRoundingMode) = ROUNDING_MODE[]=r
|
164 | 164 | function setrounding_raw(f::Function, ::Type{BigFloat}, r::MPFRRoundingMode)
|
165 |
| - Base.@with(CURRENT_ROUNDING_MODE => r, f()) |
| 165 | + Base.ScopedValues.@with(CURRENT_ROUNDING_MODE => r, f()) |
166 | 166 | end
|
167 | 167 |
|
168 | 168 |
|
@@ -1109,7 +1109,7 @@ Note: `nextfloat()`, `prevfloat()` do not use the precision mentioned by
|
1109 | 1109 | The `base` keyword requires at least Julia 1.8.
|
1110 | 1110 | """
|
1111 | 1111 | function setprecision(f::Function, ::Type{BigFloat}, prec::Integer; base::Integer=2)
|
1112 |
| - Base.@with(CURRENT_PRECISION => _convert_precision_from_base(prec, base), f()) |
| 1112 | + Base.ScopedValues.@with(CURRENT_PRECISION => _convert_precision_from_base(prec, base), f()) |
1113 | 1113 | end
|
1114 | 1114 |
|
1115 | 1115 | setprecision(f::Function, prec::Integer; base::Integer=2) = setprecision(f, BigFloat, prec; base)
|
|
0 commit comments