>I'd like to see every number bundled with a "precision" attribute.
That's not what I call a high-level language feature. People don't
want to think about that, nor about machine-level precision issues.
See REXX.
In fact, I'd rather to see a painless and transparent int->float->bignum
autoconversion happen, the way currently we (theoretically) see the
int->float one occur. But there's probably much more to think about there.
If I say "my num $n", that should suffice; there should be little cause
for supporting "my num:56 $n" or whatnot, where bits are given.
There's just so much you can do for people before Brain is required,
and precision is one such. Three real stories:
1 I have a document that claims you lose 3.6F per 984' of elevation
gain. No, the original is 2C per 300 meters, so the result should
be 4F per 1000'. There's an unmerited confidence level
in that precision.
2 The commonly held human body temperature of 98.6F is "inaccurate"
at best, for much the same reason, although this involves a +/-
term, too. The real answer is something more like 37C with the
all-important +/- 1C (or so) normal variation. So conversion
to degrees F should be less rigorous by far.
3 A National Geographic once printed something about how you
need but "lower the temperature 5C (41F) to blah blah". How
insane. They meant 9F. Someone ran there c2f(5) and got 41,
but we're not talking absolutes. We're talking deltas. Just
because 5C == 41F doesn't mean that a change of 5C means a change
of 41F! (Actually, it may have been phrased more like "a loss
of just -9F (-27.778C)", now that I think of it, which is the
same class of error.)
All three show common buggos related to numeric processing. I don't
see how adding a "precision" attribute is going to fix much of that.
The first might in *theory* be fixed, a bit, but I would still nearly
always rather save the round-off till the final representation, eg
in some printf "%.2f" output, lest round-off error super-accumulate.
Sometimes you just have to learn about the stuff we all hated [:-)]
in those dreadd numerical analysis courses, like precision and
accuracy and round-off error and floating-point numbers and numerical
techniques that exacerbate error versus thus those that ameliorate it.
--tom