"Viktor" vi.ki@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