Function for comparing floating point numbers
Is there something I forgot to consider


Overflow

fabs(x) + fabs(y) is prone to  overflow, even if mathematically epsilon() * (fabs(x) + fabs(y)) * pow(10, doia + 1) is representable as a T, resulting in incorrect results.

I'd expect cmp(T x, T y, unsigned int doia = 0) to work over the entire range of x,y.

// alternative
(fabs(x)/2 + fabs(y)/2) * (epsilon() * pow(10, doia + 1) * 2)


Not-a-number

The generation of gtoeq, ltoeq are 0 when either/both x or y are a not-a-number.  Thus code returns 0, incorrectly implying near equality.  Perhaps return something to indicate more that 3 conditions like a 4-bit (==,>,&lt;,not comparable) or a double -1,0,1,NAN.

Precision

The + 1 in doia + 1 does not well allow code to just use epsilon, but minimally must use 10 * epsilon.  Consider dropping the + 1.

Rather than an integer indicating some power-of-ten * epsilon, consider simply using the desired precision or n * epsilon().  For me I'd rather use a power-of-2.