behavior of double in debug in MPLab x ver 5.25 & xc32 compiler
I am using the pic32mk family, which has double precision floating built into the hardware. I was doing some timing tests with float, and things seem to work fine. When I try to do some tests with double, the watch window shows the wrong result for double arithmetic. Here's an example:
double x = 0.0L, y = 23.123456789L, z = 1234.567891011L; // I added the "L" since I heard there was a bug with xc compilers.
x = y * z;
When I look at the watch, it seems to only be able to store them as float. Even if I go to the watch window, and go to change the type to "IEEE double", it still stays as float. Is it just the watch that's showing the wrong thing, or does the double precision multiply actually not happen?
Nevermind. I just found another thread that mentions that you have to cast "double" as "long double" for it to be 8 byte double. So, I think double == float, and long double == double.
post edited by MPaulHolmes - 2020/02/05 22:26:17