File tree Expand file tree Collapse file tree 1 file changed +15
-2
lines changed Expand file tree Collapse file tree 1 file changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -1153,7 +1153,7 @@ struct BigUIntView(W, WordEndian endian = TargetEndian)
11531153 bool opEquals (ulong rhs)
11541154 @safe pure nothrow @nogc const scope
11551155 {
1156- foreach_reverse (d; lightConst.leastSignificantFirst)
1156+ foreach (d; lightConst.leastSignificantFirst)
11571157 {
11581158 static if (W.sizeof >= ulong .sizeof)
11591159 {
@@ -1171,6 +1171,20 @@ struct BigUIntView(W, WordEndian endian = TargetEndian)
11711171 return rhs == 0 ;
11721172 }
11731173
1174+ static if (W.sizeof == size_t .sizeof && endian == TargetEndian)
1175+ // /
1176+ version (mir_bignum_test)
1177+ @safe pure
1178+ unittest
1179+ {
1180+ auto view2 = BigUIntView! (const (ubyte ), WordEndian.big)([1 , 0 ]);
1181+ assert (view2 == 256 ); // false
1182+ assert (cast (ulong )view2 == 256 ); // true
1183+ auto view = BigUIntView! (const (ubyte ), WordEndian.big)([15 , 255 , 255 ]);
1184+ assert (view == 1048575 ); // false
1185+ assert (cast (ulong )view == 1048575 ); // true
1186+ }
1187+
11741188 static if (isMutable! W && W.sizeof >= 4 )
11751189 /+ +
11761190 Params:
@@ -1208,7 +1222,6 @@ struct BigUIntView(W, WordEndian endian = TargetEndian)
12081222 return str.length - i;
12091223 }
12101224
1211- // /
12121225 static if (W.sizeof == size_t .sizeof && endian == TargetEndian)
12131226 // /
12141227 version (mir_bignum_test)
You can’t perform that action at this time.
0 commit comments