Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(65)

Side by Side Diff: runtime/third_party/double-conversion/src/bignum-dtoa.cc

Issue 2850783002: Dart SDK Spelling b, c, and d. (Closed)
Patch Set: Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2010 the V8 project authors. All rights reserved. 1 // Copyright 2010 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 530 matching lines...) Expand 10 before | Expand all | Expand 10 after
541 // - a scaled (common) denominator. 541 // - a scaled (common) denominator.
542 // optionally (used by GenerateShortestDigits to decide if it has the shortest 542 // optionally (used by GenerateShortestDigits to decide if it has the shortest
543 // decimal converting back to v): 543 // decimal converting back to v):
544 // - v - m-: the distance to the lower boundary. 544 // - v - m-: the distance to the lower boundary.
545 // - m+ - v: the distance to the upper boundary. 545 // - m+ - v: the distance to the upper boundary.
546 // 546 //
547 // v, m+, m-, and therefore v - m- and m+ - v all share the same denominator. 547 // v, m+, m-, and therefore v - m- and m+ - v all share the same denominator.
548 // 548 //
549 // Let ep == estimated_power, then the returned values will satisfy: 549 // Let ep == estimated_power, then the returned values will satisfy:
550 // v / 10^ep = numerator / denominator. 550 // v / 10^ep = numerator / denominator.
551 // v's boundarys m- and m+: 551 // v's boundaries m- and m+:
552 // m- / 10^ep == v / 10^ep - delta_minus / denominator 552 // m- / 10^ep == v / 10^ep - delta_minus / denominator
553 // m+ / 10^ep == v / 10^ep + delta_plus / denominator 553 // m+ / 10^ep == v / 10^ep + delta_plus / denominator
554 // Or in other words: 554 // Or in other words:
555 // m- == v - delta_minus * 10^ep / denominator; 555 // m- == v - delta_minus * 10^ep / denominator;
556 // m+ == v + delta_plus * 10^ep / denominator; 556 // m+ == v + delta_plus * 10^ep / denominator;
557 // 557 //
558 // Since 10^(k-1) <= v < 10^k (with k == estimated_power) 558 // Since 10^(k-1) <= v < 10^k (with k == estimated_power)
559 // or 10^k <= v < 10^(k+1) 559 // or 10^k <= v < 10^(k+1)
560 // we then have 0.1 <= numerator/denominator < 1 560 // we then have 0.1 <= numerator/denominator < 1
561 // or 1 <= numerator/denominator < 10 561 // or 1 <= numerator/denominator < 10
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
632 delta_minus->Times10(); 632 delta_minus->Times10();
633 delta_plus->AssignBignum(*delta_minus); 633 delta_plus->AssignBignum(*delta_minus);
634 } else { 634 } else {
635 delta_minus->Times10(); 635 delta_minus->Times10();
636 delta_plus->Times10(); 636 delta_plus->Times10();
637 } 637 }
638 } 638 }
639 } 639 }
640 640
641 } // namespace double_conversion 641 } // namespace double_conversion
OLDNEW
« no previous file with comments | « runtime/third_party/binary_size/src/template/D3SymbolTreeMap.js ('k') | runtime/third_party/double-conversion/src/strtod.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698