Yifan Zhang has posted comments on this change. ( http://gerrit.cloudera.org:8080/14114 )
Change subject: [util] Add ExtractFloat method to JsonReader and improve ExtractDouble method ...................................................................... Patch Set 3: (1 comment) http://gerrit.cloudera.org:8080/#/c/14114/2/src/kudu/util/jsonreader.cc File src/kudu/util/jsonreader.cc: http://gerrit.cloudera.org:8080/#/c/14114/2/src/kudu/util/jsonreader.cc@248 PS2, Line 248: > This seems to be one of the major differences from the rapidjson implementa There are some precision issues in rapidjson implementation. Some of tests in rapidjson are: EXPECT_TRUE(Value(12.25).IsLosslessFloat()); EXPECT_FALSE(Value(0.3).IsLosslessFloat()); 0.3 is an approximation, for it is not powers of two or integer multiples thereof, there may be precision lost in conversion between double and float. The comparison 'a >= b && a <=b' seems not reasonable, for we just want to extract a float value, I think 'fabs(a-b) <= 1e-7' is better. -- To view, visit http://gerrit.cloudera.org:8080/14114 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-Project: kudu Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ica0a04fb21daceaa44233995a42a60686f59361b Gerrit-Change-Number: 14114 Gerrit-PatchSet: 3 Gerrit-Owner: Yifan Zhang <[email protected]> Gerrit-Reviewer: Adar Dembo <[email protected]> Gerrit-Reviewer: Andrew Wong <[email protected]> Gerrit-Reviewer: Kudu Jenkins (120) Gerrit-Reviewer: Yifan Zhang <[email protected]> Gerrit-Comment-Date: Thu, 22 Aug 2019 08:19:49 +0000 Gerrit-HasComments: Yes
