Hello Rajani,
according to our bug trace records, floating point literals are truncated to 9 digits after the period sign - when evaluating the numbers. Later, when the numbers are generated in C code, they are truncated again to 6 digits after the period sign.
This is an error in Embedded Wizard. We have fixed the problem already for the upcoming version 12.00 we are actually working on. For older version you need a workaround or a dedicated patch.
The simplest workaround would be to avoid the floating point literals < 0.000001. This is of course not always possible. Second workaround would be to store the floating point literals in native code as demonstrated below. This will work, however, in target system only:
var float someValue; /* = 0.0000000001 does not work here */
// To correctly initialize the variable with a small value
// use 'native' code section. This will work in the target
// system only. Not in Prototyper.
$if !$prototyper
native ( someValue )
{
someValue = 0.0000000001f;
}
$end
// ... use the value now
If none of the workarounds works for you, you can contact us via support@embedded-wizard.de for a patch.
Best regards
Paul Banach