@@ -1025,10 +1025,94 @@ static int test_0_nfloat_cmp_right_nan ()
10251025 return 0 ;
10261026 }
10271027
1028+ static int test_0_nfloat_isinfinity ( )
1029+ {
1030+ var x = ( nfloat ) float . NaN ;
1031+ if ( nfloat . IsInfinity ( x ) )
1032+ return 1 ;
1033+ if ( nfloat . IsInfinity ( 12 ) )
1034+ return 2 ;
1035+ if ( ! nfloat . IsInfinity ( nfloat . PositiveInfinity ) )
1036+ return 3 ;
1037+ if ( ! nfloat . IsInfinity ( nfloat . NegativeInfinity ) )
1038+ return 4 ;
1039+
1040+ return 0 ;
1041+ }
1042+
1043+ static int test_0_nfloat_isnegativeinfinity ( )
1044+ {
1045+ var x = ( nfloat ) float . NaN ;
1046+ if ( nfloat . IsNegativeInfinity ( x ) )
1047+ return 1 ;
1048+ if ( nfloat . IsNegativeInfinity ( 12 ) )
1049+ return 2 ;
1050+ if ( nfloat . IsNegativeInfinity ( nfloat . PositiveInfinity ) )
1051+ return 3 ;
1052+ if ( ! nfloat . IsNegativeInfinity ( nfloat . NegativeInfinity ) )
1053+ return 4 ;
1054+
1055+ float f = float . NegativeInfinity ;
1056+ nfloat n = ( nfloat ) f ;
1057+ if ( ! nfloat . IsNegativeInfinity ( n ) )
1058+ return 5 ;
1059+
1060+ double d = double . NegativeInfinity ;
1061+ n = ( nfloat ) d ;
1062+ if ( ! nfloat . IsNegativeInfinity ( n ) )
1063+ return 6 ;
1064+
1065+ return 0 ;
1066+ }
1067+
1068+ static int test_0_nfloat_ispositiveinfinity ( )
1069+ {
1070+ var x = ( nfloat ) float . NaN ;
1071+ if ( nfloat . IsPositiveInfinity ( x ) )
1072+ return 1 ;
1073+ if ( nfloat . IsPositiveInfinity ( 12 ) )
1074+ return 2 ;
1075+ if ( ! nfloat . IsPositiveInfinity ( nfloat . PositiveInfinity ) )
1076+ return 3 ;
1077+ if ( nfloat . IsPositiveInfinity ( nfloat . NegativeInfinity ) )
1078+ return 4 ;
1079+
1080+ float f = float . PositiveInfinity ;
1081+ nfloat n = ( nfloat ) f ;
1082+ if ( ! nfloat . IsPositiveInfinity ( n ) )
1083+ return 5 ;
1084+
1085+ double d = double . PositiveInfinity ;
1086+ n = ( nfloat ) d ;
1087+ if ( ! nfloat . IsPositiveInfinity ( n ) )
1088+ return 6 ;
1089+
1090+ return 0 ;
1091+ }
1092+
10281093 static int test_0_nfloat_isnan ( )
10291094 {
10301095 var x = ( nfloat ) float . NaN ;
1031- return nfloat . IsNaN ( x ) ? 0 : 1 ;
1096+ if ( ! nfloat . IsNaN ( x ) )
1097+ return 1 ;
1098+ if ( nfloat . IsNaN ( 12 ) )
1099+ return 2 ;
1100+ if ( nfloat . IsNaN ( nfloat . PositiveInfinity ) )
1101+ return 3 ;
1102+ if ( nfloat . IsNaN ( nfloat . NegativeInfinity ) )
1103+ return 4 ;
1104+
1105+ float f = float . NaN ;
1106+ nfloat n = ( nfloat ) f ;
1107+ if ( ! nfloat . IsNaN ( n ) )
1108+ return 5 ;
1109+
1110+ double d = double . NaN ;
1111+ n = ( nfloat ) d ;
1112+ if ( ! nfloat . IsNaN ( n ) )
1113+ return 6 ;
1114+
1115+ return 0 ;
10321116 }
10331117
10341118 static int test_0_nfloat_compareto ( )
0 commit comments