-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Inline temporary variable adds unnecessary cast #69869
Comments
Futhermore, after executing code action, IDE doesn't suggest you remove unnecessary cast. So this is simplifier's problem: it cannot determine, that in the given context overload with |
Doubles are challenging due to the casts having semantics even when the types are exactly the same. We likely want to be cautious about adding the explicit fp cast in the first place. Avoiding it if we can be sure it isn't necessary. |
Wait what?! Can you give an example? |
Machines often execute fp operations on higher precision than 32 or 64 bits. Casting explicitly reduces the precision down to those levels. So you can get different results. |
i create a pr triying to fix this problem if you can review it please :) |
@pyoub if you ping me tomorrow I can take a look! |
@CyrusNajmabadi can you check the PR please @DoctorKrolic already did and didnt like approve the solution. so is there any suggestion? |
Version Used:
Latest
main
Steps to Reproduce:
Inline variable
a
;Expected Behavior:
Actual Behavior:
The text was updated successfully, but these errors were encountered: