|
-
Dec 8th, 2002, 02:22 PM
#1
Rational numbers
I'm looking for a class that represents a rational number. But I need a really good one, it should support shortening itself to the smallest possible representation and the 4 basic arithmetic operations.
I have written one myself, but it suffers from the lack of precision. It creates an OutOfMemoryError if one of the two integers gets as large as ~ one billion (yeah, lack of precision ). Problem is that this can actually happen when inverting matrices, which is what I do.
Any help or info appreciated. An algorithm to shorten the number without allocating one GB of data would suffice (happens to me sometimes...).
Thanks in advance.
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|