[Bug 3248] Numeric precision

http://www.w3.org/Bugs/Public/show_bug.cgi?id=3248





--- Comment #8 from Michael Kay <mike@saxonica.com>  2008-09-05 20:47:14 ---
I was asked to review where we are on this.

I think I originally had two main criticisms of the spec as it was. One was
that it was hard to distinguish general remarks about the world in which we
live from specific statements about the semantics of the data type being
specified. The other was that some of the detailed information about the data
type was missing. (In retrospect, I don't now know whether it really was
missing, or whether I had simply failed to find it among all the noise.)

Like Mary, I don't think the essay in Appendix D of the proposal referenced in
comment #6 belongs in the spec (however interesting reading it is). We don't
have similar essays about the Gregorian calendar or about floating point
arithmetic. We shouldn't try to justify the choices we have made or tell
readers what other alternatives we could have chosen. What we should try to do
is to explain as clearly as we can and as unambiguously as we can how this
datatype actually behaves.

I would like to suggest the following changes relative to the Last Call draft.

(1) In 3.3.4, replace the second paragraph "Precision is sometimes given..."
by:

"Informally, the precision of the value is the number of decimal digits after
the decimal point. The numbers 2 and 2.00, although numerically equal, are
considered to have different precision (0 and 2 respectively). The precision of
a value depends on the way it is written, and is derived from the lexical
representation using rules described in [3.3.4.2 Lexical Mapping]. The
precision of a value is retained as part of the value space, but plays no part
in any operations defined in this specification other than the identity
relationship: specifically, it does not affect equality or ordering
comparisons. It might play a role in arithmetic operations, but that is outside
the scope of this specification."

(2) In 3.3.4.2 Lexical Mapping, at the end of the current text, add:

"For example, given the lexical representations in the first column of the
following table, the corresponding values and canonical representations are as
shown in the adjacent columns:


Lexical          |  Value                               | Canonical
Representation   |  Numerical value | Precision | Sign  | Representation
                 |                  |           |       |
3                |  3               | 0         | +     | 3
3.00             |  3               | 2         | +     | 3.00
300              |  300             | 0         | +     | 3e2
3.0e2            |  300             | 1         | +     | 3.0e2
...."

(please correct if necessary, and add entries that illustrate the range of
possibilities...)


-- 
Configure bugmail: http://www.w3.org/Bugs/Public/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.

Received on Friday, 5 September 2008 20:47:54 UTC