OT Ceckarsky kviz II

Jan Waclawek konfera@efton.sk
Čtvrtek Březen 5 19:24:22 CET 2009


Kua, to akoze sa to znamienko strati?

Mnojo, vidim, ze tych piv este bude... ;-)

wek





----- Original Message ---------------

>Uzasne! Toto by ma pri pisani programu nenapadlo...Vysvetlenie sa ale
>skryva v inom pravidle:
>
>Otherwise, if the operand that has unsigned integer type has rank greater or
>equal to the rank of the type of the other operand, then the operand with
>signed integer type is converted to the type of the operand with unsigned
>integer type.
>
>miro
>
>2009/3/5, Luká¹ Grepl <L.Grepl@sh.cvut.cz>:
>> > If an int can represent all values of the original type, the value is
>> > converted to an int;
>> > otherwise, it is converted to an unsigned int. These are called the integer
>> > promotions.48) All other types are unchanged by the integer promotions.
>>
>> Tohle to má urèité vtipné dùsledky. Zrovna pøed pár dny jsem se s tím
>> pìknì vypekl a to jsem si (naivka) myslel, ¾e u¾ mi integral promotion
>> nedìlá problémy.
>>
>> Tak¾e kdy¾ u¾ jsme u tìch kvízù, jakých hodnot mù¾e nabývat c?
>>
>>        int a = -50;
>>        unsigned int b = 50;
>>
>>        int c = a * b / 10;
>>
>> Luká¹ Grepl
>>
>> P.S. Integral promotion: It doesn't have to be logical. It's the law.




Další informace o konferenci Hw-list