430 : INumber<TOther>
431 {
432 if (typeof(TOther) == typeof(byte))
433 {
434 return (
byte)(object)
value;
435 }
436 if (typeof(TOther) == typeof(char))
437 {
438 return (
char)(object)
value;
439 }
440 if (typeof(TOther) == typeof(decimal))
441 {
442 return (
int)(decimal)(
object)
value;
443 }
444 checked
445 {
446 if (typeof(TOther) == typeof(double))
447 {
448 return (
int)(double)(
object)
value;
449 }
450 if (typeof(TOther) == typeof(short))
451 {
452 return (
short)(object)
value;
453 }
454 if (typeof(TOther) == typeof(int))
455 {
456 return (
int)(object)
value;
457 }
458 if (typeof(TOther) == typeof(long))
459 {
460 return (
int)(long)(
object)
value;
461 }
462 if (typeof(TOther) == typeof(IntPtr))
463 {
465 }
466 if (typeof(TOther) == typeof(sbyte))
467 {
468 return (sbyte)(object)
value;
469 }
470 if (typeof(TOther) == typeof(float))
471 {
472 return (
int)(float)(
object)
value;
473 }
474 if (typeof(TOther) == typeof(ushort))
475 {
476 return (ushort)(object)
value;
477 }
478 if (typeof(TOther) == typeof(uint))
479 {
480 return (
int)(uint)(
object)
value;
481 }
482 if (typeof(TOther) == typeof(ulong))
483 {
484 return (
int)(ulong)(
object)
value;
485 }
486 if (typeof(TOther) == typeof(UIntPtr))
487 {
488 return (
int)(nuint)(UIntPtr)(object)
value;
489 }
490 ThrowHelper.ThrowNotSupportedException();
491 return 0;
492 }
493 }