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

Unnecessary usage of intrinsics::copysignf32/64 in signum #61638

Closed
Centril opened this issue Jun 7, 2019 · 0 comments · Fixed by #61647
Closed

Unnecessary usage of intrinsics::copysignf32/64 in signum #61638

Centril opened this issue Jun 7, 2019 · 0 comments · Fixed by #61647
Labels
C-cleanup Category: PRs that clean code up or issues documenting cleanup. E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.

Comments

@Centril
Copy link
Contributor

Centril commented Jun 7, 2019

In f32::signum and f64::signum we use intrinsics::copysignf32 and intrinsics::copysignf64. However, these intrinsics are exposed with a stable wrapper f32::copysign and f64::copysign. We should use those instead.

unsafe { intrinsics::copysignf32(1.0, self) }

unsafe { intrinsics::copysignf64(1.0, self) }

@Centril Centril added E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. C-cleanup Category: PRs that clean code up or issues documenting cleanup. labels Jun 7, 2019
Centril added a commit to Centril/rust that referenced this issue Jun 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-cleanup Category: PRs that clean code up or issues documenting cleanup. E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant