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

Rename realmin/max -> floatmin/max #28302

Merged
merged 2 commits into from
Jul 28, 2018
Merged

Rename realmin/max -> floatmin/max #28302

merged 2 commits into from
Jul 28, 2018

Conversation

Keno
Copy link
Member

@Keno Keno commented Jul 27, 2018

Similar in spirit to #28301 and also discussed on triage today. The names realmin/realmax, don't make too much sense in our terminology. These function are floating-point property queries, querying in particular the largest/smallest positive normalized floating point value. posnormfloatmin isn't a great name however, so simply floatmin was suggested. This has the advantage that it's suggestive of the fact that it's a floating point type query, even if it's not quite the minimum floating point value or even the minimum positive floating point value, but that's what docs are for. In any case, they're better than real. We have a good number of subtypes of Real for which these functions make no sense. In libc, these are called FLT_MIN/FLT_MAX or DBL_MIN/DBL_MAX.

Note, this PR is against #28301, since it touches some of the same lines and I wanted to keep the diff clean. I expect to merge that PR first and rebase this against master.

@Keno Keno added this to the 0.7 milestone Jul 27, 2018
@ararslan ararslan mentioned this pull request Jul 27, 2018
13 tasks
@ararslan ararslan added maths Mathematical functions deprecation This change introduces or involves a deprecation labels Jul 27, 2018
@oscardssmith
Copy link
Member

why not deprecate to eps(0.0)? does that not take into account subnormals or something?

@ViralBShah
Copy link
Member


julia> realmin(Float64)
2.2250738585072014e-308

julia> eps(0.0)
5.0e-324

@ViralBShah
Copy link
Member

Also, not generalizable for the other extreme.

@Keno Keno changed the base branch from kf/eps to master July 28, 2018 16:18
@Keno
Copy link
Member Author

Keno commented Jul 28, 2018

We could have a normeps or a nextnormfloat, in which case these would be nextnormfloat(0.0) and prevfloat(Inf), but not sure that's any better.

@Keno
Copy link
Member Author

Keno commented Jul 28, 2018

Alright, good to go or are there any alternatives we're considering?

@Keno Keno merged commit bf74a57 into master Jul 28, 2018
@ararslan ararslan deleted the kf/realminmax branch July 28, 2018 20:00
KristofferC pushed a commit that referenced this pull request Feb 11, 2019
The names `realmin`/`realmax`, don't make too much sense in our terminology. These function are floating-point property queries, querying in particular the largest/smallest positive normalized floating point value. `posnormfloatmin` isn't a great name however, so simply `floatmin` was suggested. This has the advantage that it's suggestive of the fact that it's a floating point type query, even if it's not quite the minimum floating point value or even the minimum positive floating point value, but that's what docs are for. In any case, they're better than real. We have a good number of subtypes of `Real` for which these functions make no sense. In libc, these are called FLT_MIN/FLT_MAX or DBL_MIN/DBL_MAX.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
deprecation This change introduces or involves a deprecation maths Mathematical functions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants