Home > Back-end >  Pray god give directions
Pray god give directions

Time:10-08

Topic assignment add a minus sign
This type of topic how to do?

CodePudding user response:

Turn the binary
Make a clean break
Turn back

CodePudding user response:

reference 1st floor lin5161678 response:
turn binary
Make a clean break
Return

Can you point in detail? I'm a freshman no

CodePudding user response:

refer to the second floor woainia_ response:
Quote: refer to 1st floor lin5161678 response:
turn binary
Make a clean break
Return

Can you point in detail? I'm a freshman no

Step by step
Will 1000000 RPM binary
What is the results turn out

CodePudding user response:

The first step is to handle overflow section
Short is 2 bytes, input value over the short range can express, then keep only two bytes within the scope of the section
Unsigned short maximum is 65536, with 100000 minus 65536=34464 is the real was given to the short of residual value of the
The second step, to distinguish between a signed or unsigned shor
34464 is the number of the binary representation, short is a signed integer, range 32768 to 32767
34464 is greater than 32767 is necessarily a negative number;
According to a negative number of rules, from negative restored the original number is: negative and then take the complement - 1=
the original codeDirectly is too tired, opportunistic way is:
In 65536-34464 and then just add a minus sign
The answer should be - 32072, should not be - 16960

CodePudding user response:

Fun
reference 4 floor response:
the first step to handle overflow section
Short is 2 bytes, input value over the short range can express, then keep only two bytes within the scope of the section
Unsigned short maximum is 65536, with 100000 minus 65536=34464 is the real was given to the short of residual value of the
The second step, to distinguish between a signed or unsigned shor
34464 is the number of the binary representation, short is a signed integer, range 32768 to 32767
34464 is greater than 32767 is necessarily a negative number;
According to a negative number of rules, from negative restored the original number is: negative and then take the complement - 1=
the original codeDirectly is too tired, opportunistic way is:
In 65536-34464 and then just add a minus sign
The answer should be - 32072, should not be - 16960

1000000 you less calculate a 0

CodePudding user response:

Ah, well, it is simple, without considering the negative

CodePudding user response:

reference lin5161678 reply: 3/f
Quote: refer to the second floor woainia_ response:
Quote: refer to 1st floor lin5161678 response:
turn binary
Make a clean break
Return

Can you point in detail? I'm a freshman no

Step by step
Will 1000000 RPM binary
What is the results turn out

Hexadecimal conversion and the original code complement radix-minus-one complement I see today but still feel not
  • Related