| OLD | NEW |
| 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 30 matching lines...) Expand all Loading... |
| 41 while ((significand & Double::kHiddenBit) == 0) { | 41 while ((significand & Double::kHiddenBit) == 0) { |
| 42 significand = significand << 1; | 42 significand = significand << 1; |
| 43 exponent = exponent - 1; | 43 exponent = exponent - 1; |
| 44 } | 44 } |
| 45 return exponent; | 45 return exponent; |
| 46 } | 46 } |
| 47 | 47 |
| 48 | 48 |
| 49 // Forward declarations: | 49 // Forward declarations: |
| 50 // Returns an estimation of k such that 10^(k-1) <= v < 10^k. | 50 // Returns an estimation of k such that 10^(k-1) <= v < 10^k. |
| 51 static int EstimatePower(int); | 51 static int EstimatePower(int exponent); |
| 52 // Computes v / 10^estimated_power exactly, as a ratio of two bignums, numerator | 52 // Computes v / 10^estimated_power exactly, as a ratio of two bignums, numerator |
| 53 // and denominator. | 53 // and denominator. |
| 54 static void InitialScaledStartValues(double v, | 54 static void InitialScaledStartValues(double v, |
| 55 int estimated_power, | 55 int estimated_power, |
| 56 bool need_boundary_deltas, | 56 bool need_boundary_deltas, |
| 57 Bignum* numerator, | 57 Bignum* numerator, |
| 58 Bignum* denominator, | 58 Bignum* denominator, |
| 59 Bignum* delta_minus, | 59 Bignum* delta_minus, |
| 60 Bignum* delta_plus); | 60 Bignum* delta_plus); |
| 61 // Multiplies numerator/denominator so that its values lies in the range 1-10. | 61 // Multiplies numerator/denominator so that its values lies in the range 1-10. |
| (...skipping 584 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 646 delta_minus->Times10(); | 646 delta_minus->Times10(); |
| 647 delta_plus->AssignBignum(*delta_minus); | 647 delta_plus->AssignBignum(*delta_minus); |
| 648 } else { | 648 } else { |
| 649 delta_minus->Times10(); | 649 delta_minus->Times10(); |
| 650 delta_plus->Times10(); | 650 delta_plus->Times10(); |
| 651 } | 651 } |
| 652 } | 652 } |
| 653 } | 653 } |
| 654 | 654 |
| 655 } } // namespace v8::internal | 655 } } // namespace v8::internal |
| OLD | NEW |