Skip to content

Commit

Permalink
[e] (0) Define what numbers actually mean. Fix ranges in the date mic…
Browse files Browse the repository at this point in the history
…rosyntaxes.

git-svn-id: http://svn.whatwg.org/webapps@2610 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information
Hixie committed Dec 29, 2008
1 parent 7b6352d commit 0373c2e
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 7 deletions.
29 changes: 25 additions & 4 deletions index
Expand Up @@ -2088,6 +2088,9 @@
consists of one of more characters in the range U+0030 DIGIT ZERO
(0) to U+0039 DIGIT NINE (9).</p>

<p>A <a href=#valid-non-negative-integer>valid non-negative integer</a> represents the number
that is represented in base ten by that string of digits.</p>

<p>The <dfn id=rules-for-parsing-non-negative-integers>rules for parsing non-negative integers</dfn> are as
given in the following algorithm. When invoked, the steps must be
followed in the order given, aborting at the first step that returns
Expand Down Expand Up @@ -2141,6 +2144,13 @@
NINE (9), optionally prefixed with a U+002D HYPHEN-MINUS ("-")
character.</p>

<p>A <a href=#valid-integer>valid integer</a> without a U+002D HYPHEN-MINUS ("-")
prefix represents the number that is represented in base ten by that
string of digits. A <a href=#valid-integer>valid integer</a> <em>with</em> a
U+002D HYPHEN-MINUS ("-") prefix represents the <em>negative</em>
number represented in base ten by the string of digits that follows
the U+002D HYPHEN-MINUS.</p>

<p>The <dfn id=rules-for-parsing-integers>rules for parsing integers</dfn> are similar to the
<a href=#rules-for-parsing-non-negative-integers title="rules for parsing non-negative integers">rules for
non-negative integers</a>, and are as given in the following
Expand Down Expand Up @@ -2237,7 +2247,18 @@

</ol></li>

</ol><p>The <dfn id=rules-for-parsing-floating-point-number-values>rules for parsing floating point number values</dfn> are
</ol><p>A <a href=#valid-floating-point-number>valid floating point number</a> represents the number
obtained by multiplying the significand by ten raised to the power
of the exponent, where the significand is the first number,
interpreted as base ten (including the decimal point and the number
after the decimal point, if any, and interpreting the significand as
a negative number if the whole string starts with a U+002D
HYPHEN-MINUS ("-") character), and where the exponent is the number
after the E, if any (interpreted as a negative number if there is a
U+002D HYPHEN-MINUS ("-") character between the E and the
number). If there is no E, then the exponent is treated as zero.</p>

<p>The <dfn id=rules-for-parsing-floating-point-number-values>rules for parsing floating point number values</dfn> are
as given in the following algorithm. As with the previous
algorithms, when this one is invoked, the steps must be followed in
the order given, aborting at the first step that returns
Expand Down Expand Up @@ -2447,7 +2468,7 @@
<li>Otherwise, return <var title="">number1</var> and
<var title="">number2</var>.</li>

</ol><!-- XXX again, this should say "positive number" --><p>The algorithm to <dfn id=find-a-number>find a number</dfn> is as follows. It is
</ol><p>The algorithm to <dfn id=find-a-number>find a number</dfn> is as follows. It is
given a string and a starting position, and returns either nothing,
a number, or an error condition.</p>

Expand Down Expand Up @@ -2774,7 +2795,7 @@

<li>Two <a href=#concept-datetime-digit title=concept-datetime-digit>digits</a>,
representing the month <var title="">month</var>, in the range
0&nbsp;&le;&nbsp;<var title="">month</var>&nbsp;&le;&nbsp;12</li>
1&nbsp;&le;&nbsp;<var title="">month</var>&nbsp;&le;&nbsp;12</li>

</ol><p>The rules to <dfn id=parse-a-month-string>parse a month string</dfn> are as follows. This
will either return a year and month, or nothing. If at any point the
Expand Down Expand Up @@ -2842,7 +2863,7 @@

