Skip to content
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

Pyccelisation of a cmath function #1422

Closed
tomcaruso opened this issue Jun 20, 2023 · 1 comment · Fixed by #1511
Closed

Pyccelisation of a cmath function #1422

tomcaruso opened this issue Jun 20, 2023 · 1 comment · Fixed by #1511

Comments

@tomcaruso
Copy link

Describe the bug

Pyccel does not support the cmath library.

To Reproduce

Try to pyccelise the following file :

from cmath import cosh
def function(a:'complex'):
    a1 = cosh(a)
    return(a1)

Error details

Provide the generated code, or the error message:

error [semantic]: cmath_test_function.py [1]| Module cmath is not currently supported by pyccel 

Expected behavior

I suppose that cmath library being similar to the math one, Pyccel should be able to call it no ?

Language

Fortran

@EmilyBourne
Copy link
Member

You are correct this should be fairly easy to add by following the example shown by the math library. The cmath functions are available in the complex.h header file in C (https://en.wikibooks.org/wiki/C_Programming/complex.h) and should be built-in in Fortran

@EmilyBourne EmilyBourne self-assigned this Sep 14, 2023
@EmilyBourne EmilyBourne linked a pull request Sep 14, 2023 that will close this issue
yguclu pushed a commit that referenced this issue Sep 16, 2023
Add support for the cmath library using similar methods to those used
for the math library. Fixes #1422.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants