working with complex numbers
Hi! Greetings!
I am working with complex numbers on STM32L0 nucleo board using SW4STM32 eclipse.
My abstract code:
while()
{
...other statements...which calculate the value of znext to be 2.76623654 + -0.352664977 * I
volatile _Complex float znprev=zn;
volatile _Complex float zn=znext; //I am not able to get the value of ‘znext’ to be transferred to ‘zn’.
}
Meanwhile if I keep the cursor on ‘zn’ in run mode, I get following:
Name : zn
Details:2.76623654 + -0.352664977 * I
Default:3.5 + 0 * I
Decimal:3 + 0 * I
Hex:0x3 + 0x0 * I
Binary:11 + 0 * I
Octal:03 + 0 * I
Why the value displayed in “Default” does not get replaced by the value in “Details”?
I also have tried using the syntax “complex volatile float” and “volatile complex float”.
Sometimes I get in the output. I tried setting different optimization levels and finally kept “Optimize for Debug (-Og)”
Please provide your suggestions.
Regards,
Sanket