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

nextfloat(x), prevfloat(x), eps(x) respect precision of BigFloat #19948

Closed
wants to merge 5 commits into from

Conversation

dpsanders
Copy link
Contributor

@dpsanders dpsanders commented Jan 9, 2017

nextfloat(x), prevfloat(x) and eps(x) now respect the precision of the BigFloat x, rather than using the global BigFloat precision.

This includes a rewritten generic eps function.

Part of #13155

@tkelman tkelman added the needs tests Unit tests are required for this change label Jan 9, 2017
@dpsanders
Copy link
Contributor Author

cc @simonbyrne

@dpsanders
Copy link
Contributor Author

Is this considered a feature? I.e. do I need to polish it off soonish to get into 0.6?

@tkelman
Copy link
Contributor

tkelman commented Feb 13, 2017

a new keyword argument to an exported constructor looks like a feature to me

@dpsanders
Copy link
Contributor Author

Is there any chance of getting some of these changes into 1.0?

@simonbyrne
Copy link
Contributor

simonbyrne commented Feb 2, 2018

I'm in favour. The main I would like to see changes are:

  1. eps(x::BigFloat) should have the same precision as x
  2. check that eps(Float32)/eps(Float64) still get reduced to constants at compile time
  3. add documentation noting that these functions ignore global precision.

@dpsanders
Copy link
Contributor Author

OK thanks - I agree.
I think that changing nextfloat and prevfloat to also respect the precision of x goes along with that?

@simonbyrne
Copy link
Contributor

Yes, sorry I didn't mention that because you had already made that change!

@brenhinkeller brenhinkeller added maths Mathematical functions bignums BigInt and BigFloat labels Nov 26, 2022
@laborg
Copy link
Contributor

laborg commented Oct 19, 2023

@dpsanders mind to close this? As of now nextfloat and prevfloat respect the precision of BigFloat.

@dpsanders dpsanders closed this Oct 19, 2023
@dpsanders
Copy link
Contributor Author

Thanks @laborg!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bignums BigInt and BigFloat maths Mathematical functions needs tests Unit tests are required for this change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants