Skip to content

Commit 25db8d2

Browse files
committed
core: Use the same width for integer primitive literals in docs
It's a bit easier to understand the results of shifts and otherwise bitwise operations when leading zeros are present.
1 parent 95682e5 commit 25db8d2

1 file changed

Lines changed: 123 additions & 123 deletions

File tree

library/core/src/num/mod.rs

Lines changed: 123 additions & 123 deletions
Original file line numberDiff line numberDiff line change
@@ -347,11 +347,11 @@ impl i8 {
347347
Min = -128,
348348
Max = 127,
349349
rot = 2,
350-
rot_op = "-0x7e",
351-
rot_result = "0xa",
352-
swap_op = "0x12",
353-
swapped = "0x12",
354-
reversed = "0x48",
350+
rot_op = "-0x7e",
351+
rot_result = "0x0a",
352+
swap_op = "0x12",
353+
swapped = "0x12",
354+
reversed = "0x48",
355355
le_bytes = "[0x12]",
356356
be_bytes = "[0x12]",
357357
to_xe_bytes_doc = i8_xe_bytes_doc!(),
@@ -371,11 +371,11 @@ impl i16 {
371371
Min = -32768,
372372
Max = 32767,
373373
rot = 4,
374-
rot_op = "-0x5ffd",
375-
rot_result = "0x3a",
376-
swap_op = "0x1234",
377-
swapped = "0x3412",
378-
reversed = "0x2c48",
374+
rot_op = "-0x5ffd",
375+
rot_result = "0x003a",
376+
swap_op = "0x1234",
377+
swapped = "0x3412",
378+
reversed = "0x2c48",
379379
le_bytes = "[0x34, 0x12]",
380380
be_bytes = "[0x12, 0x34]",
381381
to_xe_bytes_doc = "",
@@ -395,11 +395,11 @@ impl i32 {
395395
Min = -2147483648,
396396
Max = 2147483647,
397397
rot = 8,
398-
rot_op = "0x10000b3",
399-
rot_result = "0xb301",
400-
swap_op = "0x12345678",
401-
swapped = "0x78563412",
402-
reversed = "0x1e6a2c48",
398+
rot_op = "0x010000b3",
399+
rot_result = "0x0000b301",
400+
swap_op = "0x12345678",
401+
swapped = "0x78563412",
402+
reversed = "0x1e6a2c48",
403403
le_bytes = "[0x78, 0x56, 0x34, 0x12]",
404404
be_bytes = "[0x12, 0x34, 0x56, 0x78]",
405405
to_xe_bytes_doc = "",
@@ -419,11 +419,11 @@ impl i64 {
419419
Min = -9223372036854775808,
420420
Max = 9223372036854775807,
421421
rot = 12,
422-
rot_op = "0xaa00000000006e1",
423-
rot_result = "0x6e10aa",
424-
swap_op = "0x1234567890123456",
425-
swapped = "0x5634129078563412",
426-
reversed = "0x6a2c48091e6a2c48",
422+
rot_op = "0x0aa00000000006e1",
423+
rot_result = "0x00000000006e10aa",
424+
swap_op = "0x1234567890123456",
425+
swapped = "0x5634129078563412",
426+
reversed = "0x6a2c48091e6a2c48",
427427
le_bytes = "[0x56, 0x34, 0x12, 0x90, 0x78, 0x56, 0x34, 0x12]",
428428
be_bytes = "[0x12, 0x34, 0x56, 0x78, 0x90, 0x12, 0x34, 0x56]",
429429
to_xe_bytes_doc = "",
@@ -443,11 +443,11 @@ impl i128 {
443443
Min = -170141183460469231731687303715884105728,
444444
Max = 170141183460469231731687303715884105727,
445445
rot = 16,
446-
rot_op = "0x13f40000000000000000000000004f76",
447-
rot_result = "0x4f7613f4",
448-
swap_op = "0x12345678901234567890123456789012",
449-
swapped = "0x12907856341290785634129078563412",
450-
reversed = "0x48091e6a2c48091e6a2c48091e6a2c48",
446+
rot_op = "0x13f40000000000000000000000004f76",
447+
rot_result = "0x0000000000000000000000004f7613f4",
448+
swap_op = "0x12345678901234567890123456789012",
449+
swapped = "0x12907856341290785634129078563412",
450+
reversed = "0x48091e6a2c48091e6a2c48091e6a2c48",
451451
le_bytes = "[0x12, 0x90, 0x78, 0x56, 0x34, 0x12, 0x90, 0x78, \
452452
0x56, 0x34, 0x12, 0x90, 0x78, 0x56, 0x34, 0x12]",
453453
be_bytes = "[0x12, 0x34, 0x56, 0x78, 0x90, 0x12, 0x34, 0x56, \
@@ -470,11 +470,11 @@ impl isize {
470470
Min = -32768,
471471
Max = 32767,
472472
rot = 4,
473-
rot_op = "-0x5ffd",
474-
rot_result = "0x3a",
475-
swap_op = "0x1234",
476-
swapped = "0x3412",
477-
reversed = "0x2c48",
473+
rot_op = "-0x5ffd",
474+
rot_result = "0x003a",
475+
swap_op = "0x1234",
476+
swapped = "0x3412",
477+
reversed = "0x2c48",
478478
le_bytes = "[0x34, 0x12]",
479479
be_bytes = "[0x12, 0x34]",
480480
to_xe_bytes_doc = usize_isize_to_xe_bytes_doc!(),
@@ -495,11 +495,11 @@ impl isize {
495495
Min = -2147483648,
496496
Max = 2147483647,
497497
rot = 8,
498-
rot_op = "0x10000b3",
499-
rot_result = "0xb301",
500-
swap_op = "0x12345678",
501-
swapped = "0x78563412",
502-
reversed = "0x1e6a2c48",
498+
rot_op = "0x010000b3",
499+
rot_result = "0x0000b301",
500+
swap_op = "0x12345678",
501+
swapped = "0x78563412",
502+
reversed = "0x1e6a2c48",
503503
le_bytes = "[0x78, 0x56, 0x34, 0x12]",
504504
be_bytes = "[0x12, 0x34, 0x56, 0x78]",
505505
to_xe_bytes_doc = usize_isize_to_xe_bytes_doc!(),
@@ -520,11 +520,11 @@ impl isize {
520520
Min = -9223372036854775808,
521521
Max = 9223372036854775807,
522522
rot = 12,
523-
rot_op = "0xaa00000000006e1",
524-
rot_result = "0x6e10aa",
525-
swap_op = "0x1234567890123456",
526-
swapped = "0x5634129078563412",
527-
reversed = "0x6a2c48091e6a2c48",
523+
rot_op = "0x0aa00000000006e1",
524+
rot_result = "0x00000000006e10aa",
525+
swap_op = "0x1234567890123456",
526+
swapped = "0x5634129078563412",
527+
reversed = "0x6a2c48091e6a2c48",
528528
le_bytes = "[0x56, 0x34, 0x12, 0x90, 0x78, 0x56, 0x34, 0x12]",
529529
be_bytes = "[0x12, 0x34, 0x56, 0x78, 0x90, 0x12, 0x34, 0x56]",
530530
to_xe_bytes_doc = usize_isize_to_xe_bytes_doc!(),
@@ -546,17 +546,17 @@ impl u8 {
546546
BITS_MINUS_ONE = 7,
547547
MAX = 255,
548548
rot = 2,
549-
rot_op = "0x82",
550-
rot_result = "0xa",
551-
fsh_op = "0x36",
552-
fshl_result = "0x8",
553-
fshr_result = "0x8d",
554-
clmul_lhs = "0x12",
555-
clmul_rhs = "0x34",
549+
rot_op = "0x82",
550+
rot_result = "0x0a",
551+
fsh_op = "0x36",
552+
fshl_result = "0x08",
553+
fshr_result = "0x8d",
554+
clmul_lhs = "0x12",
555+
clmul_rhs = "0x34",
556556
clmul_result = "0x28",
557-
swap_op = "0x12",
558-
swapped = "0x12",
559-
reversed = "0x48",
557+
swap_op = "0x12",
558+
swapped = "0x12",
559+
reversed = "0x48",
560560
le_bytes = "[0x12]",
561561
be_bytes = "[0x12]",
562562
to_xe_bytes_doc = u8_xe_bytes_doc!(),
@@ -1188,17 +1188,17 @@ impl u16 {
11881188
BITS_MINUS_ONE = 15,
11891189
MAX = 65535,
11901190
rot = 4,
1191-
rot_op = "0xa003",
1192-
rot_result = "0x3a",
1193-
fsh_op = "0x2de",
1194-
fshl_result = "0x30",
1195-
fshr_result = "0x302d",
1196-
clmul_lhs = "0x9012",
1197-
clmul_rhs = "0xcd34",
1198-
clmul_result = "0x928",
1199-
swap_op = "0x1234",
1200-
swapped = "0x3412",
1201-
reversed = "0x2c48",
1191+
rot_op = "0xa003",
1192+
rot_result = "0x003a",
1193+
fsh_op = "0x02de",
1194+
fshl_result = "0x0030",
1195+
fshr_result = "0x302d",
1196+
clmul_lhs = "0x9012",
1197+
clmul_rhs = "0xcd34",
1198+
clmul_result = "0x0928",
1199+
swap_op = "0x1234",
1200+
swapped = "0x3412",
1201+
reversed = "0x2c48",
12021202
le_bytes = "[0x34, 0x12]",
12031203
be_bytes = "[0x12, 0x34]",
12041204
to_xe_bytes_doc = "",
@@ -1243,17 +1243,17 @@ impl u32 {
12431243
BITS_MINUS_ONE = 31,
12441244
MAX = 4294967295,
12451245
rot = 8,
1246-
rot_op = "0x10000b3",
1247-
rot_result = "0xb301",
1248-
fsh_op = "0x2fe78e45",
1249-
fshl_result = "0xb32f",
1250-
fshr_result = "0xb32fe78e",
1251-
clmul_lhs = "0x56789012",
1252-
clmul_rhs = "0xf52ecd34",
1246+
rot_op = "0x010000b3",
1247+
rot_result = "0x0000b301",
1248+
fsh_op = "0x2fe78e45",
1249+
fshl_result = "0x0000b32f",
1250+
fshr_result = "0xb32fe78e",
1251+
clmul_lhs = "0x56789012",
1252+
clmul_rhs = "0xf52ecd34",
12531253
clmul_result = "0x9b980928",
1254-
swap_op = "0x12345678",
1255-
swapped = "0x78563412",
1256-
reversed = "0x1e6a2c48",
1254+
swap_op = "0x12345678",
1255+
swapped = "0x78563412",
1256+
reversed = "0x1e6a2c48",
12571257
le_bytes = "[0x78, 0x56, 0x34, 0x12]",
12581258
be_bytes = "[0x12, 0x34, 0x56, 0x78]",
12591259
to_xe_bytes_doc = "",
@@ -1274,17 +1274,17 @@ impl u64 {
12741274
BITS_MINUS_ONE = 63,
12751275
MAX = 18446744073709551615,
12761276
rot = 12,
1277-
rot_op = "0xaa00000000006e1",
1278-
rot_result = "0x6e10aa",
1279-
fsh_op = "0x2fe78e45983acd98",
1280-
fshl_result = "0x6e12fe",
1281-
fshr_result = "0x6e12fe78e45983ac",
1282-
clmul_lhs = "0x7890123456789012",
1283-
clmul_rhs = "0xdd358416f52ecd34",
1284-
clmul_result = "0xa6299579b980928",
1285-
swap_op = "0x1234567890123456",
1286-
swapped = "0x5634129078563412",
1287-
reversed = "0x6a2c48091e6a2c48",
1277+
rot_op = "0x0aa00000000006e1",
1278+
rot_result = "0x00000000006e10aa",
1279+
fsh_op = "0x2fe78e45983acd98",
1280+
fshl_result = "0x00000000006e12fe",
1281+
fshr_result = "0x6e12fe78e45983ac",
1282+
clmul_lhs = "0x7890123456789012",
1283+
clmul_rhs = "0xdd358416f52ecd34",
1284+
clmul_result = "0x0a6299579b980928",
1285+
swap_op = "0x1234567890123456",
1286+
swapped = "0x5634129078563412",
1287+
reversed = "0x6a2c48091e6a2c48",
12881288
le_bytes = "[0x56, 0x34, 0x12, 0x90, 0x78, 0x56, 0x34, 0x12]",
12891289
be_bytes = "[0x12, 0x34, 0x56, 0x78, 0x90, 0x12, 0x34, 0x56]",
12901290
to_xe_bytes_doc = "",
@@ -1305,17 +1305,17 @@ impl u128 {
13051305
BITS_MINUS_ONE = 127,
13061306
MAX = 340282366920938463463374607431768211455,
13071307
rot = 16,
1308-
rot_op = "0x13f40000000000000000000000004f76",
1309-
rot_result = "0x4f7613f4",
1310-
fsh_op = "0x2fe78e45983acd98039000008736273",
1311-
fshl_result = "0x4f7602fe",
1312-
fshr_result = "0x4f7602fe78e45983acd9803900000873",
1313-
clmul_lhs = "0x12345678901234567890123456789012",
1314-
clmul_rhs = "0x4317e40ab4ddcf05dd358416f52ecd34",
1308+
rot_op = "0x13f40000000000000000000000004f76",
1309+
rot_result = "0x0000000000000000000000004f7613f4",
1310+
fsh_op = "0x02fe78e45983acd98039000008736273",
1311+
fshl_result = "0x0000000000000000000000004f7602fe",
1312+
fshr_result = "0x4f7602fe78e45983acd9803900000873",
1313+
clmul_lhs = "0x12345678901234567890123456789012",
1314+
clmul_rhs = "0x4317e40ab4ddcf05dd358416f52ecd34",
13151315
clmul_result = "0xb9cf660de35d0c170a6299579b980928",
1316-
swap_op = "0x12345678901234567890123456789012",
1317-
swapped = "0x12907856341290785634129078563412",
1318-
reversed = "0x48091e6a2c48091e6a2c48091e6a2c48",
1316+
swap_op = "0x12345678901234567890123456789012",
1317+
swapped = "0x12907856341290785634129078563412",
1318+
reversed = "0x48091e6a2c48091e6a2c48091e6a2c48",
13191319
le_bytes = "[0x12, 0x90, 0x78, 0x56, 0x34, 0x12, 0x90, 0x78, \
13201320
0x56, 0x34, 0x12, 0x90, 0x78, 0x56, 0x34, 0x12]",
13211321
be_bytes = "[0x12, 0x34, 0x56, 0x78, 0x90, 0x12, 0x34, 0x56, \
@@ -1338,17 +1338,17 @@ impl usize {
13381338
BITS_MINUS_ONE = 15,
13391339
MAX = 65535,
13401340
rot = 4,
1341-
rot_op = "0xa003",
1342-
rot_result = "0x3a",
1343-
fsh_op = "0x2de",
1344-
fshl_result = "0x30",
1345-
fshr_result = "0x302d",
1346-
clmul_lhs = "0x9012",
1347-
clmul_rhs = "0xcd34",
1348-
clmul_result = "0x928",
1349-
swap_op = "0x1234",
1350-
swapped = "0x3412",
1351-
reversed = "0x2c48",
1341+
rot_op = "0xa003",
1342+
rot_result = "0x003a",
1343+
fsh_op = "0x02de",
1344+
fshl_result = "0x0030",
1345+
fshr_result = "0x302d",
1346+
clmul_lhs = "0x9012",
1347+
clmul_rhs = "0xcd34",
1348+
clmul_result = "0x0928",
1349+
swap_op = "0x1234",
1350+
swapped = "0x3412",
1351+
reversed = "0x2c48",
13521352
le_bytes = "[0x34, 0x12]",
13531353
be_bytes = "[0x12, 0x34]",
13541354
to_xe_bytes_doc = usize_isize_to_xe_bytes_doc!(),
@@ -1369,17 +1369,17 @@ impl usize {
13691369
BITS_MINUS_ONE = 31,
13701370
MAX = 4294967295,
13711371
rot = 8,
1372-
rot_op = "0x10000b3",
1373-
rot_result = "0xb301",
1374-
fsh_op = "0x2fe78e45",
1375-
fshl_result = "0xb32f",
1376-
fshr_result = "0xb32fe78e",
1377-
clmul_lhs = "0x56789012",
1378-
clmul_rhs = "0xf52ecd34",
1372+
rot_op = "0x010000b3",
1373+
rot_result = "0x0000b301",
1374+
fsh_op = "0x2fe78e45",
1375+
fshl_result = "0x0000b32f",
1376+
fshr_result = "0xb32fe78e",
1377+
clmul_lhs = "0x56789012",
1378+
clmul_rhs = "0xf52ecd34",
13791379
clmul_result = "0x9b980928",
1380-
swap_op = "0x12345678",
1381-
swapped = "0x78563412",
1382-
reversed = "0x1e6a2c48",
1380+
swap_op = "0x12345678",
1381+
swapped = "0x78563412",
1382+
reversed = "0x1e6a2c48",
13831383
le_bytes = "[0x78, 0x56, 0x34, 0x12]",
13841384
be_bytes = "[0x12, 0x34, 0x56, 0x78]",
13851385
to_xe_bytes_doc = usize_isize_to_xe_bytes_doc!(),
@@ -1400,17 +1400,17 @@ impl usize {
14001400
BITS_MINUS_ONE = 63,
14011401
MAX = 18446744073709551615,
14021402
rot = 12,
1403-
rot_op = "0xaa00000000006e1",
1404-
rot_result = "0x6e10aa",
1405-
fsh_op = "0x2fe78e45983acd98",
1406-
fshl_result = "0x6e12fe",
1407-
fshr_result = "0x6e12fe78e45983ac",
1408-
clmul_lhs = "0x7890123456789012",
1409-
clmul_rhs = "0xdd358416f52ecd34",
1403+
rot_op = "0x0aa00000000006e1",
1404+
rot_result = "0x00000000006e10aa",
1405+
fsh_op = "0x2fe78e45983acd98",
1406+
fshl_result = "0x00000000006e12fe",
1407+
fshr_result = "0x6e12fe78e45983ac",
1408+
clmul_lhs = "0x7890123456789012",
1409+
clmul_rhs = "0xdd358416f52ecd34",
14101410
clmul_result = "0xa6299579b980928",
1411-
swap_op = "0x1234567890123456",
1412-
swapped = "0x5634129078563412",
1413-
reversed = "0x6a2c48091e6a2c48",
1411+
swap_op = "0x1234567890123456",
1412+
swapped = "0x5634129078563412",
1413+
reversed = "0x6a2c48091e6a2c48",
14141414
le_bytes = "[0x56, 0x34, 0x12, 0x90, 0x78, 0x56, 0x34, 0x12]",
14151415
be_bytes = "[0x12, 0x34, 0x56, 0x78, 0x90, 0x12, 0x34, 0x56]",
14161416
to_xe_bytes_doc = usize_isize_to_xe_bytes_doc!(),

0 commit comments

Comments
 (0)