The problem is pretty subtle, but it has to do with the fact that the E
in 14.3925125E
is parsed in scientific notation. In math, the E
suffix is an abbreviation for multiplying its operand by the exponentiation of 10
times the number that follows. For example, 5.23E4
in scientific notation means 5.23 * 10^4
.
In your situation, since a number doesn't follow the E
suffix, its parsed as an invalid floating point literal, so the number is not assigned to degrees[1]
.
Instead of reading the value into degrees[1]
directly, I would recommend instead reading it into a string, parsing the floating-point part from the E
, and convert and assign them to their respective variables.