Rationale about not implementing IConvertible on BigRational

Oct 27, 2010 at 5:25 PM

I'm writing some code which allows conversion from various types and have relied on IConvertible to handle certain cases. I note that BigRational (and BigInteger) doesn't implement this interface, though it appears useful when the type of number which a reference points to is unknown.

Why not?

Developer
May 30, 2011 at 4:32 PM

This is because we consider IConvertible a legacy interface. It causes all the primitive types to be dependent on each other (something we now regret), and it's not extensible (for example, it doesn't support ToDateTimeOffset because DateTimeOffset was added in a later version).