-
Notifications
You must be signed in to change notification settings - Fork 90
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
feat: implement Exp trait for generic exponentiation #1203
base: main
Are you sure you want to change the base?
Conversation
From the provided
These observations focus on potential issues related to method definitions, type constraints, and data type conversions that could affect the correctness or performance of the code. |
Pull Request Test Coverage Report for Build 3813Details
💛 - Coveralls |
pub fn exp(input : Double) -> Double { | ||
trait Exp { | ||
exp(Self) -> Double | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what's the expected return type of exp function?
should it be Self
, Double
or Float
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think Self
is a proper choose.
If (1 : Int).exp(x)
need a Double
result, users always can turn it to Double
first.
1.to_double().exp(x)
No description provided.