Fortran How can you write sgn[Im(z)] in fortran?

  • Thread starter Thread starter nnnnn
  • Start date Start date
  • Tags Tags
    Fortran
Click For Summary
To write "sgn[Im(z)]" in Fortran, it is suggested to use the SIGN function, which determines the sign of a number. However, there is uncertainty regarding how the SIGN function handles complex numbers in different compilers. It may be advisable to separate the real and imaginary components of a complex variable into distinct variables for better control. The discussion also touches on the need to include specific headers in the Fortran code, although details on which headers are necessary are not provided. Overall, clarity on the handling of complex numbers and the use of the SIGN function is emphasized.
nnnnn
Messages
5
Reaction score
0
How can you write "sgn[Im(z)]" in fortran?

Hello everybody;


How can you write "sgn[Im(z)]" in fortran? , then what do

you need to add in the header?

also what does "sign(a,b)" mean?


Much Thanks in advance
 
Technology news on Phys.org


I'm not sure how your compiler will handle SIGN with complex numbers. It may be useful for you to keep track of the real/imaginary components separately in different variables rather than using a single COMPLEX variable.

If it does work with complex numbers though, then great.
 
Learn If you want to write code for Python Machine learning, AI Statistics/data analysis Scientific research Web application servers Some microcontrollers JavaScript/Node JS/TypeScript Web sites Web application servers C# Games (Unity) Consumer applications (Windows) Business applications C++ Games (Unreal Engine) Operating systems, device drivers Microcontrollers/embedded systems Consumer applications (Linux) Some more tips: Do not learn C++ (or any other dialect of C) as a...

Similar threads

  • · Replies 21 ·
Replies
21
Views
3K
  • · Replies 17 ·
Replies
17
Views
6K
  • · Replies 4 ·
Replies
4
Views
8K
  • · Replies 59 ·
2
Replies
59
Views
11K
  • · Replies 17 ·
Replies
17
Views
4K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 8 ·
Replies
8
Views
4K
  • · Replies 4 ·
Replies
4
Views
6K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 9 ·
Replies
9
Views
2K