DictionaryForumContacts

 Nastya27

link 21.07.2015 12:22 
Subject: язык С битовый оператор progr.
main()
{
unsigned int u;
printf("Input a number: ");
scanf("%d",&u);
printf("2\'s complement is: %x\n",~u+1);
Result>
Input a number: 256
2's complement is: ff00

2's complement - это двойное отрицание или нет что-то другое?

 SirReal moderator

link 21.07.2015 12:25 
https://ru.wikipedia.org/wiki/Дополнительный_код_(представление_числа)

 Nastya27

link 21.07.2015 14:52 
спасибо!

 

You need to be logged in to post in the forum