Update double-conversion to 7630f84a10f9428b041d0471e71a562141e9684b.
Change-Id: I37d176a938798cb74eae0a3a445182beb55a117d Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/434900 Commit-Queue: Ryan Macnak <rmacnak@google.com> Reviewed-by: Alexander Aprelev <aam@google.com>
This commit is contained in:
committed by
Commit Queue
parent
4431536776
commit
1fac08e708
+2
-1
@@ -340,7 +340,8 @@ def _CheckClangFormat(input_api, output_api):
|
||||
f.ChangedContents())):
|
||||
is_deps = True
|
||||
break
|
||||
if is_cpp_file(path) and os.path.isfile(path):
|
||||
if is_cpp_file(path) and os.path.isfile(
|
||||
path) and not path.startswith('third_party/'):
|
||||
files.append(path)
|
||||
|
||||
if is_deps:
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
URL: https://github.com/google/double-conversion
|
||||
Version: 032fa6a7d2c319b20d3928f5d762648fa4029acf
|
||||
Version: 7630f84a10f9428b041d0471e71a562141e9684b
|
||||
License: BSD
|
||||
License File: LICENSE
|
||||
|
||||
|
||||
+19
-1
@@ -19,7 +19,7 @@ There is extensive documentation in `double-conversion/string-to-double.h` and
|
||||
Building
|
||||
========
|
||||
|
||||
This library can be built with [scons][0] or [cmake][1].
|
||||
This library can be built with [scons][0], [cmake][1] or [bazel][2].
|
||||
The checked-in Makefile simply forwards to scons, and provides a
|
||||
shortcut to run all tests:
|
||||
|
||||
@@ -55,5 +55,23 @@ Use `-DBUILD_TESTING=ON` to build the test executable.
|
||||
make
|
||||
test/cctest/cctest
|
||||
|
||||
Bazel
|
||||
---
|
||||
|
||||
The simplest way to adopt this library is through the [Bazel Central Registry](https://registry.bazel.build/modules/double-conversion).
|
||||
|
||||
To build the library from the latest repository, run:
|
||||
|
||||
```
|
||||
bazel build //:double-conversion
|
||||
```
|
||||
|
||||
To run the unit test, run:
|
||||
|
||||
```
|
||||
bazel test //:cctest
|
||||
```
|
||||
|
||||
[0]: http://www.scons.org/
|
||||
[1]: https://cmake.org/
|
||||
[2]: https://bazel.build/
|
||||
|
||||
+2
-1
@@ -180,7 +180,7 @@ bool DoubleToStringConverter::ToShortestIeeeNumber(
|
||||
return HandleSpecialValues(value, result_builder);
|
||||
}
|
||||
|
||||
int decimal_point;
|
||||
int decimal_point = 0;
|
||||
bool sign;
|
||||
const int kDecimalRepCapacity = kBase10MaximalLength + 1;
|
||||
char decimal_rep[kDecimalRepCapacity];
|
||||
@@ -405,6 +405,7 @@ void DoubleToStringConverter::DoubleToAscii(double v,
|
||||
if (mode == PRECISION && requested_digits == 0) {
|
||||
vector[0] = '\0';
|
||||
*length = 0;
|
||||
*point = 0;
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -237,11 +237,24 @@ class DoubleToStringConverter {
|
||||
// kBase10MaximalLength significant digits).
|
||||
// "-1.7976931348623157e+308", "-1.7976931348623157E308"
|
||||
// In addition, the buffer must be able to hold the trailing '\0' character.
|
||||
//
|
||||
// Since the algorithm finds the shortest number of significant digits, it
|
||||
// can produce an output that isn't the shortest possible if the
|
||||
// decimal_in_shortest_high is high enough. For example, the number
|
||||
// 1e23 could be written as 99999999999999991611392 with 23
|
||||
// digits, however, it only needs one significant digit 1, and thus the
|
||||
// result is 100000000000000000000000, which has 24 digits.
|
||||
bool ToShortest(double value, StringBuilder* result_builder) const {
|
||||
return ToShortestIeeeNumber(value, result_builder, SHORTEST);
|
||||
}
|
||||
|
||||
// Same as ToShortest, but for single-precision floats.
|
||||
//
|
||||
// Since the algorithm finds the shortest number of significant digits, it
|
||||
// can, in very rare cases, produce an output that isn't the shortest possible.
|
||||
// For example, the number 1e11f could be written as 99999997952 with 11
|
||||
// digits, however, it only needs one significant digit 1, and thus the
|
||||
// result is 100000000000, which has 12 digits.
|
||||
bool ToShortestSingle(float value, StringBuilder* result_builder) const {
|
||||
return ToShortestIeeeNumber(value, result_builder, SHORTEST_SINGLE);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user