<li>Two <a href=#concept-datetime-digit title=concept-datetime-digit>digits</a>,
representing <var title="">day</var>, in the range
0&nbsp;&le;&nbsp;<var title="">day</var>&nbsp;&le;&nbsp;<var title="">maxday</var> where <var title="">maxday</var> is the <a href=#number-of-days-in-month-month-of-year-year title="number of days in month month of year year">number of days
1&nbsp;&le;&nbsp;<var title="">day</var>&nbsp;&le;&nbsp;<var title="">maxday</var> where <var title="">maxday</var> is the <a href=#number-of-days-in-month-month-of-year-year title="number of days in month month of year year">number of days
in the month <var title="">month</var> and year <var title="">year</var></a></li>

</ol><p>The rules to <dfn id=parse-a-date-string>parse a date string</dfn> are as follows. This
Expand Down
26 changes: 23 additions & 3 deletions source
Expand Up @@ -1163,6 +1163,9 @@
consists of one of more characters in the range U+0030 DIGIT ZERO
(0) to U+0039 DIGIT NINE (9).</p>

<p>A <span>valid non-negative integer</span> represents the number
that is represented in base ten by that string of digits.</p>

<p>The <dfn>rules for parsing non-negative integers</dfn> are as
given in the following algorithm. When invoked, the steps must be
followed in the order given, aborting at the first step that returns
Expand Down Expand Up @@ -1229,6 +1232,13 @@
NINE (9), optionally prefixed with a U+002D HYPHEN-MINUS ("-")
character.</p>

<p>A <span>valid integer</span> without a U+002D HYPHEN-MINUS ("-")
prefix represents the number that is represented in base ten by that
string of digits. A <span>valid integer</span> <em>with</em> a
U+002D HYPHEN-MINUS ("-") prefix represents the <em>negative</em>
number represented in base ten by the string of digits that follows
the U+002D HYPHEN-MINUS.</p>

<p>The <dfn>rules for parsing integers</dfn> are similar to the
<span title="rules for parsing non-negative integers">rules for
non-negative integers</span>, and are as given in the following
Expand Down Expand Up @@ -1357,6 +1367,17 @@

</ol>

<p>A <span>valid floating point number</span> represents the number
obtained by multiplying the significand by ten raised to the power
of the exponent, where the significand is the first number,
interpreted as base ten (including the decimal point and the number
after the decimal point, if any, and interpreting the significand as
a negative number if the whole string starts with a U+002D
HYPHEN-MINUS ("-") character), and where the exponent is the number
after the E, if any (interpreted as a negative number if there is a
U+002D HYPHEN-MINUS ("-") character between the E and the
number). If there is no E, then the exponent is treated as zero.</p>

<p>The <dfn>rules for parsing floating point number values</dfn> are
as given in the following algorithm. As with the previous
algorithms, when this one is invoked, the steps must be followed in
Expand Down Expand Up @@ -1627,7 +1648,6 @@

</ol>

<!-- XXX again, this should say "positive number" -->
<p>The algorithm to <dfn>find a number</dfn> is as follows. It is
given a string and a starting position, and returns either nothing,
a number, or an error condition.</p>
Expand Down Expand Up @@ -2019,7 +2039,7 @@

<li>Two <span title="concept-datetime-digit">digits</span>,
representing the month <var title="">month</var>, in the range
0&nbsp;&le;&nbsp;<var
1&nbsp;&le;&nbsp;<var
title="">month</var>&nbsp;&le;&nbsp;12</li>

</ol>
Expand Down Expand Up @@ -2110,7 +2130,7 @@

<li>Two <span title="concept-datetime-digit">digits</span>,
representing <var title="">day</var>, in the range
0&nbsp;&le;&nbsp;<var title="">day</var>&nbsp;&le;&nbsp;<var
1&nbsp;&le;&nbsp;<var title="">day</var>&nbsp;&le;&nbsp;<var
title="">maxday</var> where <var title="">maxday</var> is the <span
title="number of days in month month of year year">number of days
in the month <var title="">month</var> and year <var
Expand Down

0 comments on commit 0373c2e

Please sign in to comment.