Skip to content

Conversation

@wired8
Copy link
Contributor

@wired8 wired8 commented Dec 29, 2021

Some initial tests for Complex. Currently np.sqrt returns an incorrect value.

@@ -0,0 +1,17 @@
from ulab import numpy as np

print ( -0.3826834+0.9238795j + 0.5j )
Copy link
Owner

@v923z v923z Dec 30, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These test micropython's complex support, because the operands are scalars.

print(np.exp(a))

for n in [0,1j,2,0.3j,4,5j]:
print(n**2)
Copy link
Owner

@v923z v923z Dec 30, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again, since n is a scalar, this is a test for micropython, and not ulab. The power operator is not implemented for complex arrays. See #456 (comment) .

/docs/manual/source/**/*.pyi
/docs/.ipynb_checkpoints/
/docs/ulab-test.ipynb
/code/.atom-build.yml
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would not like to add user-specific .gitignore files to the repository.

@v923z
Copy link
Owner

v923z commented Dec 30, 2021

Some initial tests for Complex. Currently np.sqrt returns an incorrect value.

Indeed. Thanks for pointing this out. I have fixed it.

@v923z
Copy link
Owner

v923z commented Dec 30, 2021

@wired8 Phil, I added some tests in 9eebed2 . Let me know if anything else comes to your mind!

@v923z v923z mentioned this pull request Jan 7, 2022
@v923z v923z deleted the branch v923z:complex2 January 8, 2022 11:11
@v923z v923z closed this Jan 8, 2022
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