| 445 | } |
| 446 | |
| 447 | void |
| 448 | testExtraPrecision() |
| 449 | { |
| 450 | parse_options opts; |
| 451 | opts.numbers = number_precision::precise; |
| 452 | BOOST_TEST( |
| 453 | parse("1002.9111801605201", {}, opts) == 1002.9111801605201 ); |
| 454 | BOOST_TEST( |
| 455 | parse("-1.0346132515963697", {}, opts) == -1.0346132515963697 ); |
| 456 | BOOST_TEST( |
| 457 | parse("-1207.1290929173115", {}, opts) == -1207.1290929173115 ); |
| 458 | BOOST_TEST( |
| 459 | parse("-0.90521880279912548", {}, opts) == -0.90521880279912548 ); |
| 460 | BOOST_TEST( |
| 461 | parse("370.91535570754445", {}, opts) == 370.91535570754445 ); |
| 462 | BOOST_TEST( |
| 463 | parse("-2578.5523049665962", {}, opts) == -2578.5523049665962 ); |
| 464 | |
| 465 | // test cases from https://www.icir.org/vern/papers/testbase-report.pdf |
| 466 | // (A Program for Testing IEEE Decimal–Binary Conversion by Vern Paxson) |
| 467 | BOOST_TEST( |
| 468 | parse("5e125", {}, opts) == 5e125 ); |
| 469 | BOOST_TEST( |
| 470 | parse("69e267", {}, opts) == 69e267 ); |
| 471 | BOOST_TEST( |
| 472 | parse("999e-026", {}, opts) == 999e-026 ); |
| 473 | BOOST_TEST( |
| 474 | parse("7861e-034", {}, opts) == 7861e-034 ); |
| 475 | BOOST_TEST( |
| 476 | parse("75569e-254", {}, opts) == 75569e-254 ); |
| 477 | BOOST_TEST( |
| 478 | parse("928609e-261", {}, opts) == 928609e-261 ); |
| 479 | BOOST_TEST( |
| 480 | parse("9210917e080", {}, opts) == 9210917e080 ); |
| 481 | BOOST_TEST( |
| 482 | parse("84863171e114", {}, opts) == 84863171e114 ); |
| 483 | BOOST_TEST( |
| 484 | parse("653777767e273", {}, opts) == 653777767e273 ); |
| 485 | BOOST_TEST( |
| 486 | parse("5232604057e-298", {}, opts) == 5232604057e-298 ); |
| 487 | BOOST_TEST( |
| 488 | parse("27235667517e-109", {}, opts) == 27235667517e-109 ); |
| 489 | BOOST_TEST( |
| 490 | parse("653532977297e-123", {}, opts) == 653532977297e-123 ); |
| 491 | BOOST_TEST( |
| 492 | parse("3142213164987e-294", {}, opts) == 3142213164987e-294 ); |
| 493 | BOOST_TEST( |
| 494 | parse("46202199371337e-072", {}, opts) == 46202199371337e-072 ); |
| 495 | BOOST_TEST( |
| 496 | parse("231010996856685e-073", {}, opts) == 231010996856685e-073 ); |
| 497 | BOOST_TEST( |
| 498 | parse("9324754620109615e212", {}, opts) == 9324754620109615e212 ); |
| 499 | BOOST_TEST( |
| 500 | parse("78459735791271921e049", {}, opts) == 78459735791271921e049 ); |
| 501 | BOOST_TEST( |
| 502 | parse("272104041512242479e200", {}, opts) == 272104041512242479e200 ); |
| 503 | BOOST_TEST( |
| 504 | parse("6802601037806061975e198", {}, opts) == 6802601037806061975e198 ); |
nothing calls this directly
no outgoing calls
no test coverage detected