CBFalconer said:
Keith said:
CBFalconer said:
Since I can't easily render the formula in 5.2.4.4.2 in
plain text, I've grabbed a screenshot and made it available at
<
http://www.mib.org/~kst/5.2.4.2.2.gif>. Please read it. It very
clearly says that a floating-point number is defined by a formula
that specifies a single unique real value, *not* a range.
The formula is perfectly accurate. It reflects the value specified
by the FP content. It DOESN'T reflect the meaning of that value.
[...]
What is the difference between "the value" and "the meaning of that
value"? Does the standard define this "meaning"?
Not in so many words, but in effect. It specifies how to compute
the uncertainty in the value at some points, using EPSILONs. It
can't be especially precise, because it doesn't specify the FP
specification. All it takes is some understanding of the actual
systems to generalize it. The 'range' word that I have been using
expresses almost all of it.
Chapter and verse, please. Show me where the standard talks about
uncertainties in stored floating-point values (*not* in floating-point
calculations).
FLT_EPSILON, DBL_EPSILON, or LDBL_EPSILON is
"the difference between 1 and the least value greater than 1
that is representable in the given floating point type, b**(1-p)"
(The standard uses a superscript. b is the radix, typically 2;
p is the precision, the number of base-b digits in the significand.)
The definition says nothing about an "uncertainty in the value".
I think that when you use the phrase "the meaning of that
value", you're just referring to what *you* think it should mean.
Your interpretation is not supported by the standard. And as you
know, the standard defines the language, which is what we discuss
in this newsgroup.
What I've been talking about all along is what you call "the value
specified by the FP content".
You have your own preconceived notions about what you think a
floating-point number *should* mean, and you've been reading the
standard through that filter.
Let's try another approach. Different programming languages
support different kinds of numeric entities: signed and unsigned
integers, complex numbers, imaginary numbers, fixed-point numbers,
floating-point numbers, rational numbers, arbitrary-precision
numbers, and so forth.
Suppose we want to define a new kind of number-like entity.
Call it a "pseudo-real number", or PRN. We define it to have the
following properties:
A PRN can be stored in a relatively small fixed number of bits,
typically 32, 64, or something similar. A stored PRN corresponds to
a single unique real number; we can define a mathematical formula
for the correspondence. This corresponding real number is always
rational, with a denominator that's a power of 2 (other bases
are possible, but we'll leave that aside for now). Each PRN value
corresponds to some real value, but the vast majority of real values
do not have a corresponding PRN value. Note in particular that a
PRN does not specify a range. It specifies a unique real value.
The set of PRNs corresponds to a sparse discrete subset of the
real numbers. If you object to that idea, remember that I'm not
talking about floating-point numbers, I'm talking about PRNs, an
entity of my own invention. As long as my definition is consistent,
I can define it any way I like.
Operations on PRNs are defined as follows. Given "x op y" (where
op can be any of +, -, *, /), we determine the mathemetical real
number corresponding to each PRN operand. We apply the specified
operator to these two real values, yielding a mathematical real
result; call it Z. (I'm ignoring division by zero.) (Z will
always be a rational number; it may or may not have a corresponding
PRN value.) Now we choose, as the result of "x op y", a PRN value
whose corresponding real value is *close* to Z. How close it must
be is implementation-defined. (Ideally, we'd like to choose the
PRN value whose real value is as close as possible to Z, but we
don't require this.)
Of course we can't actually perform calculations with mathematical
real values, but the calculations must be done in a way that yields
the same result as what's described by the above algorithm.
Are you with me so far? Do you agree that this is an internally
consistent description? I'm not asking you to agree that it's
useful or that it corresponds to any physical reality, just that
it's consistent.
Clearly my description of PRNs is incompatible with your description
of floating-point numbers. Each PRN corresponds to a unique real
value; there are no ranges anywhere in the description.
Now here's the big question. How is this description of PRNs
incompatible with the C standard's description of floating-point
numbers? Not with your notions about what floating-point numbers
*should* be, but with what the C standard actually says about them.
If it is incompatible, please quote the exact wording from the
standard that demonstrates the incompatibility.
Another question: Would PRNs as I've described them be useful?
We can't represent all real numbers in a finite amount of storage;
are PRNs an acceptable compromise that allows us to do useful
calculations?
Given the recent history of this discussion, it seems likely that you
will not attempt to answer these questions. I'm prepared to be
pleasantly surprised.