@@ -994,8 +994,12 @@ private static bool TryConvertFromSaturating<TOther>(TOther value, out nint resu
994
994
if ( typeof ( TOther ) == typeof ( double ) )
995
995
{
996
996
double actualValue = ( double ) ( object ) value ;
997
+ #if MONO
997
998
result = ( actualValue >= nint_t . MaxValue ) ? unchecked ( ( nint ) nint_t . MaxValue ) :
998
999
( actualValue <= nint_t . MinValue ) ? unchecked ( ( nint ) nint_t . MinValue ) : ( nint ) actualValue ;
1000
+ #else
1001
+ result = ( nint ) actualValue ;
1002
+ #endif
999
1003
return true ;
1000
1004
}
1001
1005
else if ( typeof ( TOther ) == typeof ( Half ) )
@@ -1040,8 +1044,12 @@ private static bool TryConvertFromSaturating<TOther>(TOther value, out nint resu
1040
1044
else if ( typeof ( TOther ) == typeof ( float ) )
1041
1045
{
1042
1046
float actualValue = ( float ) ( object ) value ;
1047
+ #if MONO
1043
1048
result = ( actualValue >= nint_t . MaxValue ) ? unchecked ( ( nint ) nint_t . MaxValue ) :
1044
1049
( actualValue <= nint_t . MinValue ) ? unchecked ( ( nint ) nint_t . MinValue ) : ( nint ) actualValue ;
1050
+ #else
1051
+ result = ( nint ) actualValue ;
1052
+ #endif
1045
1053
return true ;
1046
1054
}
1047
1055
else
@@ -1071,8 +1079,12 @@ private static bool TryConvertFromTruncating<TOther>(TOther value, out nint resu
1071
1079
if ( typeof ( TOther ) == typeof ( double ) )
1072
1080
{
1073
1081
double actualValue = ( double ) ( object ) value ;
1082
+ #if MONO
1074
1083
result = ( actualValue >= nint_t . MaxValue ) ? unchecked ( ( nint ) nint_t . MaxValue ) :
1075
1084
( actualValue <= nint_t . MinValue ) ? unchecked ( ( nint ) nint_t . MinValue ) : ( nint ) actualValue ;
1085
+ #else
1086
+ result = ( nint ) actualValue ;
1087
+ #endif
1076
1088
return true ;
1077
1089
}
1078
1090
else if ( typeof ( TOther ) == typeof ( Half ) )
@@ -1115,8 +1127,12 @@ private static bool TryConvertFromTruncating<TOther>(TOther value, out nint resu
1115
1127
else if ( typeof ( TOther ) == typeof ( float ) )
1116
1128
{
1117
1129
float actualValue = ( float ) ( object ) value ;
1130
+ #if MONO
1118
1131
result = ( actualValue >= nint_t . MaxValue ) ? unchecked ( ( nint ) nint_t . MaxValue ) :
1119
1132
( actualValue <= nint_t . MinValue ) ? unchecked ( ( nint ) nint_t . MinValue ) : ( nint ) actualValue ;
1133
+ #else
1134
+ result = ( nint ) actualValue ;
1135
+ #endif
1120
1136
return true ;
1121
1137
}
1122
1138
else
0 commit comments