-
Notifications
You must be signed in to change notification settings - Fork 170
Implement cmath python module #228
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
Conversation
integration_tests/test_cmath.py
Outdated
y = exp(x) | ||
y = log(x) | ||
y = sqrt(x) | ||
y = log10(x) |
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.
Let's also test the results in y
to make sure we are getting the right answer and not 0. I tested locally and it seems to work. I think we need to implement this in LPython first:
>>> y = 3+3j
>>> y
(3+3j)
>>> y.real
3.0
>>> y.imag
3.0
And absolute value for complex numbers:
>>> abs(y - (3+3j))
0.0
>>> abs(y - (3+3.001j))
0.0009999999999998899
This looks good, thanks! Let's get the real/imag parts of complex numbers working, so that we can add tests here that test the results. |
Yep, sounds good! |
#200