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

Rollup of 6 pull requests #125574

Merged
merged 13 commits into from
May 26, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions library/core/src/num/f32.rs
Original file line number Diff line number Diff line change
Expand Up @@ -901,8 +901,8 @@ impl f32 {
#[stable(feature = "f32_deg_rad_conversions", since = "1.7.0")]
#[inline]
pub fn to_radians(self) -> f32 {
let value: f32 = consts::PI;
self * (value / 180.0f32)
const RADS_PER_DEG: f32 = consts::PI / 180.0;
self * RADS_PER_DEG
}

/// Returns the maximum of the two numbers, ignoring NaN.
Expand Down
4 changes: 2 additions & 2 deletions library/core/src/num/f64.rs
Original file line number Diff line number Diff line change
Expand Up @@ -912,8 +912,8 @@ impl f64 {
#[stable(feature = "rust1", since = "1.0.0")]
#[inline]
pub fn to_radians(self) -> f64 {
let value: f64 = consts::PI;
self * (value / 180.0)
const RADS_PER_DEG: f64 = consts::PI / 180.0;
self * RADS_PER_DEG
}

/// Returns the maximum of the two numbers, ignoring NaN.
Expand Down
Loading