5000 is represented as 4 bytes (int) (Hexadecimal)
| 00 | 00 | 13 | 88 |
Now, when you convert it to byte, it just takes the last 1 byte.
Reason: at the IL level, the conv.u1 operator will be used, which will truncate the higher order bits if overflow occurs when converting int to byte, (See the comments section in conv.u1 ).
| 88 |
which is 136 in decimal notation
prashanth
source share