I'm using Microvision 4 C compiler Armcc.Exe v4.0.0.524 When this compiler converts a floating point number (single precision) to INT8 it doesn't handle negative values properly. For example INT8 Function::Convertnumber(F32 number) { INT8 return; return = number; }
this only works for positive numbers. If a negative value is passed into the function 0 is returned only. Seems like a bug in the compiler. I can't find any errata concerning this but i'm wondering if anyone else has noticed this problem and how it was solved?
It had to do with a configuration tool unrelated to KEIL procucts. The compiler is working as intendended, sorry again for any confusion and thanks again for responding.
It had to do with a configuration tool unrelated to KEIL procucts.
I'll take that to mean that the INT8 type was actually not, like you had posted before,
typedef signed char INT8;
but rather ended up being some variation of
typedef unsigned char INT8;
correct