1

Possible Duplicate:
.NET Framework Library for arbitrary digit precision

How can I store a real number, eg, root 2 or one third, up to an arbitrary precision (the precision I need is infinate precision) in vb.net?

I would like to be able to store real numbers and perform operations on them (ie root 2 times root 2) without losing any accuracy - IE storing 1/3 would return the value 1/3 if I needed to retrieve this value.

I was thinking of using a fractal encoding but I am unsure as to the best way to do this.

Storage capacity is not an issue, I just need the real numbers to be 100% accurate.

Community
  • 1
  • 1
marscom
  • 615
  • 2
  • 11
  • 24
  • Didnt know about that library, will it solve the issue of storing for example 1/3 in a form that allows the storage of that value in a form that will not require an infinate number of 3's to be stored? IE 0.3333... – marscom Jul 17 '12 at 19:08

1 Answers1

0

Will that be a single real number there or does it need to be an arbitrary number of (almost) arbitrary figures? (Sorry for "answer" - for some reason i can't add comments now...)

Konrad Viltersten
  • 36,151
  • 76
  • 250
  • 438
  • It will need to be a single real number, like root two or 1/3, but also I will need to be able to perform operations on these real numbers, like multiply them. Thanks – marscom Jul 17 '12 at 19:09
  • Unless there is a library that i don't know about for handling irrational numbers, you'll need to develop an algorithm for it. It's not that hard but it's not a VB issue. The thread needs to be moved to a more appropriate location. – Konrad Viltersten Jul 17 '12 at 20:14