Questions tagged [loss-of-significance]

loss-of-significance is a phenomenon occuring in numerical programs when the result is significantly less accurate than the resolution of the floating point numbers used. Often, but not always, loss-of-significance can be circumvented by making the required adjustments to the numerical algorithm.

2 questions
2
votes
1 answer

Java - Comparable interface with very small number

I have this class that stores the latitude and the longitude of a coordinate and it distances from the center. At some point in my algorithm I have a list of these Coordinate and I want to sort them by their distance from the center. Thus, I…
-1
votes
1 answer

Discrepancies in C++ float subtraction

I'm working on a Vec3 template class that (not surprisingly) stores a vector of three elements of any type. Here's the class header with the irrelevant bits stripped: template class Vec3 { private: T data[3] = {0}; public: …