It is like below.
bool Compare<T>(T x, T y) where T : class
{
...
}
So x
and y
should be of the same datatype. then only it can be compared. Decimal is 128 bits and single is 32 bits.
Decimal is Decimal floating point and Double is Binary floating point.
2
solved == between float and decimal in C#