diff options
| author | bors <bors@rust-lang.org> | 2020-01-05 17:31:32 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2020-01-05 17:31:32 +0000 |
| commit | bc1571cc3cfef07251f7df52b95525aa16797ca2 (patch) | |
| tree | 5f3fb5773cad1973ec174a5e1436076bd5fa87ee /src/libstd | |
| parent | b69f6e65c081f9a628ef5db83ba77e3861e60e60 (diff) | |
| parent | b9160fb56ced49c6087acb782c3260fab3936be9 (diff) | |
| download | rust-bc1571cc3cfef07251f7df52b95525aa16797ca2.tar.gz rust-bc1571cc3cfef07251f7df52b95525aa16797ca2.zip | |
Auto merge of #67903 - Dylan-DPC:rollup-k9djyrf, r=Dylan-DPC
Rollup of 5 pull requests Successful merges: - #67818 (rustdoc: Avoid panic when parsing codeblocks for playground links) - #67845 (Also remove const-hack for abs) - #67879 (Remove negative number check from float sqrt) - #67881 (Add backticks to various diagnostics) - #67882 (remove bespoke flock bindings) Failed merges: r? @ghost
Diffstat (limited to 'src/libstd')
| -rw-r--r-- | src/libstd/f32.rs | 2 | ||||
| -rw-r--r-- | src/libstd/f64.rs | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/src/libstd/f32.rs b/src/libstd/f32.rs index 54e0caeddaa..267d7013b1e 100644 --- a/src/libstd/f32.rs +++ b/src/libstd/f32.rs @@ -376,7 +376,7 @@ impl f32 { #[stable(feature = "rust1", since = "1.0.0")] #[inline] pub fn sqrt(self) -> f32 { - if self < 0.0 { NAN } else { unsafe { intrinsics::sqrtf32(self) } } + unsafe { intrinsics::sqrtf32(self) } } /// Returns `e^(self)`, (the exponential function). diff --git a/src/libstd/f64.rs b/src/libstd/f64.rs index aa32e5fb998..61ce7b29e26 100644 --- a/src/libstd/f64.rs +++ b/src/libstd/f64.rs @@ -342,7 +342,7 @@ impl f64 { #[stable(feature = "rust1", since = "1.0.0")] #[inline] pub fn sqrt(self) -> f64 { - if self < 0.0 { NAN } else { unsafe { intrinsics::sqrtf64(self) } } + unsafe { intrinsics::sqrtf64(self) } } /// Returns `e^(self)`, (the exponential function). |
