2009-10-02 12:13 AM
The problem with calculations on types float with Cosmic compiler
2011-05-17 06:04 AM
Hi,
Why variable wsp_kal not have after the calculations of the correct value 0.000038? Example: float masa_kal,dzal_kal1,dzal_kal2,dzal_kal,wsp_kal; masa_kal = (float)(mas_kal[i+1]-mas_kal[i]); // correct 5 dzal_kal1 = (float)kal_ram.dz_kal[i+1]; // correct 329602 dzal_kal2 = (float)kal_ram.dz_kal[i]; // correct 198530 dzal_kal = (float)(dzal_kal1-dzal_kal2); // correct 131072 wsp_kal = (float)(masa_kal/dzal_kal); // incorrect 02011-05-17 06:04 AM
Hi,
What is the compiler used in your application and what is the optimization level? Please check with the following declaration: float masa_kal,dzal_kal1,dzal_kal2,dzal_kal,wsp_kal = 0.0; Regards mozra2011-05-17 06:04 AM
Hi,
I use STVD 4.1.2 and the compiler Cosmic CxSTM8 4.3.1 with optimizations: Minimize code size (+compact). Declaration: float masa_kal,dzal_kal1,dzal_kal2,dzal_kal,wsp_kal=0.0; - not bring the improvement. Best regards2011-05-17 06:04 AM
Hi,
The setting Display Item from Decimal on Standard in debuger solved the problem. Best regards krzysztof.skoczek