[Bug 3248] Numeric precision

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





--- Comment #9 from Dave Peterson <davep@iit.edu>  2008-09-06 02:27:46 ---
(In reply to comment #8)

> (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...)

1.  The lexical and canonical representations are strings, so will need to be
(single) quoted.

2.  Re '300':  Looking at the algorithm in the canonical representation
function,
      1.   Let nV be the ·numericalValue· of pD.  [nV=300]
          Let aP be the ·arithmeticPrecision· of pD.  [aP=0]
      2.   pD is one of NaN, INF, or -INF, then return
·specialRepCanonicalMap·(nV).  [N/A]
      3.  Otherwise, if nV is an integer and aP is zero and 1E-6 &#8804; nV
&#8804; 1E6, then return ·noDecimalPtCanonicalMap·(nV).  [Return '300']  (if
garbled, '&#8804;' is less-than-or-equal)
      [remainder of the algorithm does not apply]

Therefore, the table above should have '300', not '3e2', for the canonical
representation.

3.  Re '3.0e2':  Looking at the algorithm in the lexical representation
function,
      Return
          -1 x ·noDecimalMap·(E)   when C is a noDecimalPtNumeral, [N/A] and
         ·decimalPtPrecision·(C) - ·noDecimalMap·(E)   otherwise. [1 - 2, i.e.,
-1]

Therefore the table above should have -1 as the arithmetic precision of
'3.0e2'.

4.  I think you need at least one pair of examples with the same value and the
same precision (and hence the same canonical representation), but different
lexical representations.  E.g. '3.0e2' and '30e1' (and '0.30e3', for that
matter).  That example is also special because there is no lexical
representation not involving scientific notation (true of all values with
negativve arithmetic precision).


-- 
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 Saturday, 6 September 2008 02:28:23 UTC