Skip to content

Conversation

Smit-create
Copy link
Collaborator

y = exp(x)
y = log(x)
y = sqrt(x)
y = log10(x)
Copy link
Contributor

@certik certik Mar 14, 2022

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

So let's do it in subsequent PRs. See #229 and #230.

@certik certik merged commit 435792a into lcompilers:main Mar 20, 2022
@certik
Copy link
Contributor

certik commented Mar 20, 2022

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.

@Smit-create
Copy link
Collaborator Author

Yep, sounds good!

@Smit-create Smit-create deleted the cmath1 branch March 20, 2022 18:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants