简体   繁体   中英

Convert.ChangeType matrix

Is there any resource that shows .NET Convert.ChangeType() results in a table? ie converting from which type to which type will be successful, overflow, invalid cast or throwing other exceptions.

In particular, I want to know whether converting between signed and unsigned numerals of the same size (eg Int32 and UInt32) will be successful, overflow or invalid cast.

int32的最大值为2,147,483,647,UInt32的最大值为4,294,967,295,因此,如果将数字从int32转换为uint32并停留在int32的最大边界上,反之亦然,那么就不会有问题,否则它将给您一个被零除的异常

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM