diff --git a/core/tests/Drupal/Tests/Component/Utility/NumberTest.php b/core/tests/Drupal/Tests/Component/Utility/NumberTest.php index eb4658c94b..f951a339a1 100644 --- a/core/tests/Drupal/Tests/Component/Utility/NumberTest.php +++ b/core/tests/Drupal/Tests/Component/Utility/NumberTest.php @@ -67,15 +67,25 @@ public function provideGetPrecision() { [1, '0.0'], [0, -0.0], [1, '-0.0'], - # The maximum supported precision is 15 decimals. + # The maximum supported float precision is 15 decimals. [0, 0.0000000000000], - [15, '0.000000000000000'], [0, -0.0000000000000], - [15, '-0.000000000000000'], [9, -0.0000000090000], - [15, '-0.000000009000000'], [9, -0.0000000090000], + [9, -0.00000000900000], + [9, -0.000000009000000000], + [15, -0.0000000090000009], + [15, -0.00000000900000099], + [15, -0.000000009000000900009], + # Numeric strings do not suffer from the system-specific limitations to + # float precision, so they can contain many more significant decimals. + # This is especially useful when working with solutions such as BCMath + # (https://secure.php.net/manual/en/book.bc.php) + [15, '0.000000000000000'], + [15, '-0.000000000000000'], [15, '-0.000000009000000'], + [16, '-0.0000000090000000'], + [20, '-0.00000000900000000000'], ]; }