I am using QVector.append to append a double to QVector. Using my debugger, I can see that the double has a value of 40.783333499999998, however, the QVector values are rounded to 40.7833. Again, I see this on my debugger, not using qDebug so I'm relatively sure that the error is in the storage/appending function and not some other loss of precision elsewhere in my code. It's very important that the vector contains the full value. My code is below. In the debugger I can see that both the DictionaryOfValues and the iterator contains full precision, but the dataMatrix value is rounded. I can't seem to find where this error occurs. I'm using QT 5.2.1 MinGW 32 bit. Any help would be greatly appreciated.
In this code, DictionaryOfValues is a QMap and dataMatrix is a QMap>
QMapIterator<QString,double> i(DictionaryOfValues);
while (i.hasNext())
{
i.next();
dataMatrix[i.key()].append(i.value());
}