> DOES, INDEED, give you 24 significant digts OF
WHAT YOU FED IT.
On Fri, 21 Oct 2011, David Cantrell wrote:
What I'm getting at is that there's no widely
understood datatype that
lets me say:
pi = 3.1 to two significant decimal digits;
THAT I agree with. My crude implementation proposal is:
struct floatwprec3
{ float value3;
int precision3;
}
that at least lets you say:
pi.value3 = 3.1;
pi.lostprec = 2;
[note: the '3', or other numeric digit, is to make it immediately obvious
that something is a variable name, not a reserved word, etc.]
and that it is foolish to assume that any float is
accurate to 24
significant binary digits. The moment you, eg, multiply two floats
which are already approximations together, then you lose precision.
absolutely agreed.
Creating a float gives you 24 bit accurate approximation of what you feed
it. Every subsequent assignment based on calculations further reduces
that.
--
Grumpy Ol' Fred cisin at
xenosoft.com