Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and beauty - Length of js string
Length of js string
The maximum length of a string is related to the maximum safe integer that can be expressed in js. Why?

Utf- 16 related:

The exponent of the sign bit 1 is 1 1 mantissa bit 52 (1+1+52 = 64).

That should be 2 52- 1, but it's always 1 after one digit before the decimal point. * * * This doesn't need to be saved, so it becomes 2 53- 1.

My understanding is that as long as the total length of the transcoded binary does not exceed 2 53- 1, but the length of the transcoded binary is different with different encoding methods, so the maximum character length of the string is affected by the encoding method of the string.

Negative binary number

For example:-14

Original code-> Inverse code->; supplement

The original code is 0000110 (14 = 23+22+21).

Anticode11110001(bitwise inversion)

Complement11110010 (complement plus one)

Decimal binary

Example: binary 1. 1 .5, binary 1. 1 is pushed back:1* 20+1* 2 (-/kloc).