Arbitrary as in user-specified, yes. I'd like a BigFloat class whose numeric precision can be set to anything I want.
I can see two options:
1) Have a pool variable called "precision" and be able to set that when I want to change the precision.
2) Specify the precision separately for each instance of BigFloat.
I think (1) is much better because it's simpler and I don't have to worry so much about operations which combine different precision floats.
The interface might look like:
BigFloat setPrecision: 100. "100 decimal place precision." a := BigFloat fromFloat: 5.0.
Even nicer would be to add lexical support for BigFloats, but that would be much more work.
Mike
From: danielv@netvision.net.il Date: Thu, 31 Oct 2002 21:20:11 +0300
What does that mean? how do you represent irrational numbers? or is that arbitrary as in user specified, as different from infinite?
Michael Vanier mvanier@cs.caltech.edu wrote:
Has anyone implemented code for arbitrary precision floating-point numbers in squeak?
Mike