| 289 |
title="">value</var> を返します。そうでない場合、 |
title="">value</var> を返します。そうでない場合、 |
| 290 |
0-<var title="">value</var> を返します。 |
0-<var title="">value</var> を返します。 |
| 291 |
|
|
| 292 |
|
#pattern |
| 293 |
|
<span class=secno>* </span>Real numbers |
| 294 |
|
#ja |
| 295 |
|
<span class=secno>$1 </span>実数 |
| 296 |
|
|
| 297 |
|
#en |
| 298 |
|
A string is a <dfn id=valid1>valid floating point number</dfn> if it |
| 299 |
|
consists of one of more characters in the range U+0030 DIGIT ZERO (0) to |
| 300 |
|
U+0039 DIGIT NINE (9), optionally with a single U+002E FULL STOP (".") |
| 301 |
|
character somewhere (either before these numbers, in between two numbers, |
| 302 |
|
or after the numbers), all optionally prefixed with a U+002D HYPHEN-MINUS |
| 303 |
|
("-") character. |
| 304 |
|
#ja |
| 305 |
|
文字列は、範囲 U+0030 DIGIT ZERO (0) ~ |
| 306 |
|
U+0039 DIGIT NINE (9) の文字1文字以上で構成され、 |
| 307 |
|
任意選択で U+002E FULL STOP (".") 文字1文字がどこか (数字の前か、 |
| 308 |
|
2つの数字の間か、数字の後のいずれか) を含み、その全体について任意選択で接頭辞として |
| 309 |
|
U+002D HYPHEN-MINUS ("-") 文字がある場合、<dfn id=valid1>妥当な浮動小数点数</dfn>です。 |
| 310 |
|
|
| 311 |
|
#en |
| 312 |
|
The <dfn id=rules1>rules for parsing floating point number values</dfn> |
| 313 |
|
are as given in the following algorithm. As with the previous algorithms, |
| 314 |
|
when this one is invoked, the steps must be followed in the order given, |
| 315 |
|
aborting at the first step that returns a value. This algorithm will |
| 316 |
|
either return a number or an error. Leading spaces are ignored. Trailing |
| 317 |
|
spaces and garbage characters are ignored. |
| 318 |
|
#ja |
| 319 |
|
<dfn id=rules1>浮動小数点数値を構文解析する規則</dfn>は次の算法により与えられる通りです。 |
| 320 |
|
前述の算法と同様で、この算法が呼び出された時も、 |
| 321 |
|
与えられた順序に従い実行し、値を返す最初の段階で停止しなければ[[MUST:なりません]]。 |
| 322 |
|
この算法は、数か誤りのいずれかを返します。先頭の間隔は無視されます。 |
| 323 |
|
末尾の間隔とごみ文字は無視されます。 |
| 324 |
|
|
| 325 |
|
#en |
| 326 |
|
If the next character is not one of U+0030 DIGIT ZERO (0) .. U+0039 |
| 327 |
|
DIGIT NINE (9) or U+002E FULL STOP ("."), then return an error. |
| 328 |
|
#ja |
| 329 |
|
次の文字が U+0030 DIGIT ZERO (0) ~ U+0039 |
| 330 |
|
DIGIT NINE (9) か U+002E FULL STOP (".") のいずれかでなければ、 |
| 331 |
|
誤りを返します。 |
| 332 |
|
|
| 333 |
|
#en |
| 334 |
|
If the next character is U+002E FULL STOP ("."), but either that is |
| 335 |
|
the last character or the character after that one is not one of U+0030 |
| 336 |
|
DIGIT ZERO (0) .. U+0039 DIGIT NINE (9), then return an error. |
| 337 |
|
#ja |
| 338 |
|
次の文字が U+002E FULL STOP (".") でありながら、 |
| 339 |
|
これが最後の文字であるか、またはその次の文字が U+0030 |
| 340 |
|
DIGIT ZERO (0) ~ U+0039 DIGIT NINE (9) のいずれかではない場合、 |
| 341 |
|
誤りを返します。 |
| 342 |
|
|
| 343 |
|
#en |
| 344 |
|
If <var title="">position</var> is past the end of <var |
| 345 |
|
title="">input</var>, then if <var title="">sign</var> is "positive", |
| 346 |
|
return <var title="">value</var>, otherwise return 0-<var |
| 347 |
|
title="">value</var>. |
| 348 |
|
#ja |
| 349 |
|
<var title="">position</var> が <var |
| 350 |
|
title="">input</var> の終わりを過ぎている場合には、 |
| 351 |
|
<var title="">sign</var> が「正」であるなら <var title="">value</var> |
| 352 |
|
を返し、そうでないなら 0-<var |
| 353 |
|
title="">value</var> を返します。 |
| 354 |
|
|
| 355 |
|
#en |
| 356 |
|
Otherwise return to the top of step 10 in the overall algorithm |
| 357 |
|
(that's the step within which these substeps find themselves). |
| 358 |
|
#ja |
| 359 |
|
そうでない場合、全体の算法の段階 10 (これら部分段階が含まれている段階) |
| 360 |
|
の先頭に戻ります。 |
| 361 |
|
|
| 362 |
|
#en |
| 363 |
|
Otherwise, if the next character is not a U+002E FULL STOP ("."), then |
| 364 |
|
if <var title="">sign</var> is "positive", return <var |
| 365 |
|
title="">value</var>, otherwise return 0-<var title="">value</var>. |
| 366 |
|
#ja |
| 367 |
|
そうでない場合、次の文字が U+002E FULL STOP (".") でない場合には、 |
| 368 |
|
<var title="">sign</var> が「正」であるなら <var title="">value</var> |
| 369 |
|
を返し、そうでないなら 0-<var |
| 370 |
|
title="">value</var> を返します。 |
| 371 |
|
|
| 372 |
|
#en |
| 373 |
|
The next character is a U+002E FULL STOP ("."). Advance <var |
| 374 |
|
title="">position</var> to the character after that. |
| 375 |
|
#ja |
| 376 |
|
次の文字は U+002E FULL STOP (".") です。 <var |
| 377 |
|
title="">position</var> をその次の文字に進めます。 |
| 378 |
|
|
| 379 |
|
#en |
| 380 |
|
Let <var title="">divisor</var> be 1. |
| 381 |
|
#ja |
| 382 |
|
<var title="">divisor</var> を 1 とします。 |
| 383 |
|
|
| 384 |
|
#en |
| 385 |
|
Multiply <var title="">divisor</var> by ten. |
| 386 |
|
#ja |
| 387 |
|
<var title="">divisor</var> に 10 を掛けます。 |
| 388 |
|
|
| 389 |
|
#en |
| 390 |
|
Add the value of the current character (0..9) divided by <var |
| 391 |
|
title="">divisor</var>, to <var title="">value</var>. |
| 392 |
|
#ja |
| 393 |
|
現在の文字の値 (0~9) を <var |
| 394 |
|
title="">divisor</var> で割った値を、<var title="">value</var> |
| 395 |
|
に加えます。 |
| 396 |
|
|
| 397 |
|
#en |
| 398 |
|
Otherwise return to the top of step 14 in the overall algorithm |
| 399 |
|
(that's the step within which these substeps find themselves). |
| 400 |
|
#ja |
| 401 |
|
そうでない場合、全体の算法の段階 14 (これら部分段階が含まれている段階) の先頭に戻ります。 |
| 402 |
|
|
| 403 |
|
#en |
| 404 |
|
Otherwise, if <var title="">sign</var> is "positive", return <var |
| 405 |
|
title="">value</var>, otherwise return 0-<var title="">value</var>. |
| 406 |
|
#ja |
| 407 |
|
そうでない場合、 |
| 408 |
|
<var title="">sign</var> が「正」であるなら <var title="">value</var> |
| 409 |
|
を返し、そうでないなら 0-<var |
| 410 |
|
title="">value</var> を返します。 |