codedamn

Uint8 = -128

Created by Kshitij about a year ago

0

No description provided

4 Comments

    0

    but uint8 ranges from -128 to 127.. why compilation error??

    @raghav7008

    Raghav Bansal

    @raghav7008

    0

    u== unsigned so unsignedint8 range is 0 to 255 id it is int8 then signed int and its range should be -127 to 128

    @prakhartiwari

    Lucky Tiwari

    @prakhartiwari

    0

    u = unsigned meaning with 8 bits, you do need to have any sign bits at the MSB (Most Significant Bit) side. And hence, all the bits can be used to represent a number. |0|0|0|0|0|0|0|0|

    With 8 bits, one can represent 2^8 numbers i.e. from 0 to (2^8-1) => 0 to (256-1) => 0 to 255.

    @abhisekp

    Abhisek Pattnaik

    @abhisekp

    0

    uint will not accept negative numbers

    @tejeswarsa0660

    Tejeswar Sai M

    @tejeswarsa0660

Your comment