views:

68

answers:

2

Is it possible to get more decimal precision than the decimal type in C#? According to MSDN, the decimal type can store up to 29 significant digits, however I am wondering if it possible to store more than that and how to go about doing so.

Thanks in advance.

+1  A: 

Sure - you can come up with your own data type (or use an existing third party library - the J++ runtime has an implementation of BigDecimal usable from C#).

What do you need that for? It is VERY unusual to need more than 29 significant digits ;)

TomTom
This question is more theoretical then practical. Recently I was trying to write a program to write Pi to a certain number of decimal places and I realized that I could only store up to 29 decimal places. Thus this question was born.
APShredder
Yeah. Mathematical playing is pretty much the only real use ;)
TomTom
A: 

You can use a scaled BigInteger if you're using 4.0. That will make arithmetic easier.

recursive