Skip to content

Conversation

@aturon
Copy link
Contributor

@aturon aturon commented Apr 25, 2014

Follow-up on issue #13297 and PR #13710. Instead of following the (confusing) C/C++ approach
of using MIN_VALUE for the smallest positive number, we introduce MIN_POS_VALUE (and
in the Float trait, min_pos_value) to represent this number.

This patch also removes a few remaining redundantly-defined constants that were missed last
time around.

Follow-up on issue rust-lang#13297 and PR rust-lang#13710.  Instead of following the (confusing) C/C++ approach
of using `MIN_VALUE` for the smallest *positive* number, we introduce `MIN_POS_VALUE` (and
in the Float trait, `min_pos_value`) to represent this number.

This patch also removes a few remaining redundantly-defined constants that were missed last
time around.
@aturon
Copy link
Contributor Author

aturon commented Apr 25, 2014

/cc @bjz

Copy link
Member

Choose a reason for hiding this comment

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

Is there a different but still reasonable name for this? It may be confusing for someone who's used to C's weird definition and tries to use this constant without looking at the value.

Copy link
Contributor

Choose a reason for hiding this comment

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

This doesn't shock me since Rust tries to fix the C/C++ legacy in various domains... plus I would expect a newcomer to at least lookup the function name/doc on rustdoc.

Copy link
Contributor

Choose a reason for hiding this comment

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

C++11 introduced numeric_limits::lowest, but that's an ugly backwards compatibility workaround. So long as we document this, I think it is good to get this right from the start.

@brendanzab
Copy link
Contributor

Looks good! r+ from me. @brson?

bors added a commit that referenced this pull request Apr 25, 2014
Follow-up on issue #13297 and PR #13710.  Instead of following the (confusing) C/C++ approach
of using `MIN_VALUE` for the smallest *positive* number, we introduce `MIN_POS_VALUE` (and
in the Float trait, `min_pos_value`) to represent this number.

This patch also removes a few remaining redundantly-defined constants that were missed last
time around.
@bors bors closed this Apr 25, 2014
@bors bors merged commit b8da4d7 into rust-lang:master Apr 25, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants