-
Notifications
You must be signed in to change notification settings - Fork 139
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
Updated documentation to note the pow(0, 0) case. #79
Conversation
src/pow.rs
Outdated
@@ -173,13 +173,16 @@ mod float_impls { | |||
|
|||
/// Raises a value to the power of exp, using exponentiation by squaring. | |||
/// | |||
/// Note that `0⁰` (`pow(0, 0)`) returnes `1`. Mathematicly this is undefined. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
spelling: should be "mathematically"
src/pow.rs
Outdated
@@ -208,6 +211,8 @@ pub fn pow<T: Clone + One + Mul<T, Output = T>>(mut base: T, mut exp: usize) -> | |||
|
|||
/// Raises a value to the power of exp, returning `None` if an overflow occurred. | |||
/// | |||
/// Note that `0⁰` (`checked_pow(0, 0)`) returnes `Some(1)`. Mathematicly this is undefined. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
*mathematically
Quoting prof Knuth:
|
@hauleth It's not clear to me if you're quoting that in favor or against, or just representing the debate. Anyway, commenting the existing behavior is harmless. bors r+ |
Build succeeded |
@cuviper my comment was in favour of current behaviour as I think it is more reasonable solution in case of computation. |
Ref #78