maxy88
asked on
Convert int32 to int16
Hello EE,
I need to convert an int32 to an int16. If I use the System.Convert.ToInt16(myI
Cheers,
Max.
You can't - an int16 can only store numbers from -32768 and 32767
That should have said:
an int16 can only store numbers from -32768 to 32767
It's just not possible to store numbers greater than 32767 in an int16
an int16 can only store numbers from -32768 to 32767
It's just not possible to store numbers greater than 32767 in an int16
ASKER
Are you saying there is no way to convert from an int32 with value 65529 to an int16 whose value should be -7
Cheers,
Max.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Hey it actually worked....(Why didn't I try this first instead of System.Convert.ToInt16) LOL. Thanks!
Apologies - completely didn't get what you was asking!