For example, the calculation of 2*3 computing opportunity first turns into binary calculation, if it is different encoding form, is not corresponding to the different binary
Reply content:
For example, the calculation of 2*3 computing opportunity first turns into binary calculation, if it is different encoding form, is not corresponding to the different binary
Yes, different codes will have different ways of recording data, and of course they will have similar places.
Coding is mainly for the string, in the digital storage is also the size of the end of the order of the points, are different binary data record rule embodiment.
The master has several basic concepts to figure out first.
The first thing you should say is "2*3" in the source code, the character encoding of the source code files can be different, and their binary representations are different. Then you refer to the "calculation", it must be compiled to generate the target code to be executed (whether it is interpreted or CPU instruction execution), if you are generated machine code, then on the same machine, the digital storage format is the same. If it is the bytecode of a virtual machine that is generated, the number format is the same as the bytecode encoding.
You have to figure out the type of data first. You calculate 2*3 is a two integer calculation, that is, 10*11 (binary), and there is no encoding, you put on a different schema simply means that the length of the integer is different.
You say that the encoding is for characters, such as 2 and 3 ASCII is 0110010 and 0110011 respectively, which is not used to calculate.
Yes, use whatever code you want, and store it anyway.
However, you must ensure that the results are identical.