Skip to content

Commit

Permalink
Update bitsdigits.jl
Browse files Browse the repository at this point in the history
  • Loading branch information
JeffreySarnoff committed Jul 4, 2019
1 parent d653ca7 commit 0a952f2
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/values/bitsdigits.jl
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,13 @@ extrabits(x::ArbReal{P}) where {P} = extrabits(ArbReal)
extrabits(x::ArbComplex{P}) where {P} = extrabits(ArbComplex)

function setextrabits(n::Int)
ExtraBits.x = max(0,n)
working = precision(ArbFloat) + ExtraBits.x
DEFAULT_PRECISION.x = working
n >=0 || throw(DomainError("extrabits must be >= 0"))
priorextra = extrabits()
priorworking = workingprecision(ArbFloat)
newextra = n
newworking = priorworking + (newextra - priorextra)
ExtraBits.x = newextra
DEFAULT_PRECISION.x = newworking
return ExtraBits.x
end

Expand Down

2 comments on commit 0a952f2

@JeffreySarnoff
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator register

Release notes:

improve the way extrabits works

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/1775

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if Julia TagBot is installed, or can be done manually through the github interface, or via:

git tag -a v0.6.1 -m "<description of version>" 0a952f2480f60818307aa4f599e6895cd7d218fb
git push origin v0.6.1

Please sign in to comment.