This is an automated email from the ASF dual-hosted git repository. ovilia pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/incubator-echarts.git
commit d5c25225872c491002d7cff3b104746041becf2a Author: Ovilia <[email protected]> AuthorDate: Fri Oct 25 14:37:01 2019 +0800 style: add comment --- src/util/number.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/util/number.js b/src/util/number.js index aecd858..cf84e9a 100644 --- a/src/util/number.js +++ b/src/util/number.js @@ -399,6 +399,11 @@ export function quantityExponent(val) { } var exp = Math.floor(Math.log(val) / Math.LN10); + /** + * exp is expected to be the rounded-down result of the base-10 log of val. + * But due to the precision loss with Math.log(val), we need to restore it + * using 10^exp to make sure we can get val back from exp. #11249 + */ if (val / Math.pow(10, exp) >= 10) { exp++; } --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
