Talk about the pit-bit high-precision pressure

  Sometimes we find to be calculated data is very large, can only be calculated with precision. Great precision and complexity, the number of bits / apart a positive correlation between the size of the array, so in order to reduce complexity, often with the thought "pressure level", such as a (array element) it does not represent a 10 hexadecimal number, but represent a 10,000-hexadecimal number. A 100 so that the original number was pressed into 25 numbers, time and space complexity has significantly improved.

  But for a strange knowledge, or should be used with caution in case unforeseen pit.

  We generally 10 for converting the number with high accuracy as the number of decimal precision hexadecimal B, for convenience, is generally larger B 10 to the power k. For Option B, it is necessary to consider the good of the median compression, but also considered in the calculation prior to carry avoid overflow array type. The number digit hexadecimal number B should be 0 to (B-1), and therefore should be larger than the number of bits equal to B feed (Remember where B is equal to) the number of bits.

  The best array elements from the beginning, otherwise they will be divided into many special circumstances to be considered separately.

  Since the number of bits after pressing a representative of much larger than 10, so pay attention to the size of the array to be able to include the maximum number of bits that may occur during the calculation of (not necessarily the maximum number of results that may occur in the calculation of addition or multiplication the maximum number of digits in the process than the result of the maximum number of digits is also large, careful not to array bounds).

  Most pit point than the output. After the press to pay attention to the middle bit lost 0! Therefore, for each non-highest number of bits, we can not ignore leading zeros!

Guess you like

Origin www.cnblogs.com/InductiveSorting-QYF/p/11349746.html