If I use
PRINTF("negative float test = %f", -1.234);
to print the negative float point number, I got the positive value from console, like
"negative float test = 1.234000"
Can you help me to fix it to show the real negative value?
p.s. define PRINTF_FLOAT_ENABLE=1
Solved! Go to Solution.
Hi Felix,
Negative floating point values can be printed by opening the Project Properties and defining both “PRINTF_FLOAT_ENABLE” and “PRINTF_ADVANCED_ENABLE” to 1 in the Preprocessor settings. This is shown below using the hello_world SDK example project.
Let me know if this solution works for you. If not, could you provide more details on your environment to help find a solution?
Regards,
Kaleb Belete
Hi Kaleb,
Thanks for your right answer.
I want to ask another question about floating point number.
I use CMSIS DSP library to do FFT (fast Fourier transform), this transform will use real number and complex number.
I use "Redlib (nohost-nf)" library now, and it seems ok to compile FFT API like "arm_rfft_fast_f32()".
Do I need to change the "Redlib (nohost-nf)" to another library for using floating point number?
Hi Felix,
Negative floating point values can be printed by opening the Project Properties and defining both “PRINTF_FLOAT_ENABLE” and “PRINTF_ADVANCED_ENABLE” to 1 in the Preprocessor settings. This is shown below using the hello_world SDK example project.
Let me know if this solution works for you. If not, could you provide more details on your environment to help find a solution?
Regards,
Kaleb Belete