You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As a programmer i need to have an Abs(x) function that accepts both float64, and float32 bit, so i don't have to convert the number to float64, and then back to float32, which is the current experience using the standard math package.
The proposed implementation uses generics (Float type), and type switching to return the appropriate result using the corresponding 32 and 64 bit algorithm.
This implementation provides full backward compatibility, as it does not changes the current function call for float64 values, while allowing the use of the function for float32.
I already have a working implementation on my local machine for the proposed solution, and it works as stated. please advise if i can submit the code proposal.
What version of Go are you using (go version)? 1.21.4 What operating system and processor architecture are you using? MacOs and Linux What did you do? The proposed implementation uses generics (Float type), and type switching to return the appropriate result using the corresponding 32 and 64 bit algorithm. What did you expect to see? The code provides float64 and float32 values without modifying current function signature
The text was updated successfully, but these errors were encountered:
Proposal Details
As a programmer i need to have an Abs(x) function that accepts both float64, and float32 bit, so i don't have to convert the number to float64, and then back to float32, which is the current experience using the standard math package.
The proposed implementation uses generics (Float type), and type switching to return the appropriate result using the corresponding 32 and 64 bit algorithm.
This implementation provides full backward compatibility, as it does not changes the current function call for float64 values, while allowing the use of the function for float32.
I already have a working implementation on my local machine for the proposed solution, and it works as stated. please advise if i can submit the code proposal.
What version of Go are you using (go version)? 1.21.4
What operating system and processor architecture are you using? MacOs and Linux
What did you do? The proposed implementation uses generics (Float type), and type switching to return the appropriate result using the corresponding 32 and 64 bit algorithm.
What did you expect to see? The code provides float64 and float32 values without modifying current function signature
The text was updated successfully, but these errors were encountered: