you're correct, it does print the full value with qSetRealNumberPrecision! i was using the debugger to check the values. ok so the problem then is with comparison i guess..
after the values are inserted into the vector, the vector is used with std::upper_bound and std::lower_bound to find the original value, and that's where the problem is. upper/lower bound aren't returning the position of the double in the qvector.
//b = list.begin();
//e = list.end();
//n = list.size();
double get_upper_bound(double x) const
{
QVector<double>::Iterator it = upper_bound(b,e,x);
unsigned pos = it-b; // find the first element >= x. this is the issue, pos sometimes returns 0 instead of the proper location in the qvector
return (pos/n);
}
//b = list.begin();
//e = list.end();
//n = list.size();
double get_upper_bound(double x) const
{
QVector<double>::Iterator it = upper_bound(b,e,x);
unsigned pos = it-b; // find the first element >= x. this is the issue, pos sometimes returns 0 instead of the proper location in the qvector
return (pos/n);
}
To copy to clipboard, switch view to plain text mode
Bookmarks