The root problem is that the floating-point types are designed for approximate calculations. This is unavoidable in principle. Did you know that in general case, the single real number contains the infinite volume of information? So, there is no a way in principle to present such value without approximation.
Now, your case deals with integer values. For integer values, there is a wonderful type with unlimited size:
System.Numerics.BigInteger
:
http://msdn.microsoft.com/en-us/library/system.numerics.biginteger.aspx[
^].
"Unlimited" actually means "limited by all available memory provided by the system to your application". And this is, well, a lot…
[EDIT]
By the way, this type is available to you as you use v.4.0. Good for you. Those who does not have development tools supporting this version could pick up the source code from Mono.
Good luck,
—SA