I seem to be having issues with double literal constants.
I place a breakpoint on one of the executable lines and then use the emulator to display the variables.
Here is the code:
void test_exp_const (void)
{
double test_number[] = { 1.2E1, 2.3E45, 3.4E-6, -4.5E1, 5.6E-7};
float test_other[] = { 1.2, 0.345678, 34E5, -0.3425, 0.1234E-5 };
test_number[0] = test_number[0] * 2;
test_other[0] = test_other[0] * 2.0;
}
Here is what the emulator claims the numbers are:
test_number double[5] 0xC3001420 0xC3001420
[0] double 5.317941111879522e-315 0xC3001420
[1] double 3.209647124124661e-149 0xC3001428
[2] double -3.612240986106951e+021 0xC3001430
[3] double 1.593779568798647e-314 0xC3001438
[4] double 3.646871873938355e-280 0xC3001440
test_other float[5] 0xC3001448 0xC3001448
[0] float 1.2 0xC3001448
[1] float 0.345678 0xC300144C
[2] float 3400000.0 0xC3001450
[3] float -0.3425 0xC3001454
[4] float 1.234e-06 0xC3001458
The floating point numbers are fine, but all the doubles are really bad. It is interesting to note that I can use the emulator to change the numbers and they seem correct.