Math errors on int64 and uint64
Using PSoC creator targeting PSoC5LP development kit
int32 math works fine. No errors found.
int64 or uint64 math fails with no errors at compile or runtime.
uint64 i,j; // i = 1116621
j=i*1000000 // volts to microvolt
// now j evaluates to 18446744073639054656 or
// this looks a lot like a 32bit overflow.
// why dont the compiler give an error if this is not implemented?
There was a known bug with displaying 64-bit integers with the debugger. Now corrected in actual version Creator 3.3. No known errors in math.lib.
The error is not displaying 64 bit ints. I am sure there are no errors in math.lib. It appears more like int64 is simply implemented as int32 without further comment. Found workaround, and will not spend more time on it. Just a surprise.
I wanted to add to this thread ... this is a BUG!!
If we simply declare a unit64, and then - in a loop - OR in a value (e.g. AA) and shift <<8, then do this three times, the uint64 becomes:
On that third shift there is an overflow and the upper two words become FFFFFFFF
Can you please provide us with a complete project to verify the error? Creator->File->Create workspace bundle