arbitrary precision floats?
Lex Spoon
lex at cc.gatech.edu
Mon Nov 4 00:17:21 UTC 2002
"Viktor" <vi.ki at worldonline.cz> wrote:
> Maybe something like this (?):
>
> [some operations] doWithPrecision: 100.
>
> Precision is thread-variable (Thread current precisionOf Floats).
>
Tempting, but that doesn't handle the case that you call back into
another module -- the other module will get your module's floating point
precision. I guess we could posit yet a new kind of variable whith is
thread-specific *and* module specific....
But in stock Squeak, how about having a variable somewhere that things
in your project access whenever they start doing floating point?
x := 1.0 withPrecision: MyProject defaultFloatPrecision.
Incidentally, I don't know that the idea of a single precision is really
going to last within a single project.... Is there really just one kind
of computation it performs?! Different computations will want different
precisions.
Lex
More information about the Squeak-dev
mailing list
|