Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make precision a keyword argument, improve handling of rounding mode. #29157

Merged
merged 12 commits into from Nov 19, 2018

Conversation

2 participants
@simonbyrne
Copy link
Contributor

commented Sep 12, 2018

This makes a few changes to avoid unnecessarily calling setrounding and setprecision. It also changes precision to be a keyword argument (though does not yet deprecate the old behaviour), and defines an enum for the MPFR rounding mode.

It includes the change from #29127 (but not the tests, so that should probably be merged first).

@simonbyrne simonbyrne force-pushed the sb/mpfr-precision branch from 6cf5ffb to 567b152 Sep 12, 2018

@simonbyrne simonbyrne added the bignums label Sep 14, 2018

@simonbyrne

This comment has been minimized.

Copy link
Contributor Author

commented Sep 14, 2018

@simonbyrne

This comment has been minimized.

Copy link
Contributor Author

commented Sep 14, 2018

It does also mean that all BigFloat(x, precision=...) constructors are now thread-safe (which isn't huge, but better than nothing).

Show resolved Hide resolved base/mpfr.jl Outdated
Show resolved Hide resolved base/mpfr.jl Outdated
@rfourquet

This comment has been minimized.

Copy link
Contributor

commented Sep 16, 2018

This looks like a very good change to me! I will need a second read for proper review though.

@JuliaLang JuliaLang deleted a comment from simonbyrne Sep 16, 2018

Show resolved Hide resolved base/mpfr.jl
Show resolved Hide resolved base/mpfr.jl Outdated
Show resolved Hide resolved base/mpfr.jl Outdated
Show resolved Hide resolved base/mpfr.jl Outdated

simonbyrne added some commits Sep 12, 2018

Improve handling of precision and rounding mode arguments in BigFloat…
… constructors.

This makes a few changes to avoid unnecessarily calling `setrounding` and `setprecision`. It also changes `precision` to be a keyword argument (though does not yet deprecate the old behaviour).

@simonbyrne simonbyrne force-pushed the sb/mpfr-precision branch from e171ffb to 1831e3a Oct 7, 2018

@simonbyrne

This comment has been minimized.

Copy link
Contributor Author

commented Oct 7, 2018

Thanks @rfourquet!

@simonbyrne

This comment has been minimized.

Copy link
Contributor Author

commented Oct 27, 2018

Okay, I think this is ready to go now.

@simonbyrne simonbyrne merged commit 9a7c79c into master Nov 19, 2018

3 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
julia freebsd ci Build done
Details

@simonbyrne simonbyrne deleted the sb/mpfr-precision branch Nov 19, 2018

tkf added a commit to tkf/julia that referenced this pull request Nov 21, 2018

Make precision a keyword argument, improve handling of rounding mode. (
…JuliaLang#29157)

* Improve handling of precision and rounding mode arguments in BigFloat constructors.

This makes a few changes to avoid unnecessarily calling `setrounding` and `setprecision`. It also changes `precision` to be a keyword argument (though does not yet deprecate the old behaviour).

fredrikekre added a commit that referenced this pull request Dec 5, 2018

Addition of NEWS and compat admonitions for important
changes between Julia 1.0 and 1.1, including:

- Custom .css-style for compat admonitions.

- Information about compat annotations to CONTRIBUTING.md.

- NEWS.md entry for PRs #30090, #30035, #30022, #29978,
  #29969, #29858, #29845, #29754, #29638, #29636, #29615,
  #29600, #29506, #29469, #29316, #29259, #29178, #29153,
  #29033, #28902, #28761, #28745, #28708, #28696, #29997,
  #28790, #29092, #29108, #29782

- Compat annotation for PRs #30090, #30013, #29978,
  #29890, #29858, #29827, #29754, #29679, #29636, #29623,
  #29600, #29440, #29316, #29259, #29178, #29157, #29153,
  #29033, #28902, #28878, #28761, #28708, #28156, #29733,
  #29670, #29997, #28790, #29092, #29108, #29782, #25278

- Documentation for broadcasting CartesianIndices (#30230).
- Documentation for Base.julia_cmd().
- Documentation for colon constructor of CartesianIndices (#29440).
- Documentation for ^(::Matrix, ::Number) and ^(::Number, ::Matrix).

- Run NEWS-update.jl.

Co-authored-by: Morten Piibeleht <morten.piibeleht@gmail.com>
Co-authored-by: Fredrik Ekre <ekrefredrik@gmail.com>

fredrikekre added a commit that referenced this pull request Dec 5, 2018

Addition of NEWS and compat admonitions for important
changes between Julia 1.0 and 1.1, including:

- Custom .css-style for compat admonitions.

- Information about compat annotations to CONTRIBUTING.md.

- NEWS.md entry for PRs #30090, #30035, #30022, #29978,
  #29969, #29858, #29845, #29754, #29638, #29636, #29615,
  #29600, #29506, #29469, #29316, #29259, #29178, #29153,
  #29033, #28902, #28761, #28745, #28708, #28696, #29997,
  #28790, #29092, #29108, #29782

- Compat annotation for PRs #30090, #30013, #29978,
  #29890, #29858, #29827, #29754, #29679, #29636, #29623,
  #29600, #29440, #29316, #29259, #29178, #29157, #29153,
  #29033, #28902, #28878, #28761, #28708, #28156, #29733,
  #29670, #29997, #28790, #29092, #29108, #29782, #25278

- Documentation for broadcasting CartesianIndices (#30230).
- Documentation for Base.julia_cmd().
- Documentation for colon constructor of CartesianIndices (#29440).
- Documentation for ^(::Matrix, ::Number) and ^(::Number, ::Matrix).

- Run NEWS-update.jl.

Co-authored-by: Morten Piibeleht <morten.piibeleht@gmail.com>
Co-authored-by: Fredrik Ekre <ekrefredrik@gmail.com>

@dpsanders dpsanders referenced this pull request Dec 5, 2018

Merged

Fix printing of intervals #246

fredrikekre added a commit that referenced this pull request Dec 5, 2018

Compat admonitions and NEWS for Julia 1.1 (#30230)
Addition of NEWS and compat admonitions for important changes between Julia 1.0 and 1.1, including:

- Custom .css-style for compat admonitions.

- Information about compat annotations to CONTRIBUTING.md.

- NEWS.md entry for PRs #30090, #30035, #30022, #29978,
  #29969, #29858, #29845, #29754, #29638, #29636, #29615,
  #29600, #29506, #29469, #29316, #29259, #29178, #29153,
  #29033, #28902, #28761, #28745, #28708, #28696, #29997,
  #28790, #29092, #29108, #29782

- Compat annotation for PRs #30090, #30013, #29978,
  #29890, #29858, #29827, #29754, #29679, #29636, #29623,
  #29600, #29440, #29316, #29259, #29178, #29157, #29153,
  #29033, #28902, #28878, #28761, #28708, #28156, #29733,
  #29670, #29997, #28790, #29092, #29108, #29782, #25278

- Documentation for broadcasting CartesianIndices (#30230).
- Documentation for Base.julia_cmd().
- Documentation for colon constructor of CartesianIndices (#29440).
- Documentation for ^(::Matrix, ::Number) and ^(::Number, ::Matrix).

- Run NEWS-update.jl.


Co-authored-by: Morten Piibeleht <morten.piibeleht@gmail.com>
Co-authored-by: Fredrik Ekre <ekrefredrik@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.