summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/generic/xint/xint.dtx
blob: 3b98f70703cc9eb255af5a64b713daae48cf58d6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825
3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894
3895
3896
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
3907
3908
3909
3910
3911
3912
3913
3914
3915
3916
3917
3918
3919
3920
3921
3922
3923
3924
3925
3926
3927
3928
3929
3930
3931
3932
3933
3934
3935
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
4017
4018
4019
4020
4021
4022
4023
4024
4025
4026
4027
4028
4029
4030
4031
4032
4033
4034
4035
4036
4037
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
4057
4058
4059
4060
4061
4062
4063
4064
4065
4066
4067
4068
4069
4070
4071
4072
4073
4074
4075
4076
4077
4078
4079
4080
4081
4082
4083
4084
4085
4086
4087
4088
4089
4090
4091
4092
4093
4094
4095
4096
4097
4098
4099
4100
4101
4102
4103
4104
4105
4106
4107
4108
4109
4110
4111
4112
4113
4114
4115
4116
4117
4118
4119
4120
4121
4122
4123
4124
4125
4126
4127
4128
4129
4130
4131
4132
4133
4134
4135
4136
4137
4138
4139
4140
4141
4142
4143
4144
4145
4146
4147
4148
4149
4150
4151
4152
4153
4154
4155
4156
4157
4158
4159
4160
4161
4162
4163
4164
4165
4166
4167
4168
4169
4170
4171
4172
4173
4174
4175
4176
4177
4178
4179
4180
4181
4182
4183
4184
4185
4186
4187
4188
4189
4190
4191
4192
4193
4194
4195
4196
4197
4198
4199
4200
4201
4202
4203
4204
4205
4206
4207
4208
4209
4210
4211
4212
4213
4214
4215
4216
4217
4218
4219
4220
4221
4222
4223
4224
4225
4226
4227
4228
4229
4230
4231
4232
4233
4234
4235
4236
4237
4238
4239
4240
4241
4242
4243
4244
4245
4246
4247
4248
4249
4250
4251
4252
4253
4254
4255
4256
4257
4258
4259
4260
4261
4262
4263
4264
4265
4266
4267
4268
4269
4270
4271
4272
4273
4274
4275
4276
4277
4278
4279
4280
4281
4282
4283
4284
4285
4286
4287
4288
4289
4290
4291
4292
4293
4294
4295
4296
4297
4298
4299
4300
4301
4302
4303
4304
4305
4306
4307
4308
4309
4310
4311
4312
4313
4314
4315
4316
4317
4318
4319
4320
4321
4322
4323
4324
4325
4326
4327
4328
4329
4330
4331
4332
4333
4334
4335
4336
4337
4338
4339
4340
4341
4342
4343
4344
4345
4346
4347
4348
4349
4350
4351
4352
4353
4354
4355
4356
4357
4358
4359
4360
4361
4362
4363
4364
4365
4366
4367
4368
4369
4370
4371
4372
4373
4374
4375
4376
4377
4378
4379
4380
4381
4382
4383
4384
4385
4386
4387
4388
4389
4390
4391
4392
4393
4394
4395
4396
4397
4398
4399
4400
4401
4402
4403
4404
4405
4406
4407
4408
4409
4410
4411
4412
4413
4414
4415
4416
4417
4418
4419
4420
4421
4422
4423
4424
4425
4426
4427
4428
4429
4430
4431
4432
4433
4434
4435
4436
4437
4438
4439
4440
4441
4442
4443
4444
4445
4446
4447
4448
4449
4450
4451
4452
4453
4454
4455
4456
4457
4458
4459
4460
4461
4462
4463
4464
4465
4466
4467
4468
4469
4470
4471
4472
4473
4474
4475
4476
4477
4478
4479
4480
4481
4482
4483
4484
4485
4486
4487
4488
4489
4490
4491
4492
4493
4494
4495
4496
4497
4498
4499
4500
4501
4502
4503
4504
4505
4506
4507
4508
4509
4510
4511
4512
4513
4514
4515
4516
4517
4518
4519
4520
4521
4522
4523
4524
4525
4526
4527
4528
4529
4530
4531
4532
4533
4534
4535
4536
4537
4538
4539
4540
4541
4542
4543
4544
4545
4546
4547
4548
4549
4550
4551
4552
4553
4554
4555
4556
4557
4558
4559
4560
4561
4562
4563
4564
4565
4566
4567
4568
4569
4570
4571
4572
4573
4574
4575
4576
4577
4578
4579
4580
4581
4582
4583
4584
4585
4586
4587
4588
4589
4590
4591
4592
4593
4594
4595
4596
4597
4598
4599
4600
4601
4602
4603
4604
4605
4606
4607
4608
4609
4610
4611
4612
4613
4614
4615
4616
4617
4618
4619
4620
4621
4622
4623
4624
4625
4626
4627
4628
4629
4630
4631
4632
4633
4634
4635
4636
4637
4638
4639
4640
4641
4642
4643
4644
4645
4646
4647
4648
4649
4650
4651
4652
4653
4654
4655
4656
4657
4658
4659
4660
4661
4662
4663
4664
4665
4666
4667
4668
4669
4670
4671
4672
4673
4674
4675
4676
4677
4678
4679
4680
4681
4682
4683
4684
4685
4686
4687
4688
4689
4690
4691
4692
4693
4694
4695
4696
4697
4698
4699
4700
4701
4702
4703
4704
4705
4706
4707
4708
4709
4710
4711
4712
4713
4714
4715
4716
4717
4718
4719
4720
4721
4722
4723
4724
4725
4726
4727
4728
4729
4730
4731
4732
4733
4734
4735
4736
4737
4738
4739
4740
4741
4742
4743
4744
4745
4746
4747
4748
4749
4750
4751
4752
4753
4754
4755
4756
4757
4758
4759
4760
4761
4762
4763
4764
4765
4766
4767
4768
4769
4770
4771
4772
4773
4774
4775
4776
4777
4778
4779
4780
4781
4782
4783
4784
4785
4786
4787
4788
4789
4790
4791
4792
4793
4794
4795
4796
4797
4798
4799
4800
4801
4802
4803
4804
4805
4806
4807
4808
4809
4810
4811
4812
4813
4814
4815
4816
4817
4818
4819
4820
4821
4822
4823
4824
4825
4826
4827
4828
4829
4830
4831
4832
4833
4834
4835
4836
4837
4838
4839
4840
4841
4842
4843
4844
4845
4846
4847
4848
4849
4850
4851
4852
4853
4854
4855
4856
4857
4858
4859
4860
4861
4862
4863
4864
4865
4866
4867
4868
4869
4870
4871
4872
4873
4874
4875
4876
4877
4878
4879
4880
4881
4882
4883
4884
4885
4886
4887
4888
4889
4890
4891
4892
4893
4894
4895
4896
4897
4898
4899
4900
4901
4902
4903
4904
4905
4906
4907
4908
4909
4910
4911
4912
4913
4914
4915
4916
4917
4918
4919
4920
4921
4922
4923
4924
4925
4926
4927
4928
4929
4930
4931
4932
4933
4934
4935
4936
4937
4938
4939
4940
4941
4942
4943
4944
4945
4946
4947
4948
4949
4950
4951
4952
4953
4954
4955
4956
4957
4958
4959
4960
4961
4962
4963
4964
4965
4966
4967
4968
4969
4970
4971
4972
4973
4974
4975
4976
4977
4978
4979
4980
4981
4982
4983
4984
4985
4986
4987
4988
4989
4990
4991
4992
4993
4994
4995
4996
4997
4998
4999
5000
5001
5002
5003
5004
5005
5006
5007
5008
5009
5010
5011
5012
5013
5014
5015
5016
5017
5018
5019
5020
5021
5022
5023
5024
5025
5026
5027
5028
5029
5030
5031
5032
5033
5034
5035
5036
5037
5038
5039
5040
5041
5042
5043
5044
5045
5046
5047
5048
5049
5050
5051
5052
5053
5054
5055
5056
5057
5058
5059
5060
5061
5062
5063
5064
5065
5066
5067
5068
5069
5070
5071
5072
5073
5074
5075
5076
5077
5078
5079
5080
5081
5082
5083
5084
5085
5086
5087
5088
5089
5090
5091
5092
5093
5094
5095
5096
5097
5098
5099
5100
5101
5102
5103
5104
5105
5106
5107
5108
5109
5110
5111
5112
5113
5114
5115
5116
5117
5118
5119
5120
5121
5122
5123
5124
5125
5126
5127
5128
5129
5130
5131
5132
5133
5134
5135
5136
5137
5138
5139
5140
5141
5142
5143
5144
5145
5146
5147
5148
5149
5150
5151
5152
5153
5154
5155
5156
5157
5158
5159
5160
5161
5162
5163
5164
5165
5166
5167
5168
5169
5170
5171
5172
5173
5174
5175
5176
5177
5178
5179
5180
5181
5182
5183
5184
5185
5186
5187
5188
5189
5190
5191
5192
5193
5194
5195
5196
5197
5198
5199
5200
5201
5202
5203
5204
5205
5206
5207
5208
5209
5210
5211
5212
5213
5214
5215
5216
5217
5218
5219
5220
5221
5222
5223
5224
5225
5226
5227
5228
5229
5230
5231
5232
5233
5234
5235
5236
5237
5238
5239
5240
5241
5242
5243
5244
5245
5246
5247
5248
5249
5250
5251
5252
5253
5254
5255
5256
5257
5258
5259
5260
5261
5262
5263
5264
5265
5266
5267
5268
5269
5270
5271
5272
5273
5274
5275
5276
5277
5278
5279
5280
5281
5282
5283
5284
5285
5286
5287
5288
5289
5290
5291
5292
5293
5294
5295
5296
5297
5298
5299
5300
5301
5302
5303
5304
5305
5306
5307
5308
5309
5310
5311
5312
5313
5314
5315
5316
5317
5318
5319
5320
5321
5322
5323
5324
5325
5326
5327
5328
5329
5330
5331
5332
5333
5334
5335
5336
5337
5338
5339
5340
5341
5342
5343
5344
5345
5346
5347
5348
5349
5350
5351
5352
5353
5354
5355
5356
5357
5358
5359
5360
5361
5362
5363
5364
5365
5366
5367
5368
5369
5370
5371
5372
5373
5374
5375
5376
5377
5378
5379
5380
5381
5382
5383
5384
5385
5386
5387
5388
5389
5390
5391
5392
5393
5394
5395
5396
5397
5398
5399
5400
5401
5402
5403
5404
5405
5406
5407
5408
5409
5410
5411
5412
5413
5414
5415
5416
5417
5418
5419
5420
5421
5422
5423
5424
5425
5426
5427
5428
5429
5430
5431
5432
5433
5434
5435
5436
5437
5438
5439
5440
5441
5442
5443
5444
5445
5446
5447
5448
5449
5450
5451
5452
5453
5454
5455
5456
5457
5458
5459
5460
5461
5462
5463
5464
5465
5466
5467
5468
5469
5470
5471
5472
5473
5474
5475
5476
5477
5478
5479
5480
5481
5482
5483
5484
5485
5486
5487
5488
5489
5490
5491
5492
5493
5494
5495
5496
5497
5498
5499
5500
5501
5502
5503
5504
5505
5506
5507
5508
5509
5510
5511
5512
5513
5514
5515
5516
5517
5518
5519
5520
5521
5522
5523
5524
5525
5526
5527
5528
5529
5530
5531
5532
5533
5534
5535
5536
5537
5538
5539
5540
5541
5542
5543
5544
5545
5546
5547
5548
5549
5550
5551
5552
5553
5554
5555
5556
5557
5558
5559
5560
5561
5562
5563
5564
5565
5566
5567
5568
5569
5570
5571
5572
5573
5574
5575
5576
5577
5578
5579
5580
5581
5582
5583
5584
5585
5586
5587
5588
5589
5590
5591
5592
5593
5594
5595
5596
5597
5598
5599
5600
5601
5602
5603
5604
5605
5606
5607
5608
5609
5610
5611
5612
5613
5614
5615
5616
5617
5618
5619
5620
5621
5622
5623
5624
5625
5626
5627
5628
5629
5630
5631
5632
5633
5634
5635
5636
5637
5638
5639
5640
5641
5642
5643
5644
5645
5646
5647
5648
5649
5650
5651
5652
5653
5654
5655
5656
5657
5658
5659
5660
5661
5662
5663
5664
5665
5666
5667
5668
5669
5670
5671
5672
5673
5674
5675
5676
5677
5678
5679
5680
5681
5682
5683
5684
5685
5686
5687
5688
5689
5690
5691
5692
5693
5694
5695
5696
5697
5698
5699
5700
5701
5702
5703
5704
5705
5706
5707
5708
5709
5710
5711
5712
5713
5714
5715
5716
5717
5718
5719
5720
5721
5722
5723
5724
5725
5726
5727
5728
5729
5730
5731
5732
5733
5734
5735
5736
5737
5738
5739
5740
5741
5742
5743
5744
5745
5746
5747
5748
5749
5750
5751
5752
5753
5754
5755
5756
5757
5758
5759
5760
5761
5762
5763
5764
5765
5766
5767
5768
5769
5770
5771
5772
5773
5774
5775
5776
5777
5778
5779
5780
5781
5782
5783
5784
5785
5786
5787
5788
5789
5790
5791
5792
5793
5794
5795
5796
5797
5798
5799
5800
5801
5802
5803
5804
5805
5806
5807
5808
5809
5810
5811
5812
5813
5814
5815
5816
5817
5818
5819
5820
5821
5822
5823
5824
5825
5826
5827
5828
5829
5830
5831
5832
5833
5834
5835
5836
5837
5838
5839
5840
5841
5842
5843
5844
5845
5846
5847
5848
5849
5850
5851
5852
5853
5854
5855
5856
5857
5858
5859
5860
5861
5862
5863
5864
5865
5866
5867
5868
5869
5870
5871
5872
5873
5874
5875
5876
5877
5878
5879
5880
5881
5882
5883
5884
5885
5886
5887
5888
5889
5890
5891
5892
5893
5894
5895
5896
5897
5898
5899
5900
5901
5902
5903
5904
5905
5906
5907
5908
5909
5910
5911
5912
5913
5914
5915
5916
5917
5918
5919
5920
5921
5922
5923
5924
5925
5926
5927
5928
5929
5930
5931
5932
5933
5934
5935
5936
5937
5938
5939
5940
5941
5942
5943
5944
5945
5946
5947
5948
5949
5950
5951
5952
5953
5954
5955
5956
5957
5958
5959
5960
5961
5962
5963
5964
5965
5966
5967
5968
5969
5970
5971
5972
5973
5974
5975
5976
5977
5978
5979
5980
5981
5982
5983
5984
5985
5986
5987
5988
5989
5990
5991
5992
5993
5994
5995
5996
5997
5998
5999
6000
6001
6002
6003
6004
6005
6006
6007
6008
6009
6010
6011
6012
6013
6014
6015
6016
6017
6018
6019
6020
6021
6022
6023
6024
6025
6026
6027
6028
6029
6030
6031
6032
6033
6034
6035
6036
6037
6038
6039
6040
6041
6042
6043
6044
6045
6046
6047
6048
6049
6050
6051
6052
6053
6054
6055
6056
6057
6058
6059
6060
6061
6062
6063
6064
6065
6066
6067
6068
6069
6070
6071
6072
6073
6074
6075
6076
6077
6078
6079
6080
6081
6082
6083
6084
6085
6086
6087
6088
6089
6090
6091
6092
6093
6094
6095
6096
6097
6098
6099
6100
6101
6102
6103
6104
6105
6106
6107
6108
6109
6110
6111
6112
6113
6114
6115
6116
6117
6118
6119
6120
6121
6122
6123
6124
6125
6126
6127
6128
6129
6130
6131
6132
6133
6134
6135
6136
6137
6138
6139
6140
6141
6142
6143
6144
6145
6146
6147
6148
6149
6150
6151
6152
6153
6154
6155
6156
6157
6158
6159
6160
6161
6162
6163
6164
6165
6166
6167
6168
6169
6170
6171
6172
6173
6174
6175
6176
6177
6178
6179
6180
6181
6182
6183
6184
6185
6186
6187
6188
6189
6190
6191
6192
6193
6194
6195
6196
6197
6198
6199
6200
6201
6202
6203
6204
6205
6206
6207
6208
6209
6210
6211
6212
6213
6214
6215
6216
6217
6218
6219
6220
6221
6222
6223
6224
6225
6226
6227
6228
6229
6230
6231
6232
6233
6234
6235
6236
6237
6238
6239
6240
6241
6242
6243
6244
6245
6246
6247
6248
6249
6250
6251
6252
6253
6254
6255
6256
6257
6258
6259
6260
6261
6262
6263
6264
6265
6266
6267
6268
6269
6270
6271
6272
6273
6274
6275
6276
6277
6278
6279
6280
6281
6282
6283
6284
6285
6286
6287
6288
6289
6290
6291
6292
6293
6294
6295
6296
6297
6298
6299
6300
6301
6302
6303
6304
6305
6306
6307
6308
6309
6310
6311
6312
6313
6314
6315
6316
6317
6318
6319
6320
6321
6322
6323
6324
6325
6326
6327
6328
6329
6330
6331
6332
6333
6334
6335
6336
6337
6338
6339
6340
6341
6342
6343
6344
6345
6346
6347
6348
6349
6350
6351
6352
6353
6354
6355
6356
6357
6358
6359
6360
6361
6362
6363
6364
6365
6366
6367
6368
6369
6370
6371
6372
6373
6374
6375
6376
6377
6378
6379
6380
6381
6382
6383
6384
6385
6386
6387
6388
6389
6390
6391
6392
6393
6394
6395
6396
6397
6398
6399
6400
6401
6402
6403
6404
6405
6406
6407
6408
6409
6410
6411
6412
6413
6414
6415
6416
6417
6418
6419
6420
6421
6422
6423
6424
6425
6426
6427
6428
6429
6430
6431
6432
6433
6434
6435
6436
6437
6438
6439
6440
6441
6442
6443
6444
6445
6446
6447
6448
6449
6450
6451
6452
6453
6454
6455
6456
6457
6458
6459
6460
6461
6462
6463
6464
6465
6466
6467
6468
6469
6470
6471
6472
6473
6474
6475
6476
6477
6478
6479
6480
6481
6482
6483
6484
6485
6486
6487
6488
6489
6490
6491
6492
6493
6494
6495
6496
6497
6498
6499
6500
6501
6502
6503
6504
6505
6506
6507
6508
6509
6510
6511
6512
6513
6514
6515
6516
6517
6518
6519
6520
6521
6522
6523
6524
6525
6526
6527
6528
6529
6530
6531
6532
6533
6534
6535
6536
6537
6538
6539
6540
6541
6542
6543
6544
6545
6546
6547
6548
6549
6550
6551
6552
6553
6554
6555
6556
6557
6558
6559
6560
6561
6562
6563
6564
6565
6566
6567
6568
6569
6570
6571
6572
6573
6574
6575
6576
6577
6578
6579
6580
6581
6582
6583
6584
6585
6586
6587
6588
6589
6590
6591
6592
6593
6594
6595
6596
6597
6598
6599
6600
6601
6602
6603
6604
6605
6606
6607
6608
6609
6610
6611
6612
6613
6614
6615
6616
6617
6618
6619
6620
6621
6622
6623
6624
6625
6626
6627
6628
6629
6630
6631
6632
6633
6634
6635
6636
6637
6638
6639
6640
6641
6642
6643
6644
6645
6646
6647
6648
6649
6650
6651
6652
6653
6654
6655
6656
6657
6658
6659
6660
6661
6662
6663
6664
6665
6666
6667
6668
6669
6670
6671
6672
6673
6674
6675
6676
6677
6678
6679
6680
6681
6682
6683
6684
6685
6686
6687
6688
6689
6690
6691
6692
6693
6694
6695
6696
6697
6698
6699
6700
6701
6702
6703
6704
6705
6706
6707
6708
6709
6710
6711
6712
6713
6714
6715
6716
6717
6718
6719
6720
6721
6722
6723
6724
6725
6726
6727
6728
6729
6730
6731
6732
6733
6734
6735
6736
6737
6738
6739
6740
6741
6742
6743
6744
6745
6746
6747
6748
6749
6750
6751
6752
6753
6754
6755
6756
6757
6758
6759
6760
6761
6762
6763
6764
6765
6766
6767
6768
6769
6770
6771
6772
6773
6774
6775
6776
6777
6778
6779
6780
6781
6782
6783
6784
6785
6786
6787
6788
6789
6790
6791
6792
6793
6794
6795
6796
6797
6798
6799
6800
6801
6802
6803
6804
6805
6806
6807
6808
6809
6810
6811
6812
6813
6814
6815
6816
6817
6818
6819
6820
6821
6822
6823
6824
6825
6826
6827
6828
6829
6830
6831
6832
6833
6834
6835
6836
6837
6838
6839
6840
6841
6842
6843
6844
6845
6846
6847
6848
6849
6850
6851
6852
6853
6854
6855
6856
6857
6858
6859
6860
6861
6862
6863
6864
6865
6866
6867
6868
6869
6870
6871
6872
6873
6874
6875
6876
6877
6878
6879
6880
6881
6882
6883
6884
6885
6886
6887
6888
6889
6890
6891
6892
6893
6894
6895
6896
6897
6898
6899
6900
6901
6902
6903
6904
6905
6906
6907
6908
6909
6910
6911
6912
6913
6914
6915
6916
6917
6918
6919
6920
6921
6922
6923
6924
6925
6926
6927
6928
6929
6930
6931
6932
6933
6934
6935
6936
6937
6938
6939
6940
6941
6942
6943
6944
6945
6946
6947
6948
6949
6950
6951
6952
6953
6954
6955
6956
6957
6958
6959
6960
6961
6962
6963
6964
6965
6966
6967
6968
6969
6970
6971
6972
6973
6974
6975
6976
6977
6978
6979
6980
6981
6982
6983
6984
6985
6986
6987
6988
6989
6990
6991
6992
6993
6994
6995
6996
6997
6998
6999
7000
7001
7002
7003
7004
7005
7006
7007
7008
7009
7010
7011
7012
7013
7014
7015
7016
7017
7018
7019
7020
7021
7022
7023
7024
7025
7026
7027
7028
7029
7030
7031
7032
7033
7034
7035
7036
7037
7038
7039
7040
7041
7042
7043
7044
7045
7046
7047
7048
7049
7050
7051
7052
7053
7054
7055
7056
7057
7058
7059
7060
7061
7062
7063
7064
7065
7066
7067
7068
7069
7070
7071
7072
7073
7074
7075
7076
7077
7078
7079
7080
7081
7082
7083
7084
7085
7086
7087
7088
7089
7090
7091
7092
7093
7094
7095
7096
7097
7098
7099
7100
7101
7102
7103
7104
7105
7106
7107
7108
7109
7110
7111
7112
7113
7114
7115
7116
7117
7118
7119
7120
7121
7122
7123
7124
7125
7126
7127
7128
7129
7130
7131
7132
7133
7134
7135
7136
7137
7138
7139
7140
7141
7142
7143
7144
7145
7146
7147
7148
7149
7150
7151
7152
7153
7154
7155
7156
7157
7158
7159
7160
7161
7162
7163
7164
7165
7166
7167
7168
7169
7170
7171
7172
7173
7174
7175
7176
7177
7178
7179
7180
7181
7182
7183
7184
7185
7186
7187
7188
7189
7190
7191
7192
7193
7194
7195
7196
7197
7198
7199
7200
7201
7202
7203
7204
7205
7206
7207
7208
7209
7210
7211
7212
7213
7214
7215
7216
7217
7218
7219
7220
7221
7222
7223
7224
7225
7226
7227
7228
7229
7230
7231
7232
7233
7234
7235
7236
7237
7238
7239
7240
7241
7242
7243
7244
7245
7246
7247
7248
7249
7250
7251
7252
7253
7254
7255
7256
7257
7258
7259
7260
7261
7262
7263
7264
7265
7266
7267
7268
7269
7270
7271
7272
7273
7274
7275
7276
7277
7278
7279
7280
7281
7282
7283
7284
7285
7286
7287
7288
7289
7290
7291
7292
7293
7294
7295
7296
7297
7298
7299
7300
7301
7302
7303
7304
7305
7306
7307
7308
7309
7310
7311
7312
7313
7314
7315
7316
7317
7318
7319
7320
7321
7322
7323
7324
7325
7326
7327
7328
7329
7330
7331
7332
7333
7334
7335
7336
7337
7338
7339
7340
7341
7342
7343
7344
7345
7346
7347
7348
7349
7350
7351
7352
7353
7354
7355
7356
7357
7358
7359
7360
7361
7362
7363
7364
7365
7366
7367
7368
7369
7370
7371
7372
7373
7374
7375
7376
7377
7378
7379
7380
7381
7382
7383
7384
7385
7386
7387
7388
7389
7390
7391
7392
7393
7394
7395
7396
7397
7398
7399
7400
7401
7402
7403
7404
7405
7406
7407
7408
7409
7410
7411
7412
7413
7414
7415
7416
7417
7418
7419
7420
7421
7422
7423
7424
7425
7426
7427
7428
7429
7430
7431
7432
7433
7434
7435
7436
7437
7438
7439
7440
7441
7442
7443
7444
7445
7446
7447
7448
7449
7450
7451
7452
7453
7454
7455
7456
7457
7458
7459
7460
7461
7462
7463
7464
7465
7466
7467
7468
7469
7470
7471
7472
7473
7474
7475
7476
7477
7478
7479
7480
7481
7482
7483
7484
7485
7486
7487
7488
7489
7490
7491
7492
7493
7494
7495
7496
7497
7498
7499
7500
7501
7502
7503
7504
7505
7506
7507
7508
7509
7510
7511
7512
7513
7514
7515
7516
7517
7518
7519
7520
7521
7522
7523
7524
7525
7526
7527
7528
7529
7530
7531
7532
7533
7534
7535
7536
7537
7538
7539
7540
7541
7542
7543
7544
7545
7546
7547
7548
7549
7550
7551
7552
7553
7554
7555
7556
7557
7558
7559
7560
7561
7562
7563
7564
7565
7566
7567
7568
7569
7570
7571
7572
7573
7574
7575
7576
7577
7578
7579
7580
7581
7582
7583
7584
7585
7586
7587
7588
7589
7590
7591
7592
7593
7594
7595
7596
7597
7598
7599
7600
7601
7602
7603
7604
7605
7606
7607
7608
7609
7610
7611
7612
7613
7614
7615
7616
7617
7618
7619
7620
7621
7622
7623
7624
7625
7626
7627
7628
7629
7630
7631
7632
7633
7634
7635
7636
7637
7638
7639
7640
7641
7642
7643
7644
7645
7646
7647
7648
7649
7650
7651
7652
7653
7654
7655
7656
7657
7658
7659
7660
7661
7662
7663
7664
7665
7666
7667
7668
7669
7670
7671
7672
7673
7674
7675
7676
7677
7678
7679
7680
7681
7682
7683
7684
7685
7686
7687
7688
7689
7690
7691
7692
7693
7694
7695
7696
7697
7698
7699
7700
7701
7702
7703
7704
7705
7706
7707
7708
7709
7710
7711
7712
7713
7714
7715
7716
7717
7718
7719
7720
7721
7722
7723
7724
7725
7726
7727
7728
7729
7730
7731
7732
7733
7734
7735
7736
7737
7738
7739
7740
7741
7742
7743
7744
7745
7746
7747
7748
7749
7750
7751
7752
7753
7754
7755
7756
7757
7758
7759
7760
7761
7762
7763
7764
7765
7766
7767
7768
7769
7770
7771
7772
7773
7774
7775
7776
7777
7778
7779
7780
7781
7782
7783
7784
7785
7786
7787
7788
7789
7790
7791
7792
7793
7794
7795
7796
7797
7798
7799
7800
7801
7802
7803
7804
7805
7806
7807
7808
7809
7810
7811
7812
7813
7814
7815
7816
7817
7818
7819
7820
7821
7822
7823
7824
7825
7826
7827
7828
7829
7830
7831
7832
7833
7834
7835
7836
7837
7838
7839
7840
7841
7842
7843
7844
7845
7846
7847
7848
7849
7850
7851
7852
7853
7854
7855
7856
7857
7858
7859
7860
7861
7862
7863
7864
7865
7866
7867
7868
7869
7870
7871
7872
7873
7874
7875
7876
7877
7878
7879
7880
7881
7882
7883
7884
7885
7886
7887
7888
7889
7890
7891
7892
7893
7894
7895
7896
7897
7898
7899
7900
7901
7902
7903
7904
7905
7906
7907
7908
7909
7910
7911
7912
7913
7914
7915
7916
7917
7918
7919
7920
7921
7922
7923
7924
7925
7926
7927
7928
7929
7930
7931
7932
7933
7934
7935
7936
7937
7938
7939
7940
7941
7942
7943
7944
7945
7946
7947
7948
7949
7950
7951
7952
7953
7954
7955
7956
7957
7958
7959
7960
7961
7962
7963
7964
7965
7966
7967
7968
7969
7970
7971
7972
7973
7974
7975
7976
7977
7978
7979
7980
7981
7982
7983
7984
7985
7986
7987
7988
7989
7990
7991
7992
7993
7994
7995
7996
7997
7998
7999
8000
8001
8002
8003
8004
8005
8006
8007
8008
8009
8010
8011
8012
8013
8014
8015
8016
8017
8018
8019
8020
8021
8022
8023
8024
8025
8026
8027
8028
8029
8030
8031
8032
8033
8034
8035
8036
8037
8038
8039
8040
8041
8042
8043
8044
8045
8046
8047
8048
8049
8050
8051
8052
8053
8054
8055
8056
8057
8058
8059
8060
8061
8062
8063
8064
8065
8066
8067
8068
8069
8070
8071
8072
8073
8074
8075
8076
8077
8078
8079
8080
8081
8082
8083
8084
8085
8086
8087
8088
8089
8090
8091
8092
8093
8094
8095
8096
8097
8098
8099
8100
8101
8102
8103
8104
8105
8106
8107
8108
8109
8110
8111
8112
8113
8114
8115
8116
8117
8118
8119
8120
8121
8122
8123
8124
8125
8126
8127
8128
8129
8130
8131
8132
8133
8134
8135
8136
8137
8138
8139
8140
8141
8142
8143
8144
8145
8146
8147
8148
8149
8150
8151
8152
8153
8154
8155
8156
8157
8158
8159
8160
8161
8162
8163
8164
8165
8166
8167
8168
8169
8170
8171
8172
8173
8174
8175
8176
8177
8178
8179
8180
8181
8182
8183
8184
8185
8186
8187
8188
8189
8190
8191
8192
8193
8194
8195
8196
8197
8198
8199
8200
8201
8202
8203
8204
8205
8206
8207
8208
8209
8210
8211
8212
8213
8214
8215
8216
8217
8218
8219
8220
8221
8222
8223
8224
8225
8226
8227
8228
8229
8230
8231
8232
8233
8234
8235
8236
8237
8238
8239
8240
8241
8242
8243
8244
8245
8246
8247
8248
8249
8250
8251
8252
8253
8254
8255
8256
8257
8258
8259
8260
8261
8262
8263
8264
8265
8266
8267
8268
8269
8270
8271
8272
8273
8274
8275
8276
8277
8278
8279
8280
8281
8282
8283
8284
8285
8286
8287
8288
8289
8290
8291
8292
8293
8294
8295
8296
8297
8298
8299
8300
8301
8302
8303
8304
8305
8306
8307
8308
8309
8310
8311
8312
8313
8314
8315
8316
8317
8318
8319
8320
8321
8322
8323
8324
8325
8326
8327
8328
8329
8330
8331
8332
8333
8334
8335
8336
8337
8338
8339
8340
8341
8342
8343
8344
8345
8346
8347
8348
8349
8350
8351
8352
8353
8354
8355
8356
8357
8358
8359
8360
8361
8362
8363
8364
8365
8366
8367
8368
8369
8370
8371
8372
8373
8374
8375
8376
8377
8378
8379
8380
8381
8382
8383
8384
8385
8386
8387
8388
8389
8390
8391
8392
8393
8394
8395
8396
8397
8398
8399
8400
8401
8402
8403
8404
8405
8406
8407
8408
8409
8410
8411
8412
8413
8414
8415
8416
8417
8418
8419
8420
8421
8422
8423
8424
8425
8426
8427
8428
8429
8430
8431
8432
8433
8434
8435
8436
8437
8438
8439
8440
8441
8442
8443
8444
8445
8446
8447
8448
8449
8450
8451
8452
8453
8454
8455
8456
8457
8458
8459
8460
8461
8462
8463
8464
8465
8466
8467
8468
8469
8470
8471
8472
8473
8474
8475
8476
8477
8478
8479
8480
8481
8482
8483
8484
8485
8486
8487
8488
8489
8490
8491
8492
8493
8494
8495
8496
8497
8498
8499
8500
8501
8502
8503
8504
8505
8506
8507
8508
8509
8510
8511
8512
8513
8514
8515
8516
8517
8518
8519
8520
8521
8522
8523
8524
8525
8526
8527
8528
8529
8530
8531
8532
8533
8534
8535
8536
8537
8538
8539
8540
8541
8542
8543
8544
8545
8546
8547
8548
8549
8550
8551
8552
8553
8554
8555
8556
8557
8558
8559
8560
8561
8562
8563
8564
8565
8566
8567
8568
8569
8570
8571
8572
8573
8574
8575
8576
8577
8578
8579
8580
8581
8582
8583
8584
8585
8586
8587
8588
8589
8590
8591
8592
8593
8594
8595
8596
8597
8598
8599
8600
8601
8602
8603
8604
8605
8606
8607
8608
8609
8610
8611
8612
8613
8614
8615
8616
8617
8618
8619
8620
8621
8622
8623
8624
8625
8626
8627
8628
8629
8630
8631
8632
8633
8634
8635
8636
8637
8638
8639
8640
8641
8642
8643
8644
8645
8646
8647
8648
8649
8650
8651
8652
8653
8654
8655
8656
8657
8658
8659
8660
8661
8662
8663
8664
8665
8666
8667
8668
8669
8670
8671
8672
8673
8674
8675
8676
8677
8678
8679
8680
8681
8682
8683
8684
8685
8686
8687
8688
8689
8690
8691
8692
8693
8694
8695
8696
8697
8698
8699
8700
8701
8702
8703
8704
8705
8706
8707
8708
8709
8710
8711
8712
8713
8714
8715
8716
8717
8718
8719
8720
8721
8722
8723
8724
8725
8726
8727
8728
8729
8730
8731
8732
8733
8734
8735
8736
8737
8738
8739
8740
8741
8742
8743
8744
8745
8746
8747
8748
8749
8750
8751
8752
8753
8754
8755
8756
8757
8758
8759
8760
8761
8762
8763
8764
8765
8766
8767
8768
8769
8770
8771
8772
8773
8774
8775
8776
8777
8778
8779
8780
8781
8782
8783
8784
8785
8786
8787
8788
8789
8790
8791
8792
8793
8794
8795
8796
8797
8798
8799
8800
8801
8802
8803
8804
8805
8806
8807
8808
8809
8810
8811
8812
8813
8814
8815
8816
8817
8818
8819
8820
8821
8822
8823
8824
8825
8826
8827
8828
8829
8830
8831
8832
8833
8834
8835
8836
8837
8838
8839
8840
8841
8842
8843
8844
8845
8846
8847
8848
8849
8850
8851
8852
8853
8854
8855
8856
8857
8858
8859
8860
8861
8862
8863
8864
8865
8866
8867
8868
8869
8870
8871
8872
8873
8874
8875
8876
8877
8878
8879
8880
8881
8882
8883
8884
8885
8886
8887
8888
8889
8890
8891
8892
8893
8894
8895
8896
8897
8898
8899
8900
8901
8902
8903
8904
8905
8906
8907
8908
8909
8910
8911
8912
8913
8914
8915
8916
8917
8918
8919
8920
8921
8922
8923
8924
8925
8926
8927
8928
8929
8930
8931
8932
8933
8934
8935
8936
8937
8938
8939
8940
8941
8942
8943
8944
8945
8946
8947
8948
8949
8950
8951
8952
8953
8954
8955
8956
8957
8958
8959
8960
8961
8962
8963
8964
8965
8966
8967
8968
8969
8970
8971
8972
8973
8974
8975
8976
8977
8978
8979
8980
8981
8982
8983
8984
8985
8986
8987
8988
8989
8990
8991
8992
8993
8994
8995
8996
8997
8998
8999
9000
9001
9002
9003
9004
9005
9006
9007
9008
9009
9010
9011
9012
9013
9014
9015
9016
9017
9018
9019
9020
9021
9022
9023
9024
9025
9026
9027
9028
9029
9030
9031
9032
9033
9034
9035
9036
9037
9038
9039
9040
9041
9042
9043
9044
9045
9046
9047
9048
9049
9050
9051
9052
9053
9054
9055
9056
9057
9058
9059
9060
9061
9062
9063
9064
9065
9066
9067
9068
9069
9070
9071
9072
9073
9074
9075
9076
9077
9078
9079
9080
9081
9082
9083
9084
9085
9086
9087
9088
9089
9090
9091
9092
9093
9094
9095
9096
9097
9098
9099
9100
9101
9102
9103
9104
9105
9106
9107
9108
9109
9110
9111
9112
9113
9114
9115
9116
9117
9118
9119
9120
9121
9122
9123
9124
9125
9126
9127
9128
9129
9130
9131
9132
9133
9134
9135
9136
9137
9138
9139
9140
9141
9142
9143
9144
9145
9146
9147
9148
9149
9150
9151
9152
9153
9154
9155
9156
9157
9158
9159
9160
9161
9162
9163
9164
9165
9166
9167
9168
9169
9170
9171
9172
9173
9174
9175
9176
9177
9178
9179
9180
9181
9182
9183
9184
9185
9186
9187
9188
9189
9190
9191
9192
9193
9194
9195
9196
9197
9198
9199
9200
9201
9202
9203
9204
9205
9206
9207
9208
9209
9210
9211
9212
9213
9214
9215
9216
9217
9218
9219
9220
9221
9222
9223
9224
9225
9226
9227
9228
9229
9230
9231
9232
9233
9234
9235
9236
9237
9238
9239
9240
9241
9242
9243
9244
9245
9246
9247
9248
9249
9250
9251
9252
9253
9254
9255
9256
9257
9258
9259
9260
9261
9262
9263
9264
9265
9266
9267
9268
9269
9270
9271
9272
9273
9274
9275
9276
9277
9278
9279
9280
9281
9282
9283
9284
9285
9286
9287
9288
9289
9290
9291
9292
9293
9294
9295
9296
9297
9298
9299
9300
9301
9302
9303
9304
9305
9306
9307
9308
9309
9310
9311
9312
9313
9314
9315
9316
9317
9318
9319
9320
9321
9322
9323
9324
9325
9326
9327
9328
9329
9330
9331
9332
9333
9334
9335
9336
9337
9338
9339
9340
9341
9342
9343
9344
9345
9346
9347
9348
9349
9350
9351
9352
9353
9354
9355
9356
9357
9358
9359
9360
9361
9362
9363
9364
9365
9366
9367
9368
9369
9370
9371
9372
9373
9374
9375
9376
9377
9378
9379
9380
9381
9382
9383
9384
9385
9386
9387
9388
9389
9390
9391
9392
9393
9394
9395
9396
9397
9398
9399
9400
9401
9402
9403
9404
9405
9406
9407
9408
9409
9410
9411
9412
9413
9414
9415
9416
9417
9418
9419
9420
9421
9422
9423
9424
9425
9426
9427
9428
9429
9430
9431
9432
9433
9434
9435
9436
9437
9438
9439
9440
9441
9442
9443
9444
9445
9446
9447
9448
9449
9450
9451
9452
9453
9454
9455
9456
9457
9458
9459
9460
9461
9462
9463
9464
9465
9466
9467
9468
9469
9470
9471
9472
9473
9474
9475
9476
9477
9478
9479
9480
9481
9482
9483
9484
9485
9486
9487
9488
9489
9490
9491
9492
9493
9494
9495
9496
9497
9498
9499
9500
9501
9502
9503
9504
9505
9506
9507
9508
9509
9510
9511
9512
9513
9514
9515
9516
9517
9518
9519
9520
9521
9522
9523
9524
9525
9526
9527
9528
9529
9530
9531
9532
9533
9534
9535
9536
9537
9538
9539
9540
9541
9542
9543
9544
9545
9546
9547
9548
9549
9550
9551
9552
9553
9554
9555
9556
9557
9558
9559
9560
9561
9562
9563
9564
9565
9566
9567
9568
9569
9570
9571
9572
9573
9574
9575
9576
9577
9578
9579
9580
9581
9582
9583
9584
9585
9586
9587
9588
9589
9590
9591
9592
9593
9594
9595
9596
9597
9598
9599
9600
9601
9602
9603
9604
9605
9606
9607
9608
9609
9610
9611
9612
9613
9614
9615
9616
9617
9618
9619
9620
9621
9622
9623
9624
9625
9626
9627
9628
9629
9630
9631
9632
9633
9634
9635
9636
9637
9638
9639
9640
9641
9642
9643
9644
9645
9646
9647
9648
9649
9650
9651
9652
9653
9654
9655
9656
9657
9658
9659
9660
9661
9662
9663
9664
9665
9666
9667
9668
9669
9670
9671
9672
9673
9674
9675
9676
9677
9678
9679
9680
9681
9682
9683
9684
9685
9686
9687
9688
9689
9690
9691
9692
9693
9694
9695
9696
9697
9698
9699
9700
9701
9702
9703
9704
9705
9706
9707
9708
9709
9710
9711
9712
9713
9714
9715
9716
9717
9718
9719
9720
9721
9722
9723
9724
9725
9726
9727
9728
9729
9730
9731
9732
9733
9734
9735
9736
9737
9738
9739
9740
9741
9742
9743
9744
9745
9746
9747
9748
9749
9750
9751
9752
9753
9754
9755
9756
9757
9758
9759
9760
9761
9762
9763
9764
9765
9766
9767
9768
9769
9770
9771
9772
9773
9774
9775
9776
9777
9778
9779
9780
9781
9782
9783
9784
9785
9786
9787
9788
9789
9790
9791
9792
9793
9794
9795
9796
9797
9798
9799
9800
9801
9802
9803
9804
9805
9806
9807
9808
9809
9810
9811
9812
9813
9814
9815
9816
9817
9818
9819
9820
9821
9822
9823
9824
9825
9826
9827
9828
9829
9830
9831
9832
9833
9834
9835
9836
9837
9838
9839
9840
9841
9842
9843
9844
9845
9846
9847
9848
9849
9850
9851
9852
9853
9854
9855
9856
9857
9858
9859
9860
9861
9862
9863
9864
9865
9866
9867
9868
9869
9870
9871
9872
9873
9874
9875
9876
9877
9878
9879
9880
9881
9882
9883
9884
9885
9886
9887
9888
9889
9890
9891
9892
9893
9894
9895
9896
9897
9898
9899
9900
9901
9902
9903
9904
9905
9906
9907
9908
9909
9910
9911
9912
9913
9914
9915
9916
9917
9918
9919
9920
9921
9922
9923
9924
9925
9926
9927
9928
9929
9930
9931
9932
9933
9934
9935
9936
9937
9938
9939
9940
9941
9942
9943
9944
9945
9946
9947
9948
9949
9950
9951
9952
9953
9954
9955
9956
9957
9958
9959
9960
9961
9962
9963
9964
9965
9966
9967
9968
9969
9970
9971
9972
9973
9974
9975
9976
9977
9978
9979
9980
9981
9982
9983
9984
9985
9986
9987
9988
9989
9990
9991
9992
9993
9994
9995
9996
9997
9998
9999
10000
10001
10002
10003
10004
10005
10006
10007
10008
10009
10010
10011
10012
10013
10014
10015
10016
10017
10018
10019
10020
10021
10022
10023
10024
10025
10026
10027
10028
10029
10030
10031
10032
10033
10034
10035
10036
10037
10038
10039
10040
10041
10042
10043
10044
10045
10046
10047
10048
10049
10050
10051
10052
10053
10054
10055
10056
10057
10058
10059
10060
10061
10062
10063
10064
10065
10066
10067
10068
10069
10070
10071
10072
10073
10074
10075
10076
10077
10078
10079
10080
10081
10082
10083
10084
10085
10086
10087
10088
10089
10090
10091
10092
10093
10094
10095
10096
10097
10098
10099
10100
10101
10102
10103
10104
10105
10106
10107
10108
10109
10110
10111
10112
10113
10114
10115
10116
10117
10118
10119
10120
10121
10122
10123
10124
10125
10126
10127
10128
10129
10130
10131
10132
10133
10134
10135
10136
10137
10138
10139
10140
10141
10142
10143
10144
10145
10146
10147
10148
10149
10150
10151
10152
10153
10154
10155
10156
10157
10158
10159
10160
10161
10162
10163
10164
10165
10166
10167
10168
10169
10170
10171
10172
10173
10174
10175
10176
10177
10178
10179
10180
10181
10182
10183
10184
10185
10186
10187
10188
10189
10190
10191
10192
10193
10194
10195
10196
10197
10198
10199
10200
10201
10202
10203
10204
10205
10206
10207
10208
10209
10210
10211
10212
10213
10214
10215
10216
10217
10218
10219
10220
10221
10222
10223
10224
10225
10226
10227
10228
10229
10230
10231
10232
10233
10234
10235
10236
10237
10238
10239
10240
10241
10242
10243
10244
10245
10246
10247
10248
10249
10250
10251
10252
10253
10254
10255
10256
10257
10258
10259
10260
10261
10262
10263
10264
10265
10266
10267
10268
10269
10270
10271
10272
10273
10274
10275
10276
10277
10278
10279
10280
10281
10282
10283
10284
10285
10286
10287
10288
10289
10290
10291
10292
10293
10294
10295
10296
10297
10298
10299
10300
10301
10302
10303
10304
10305
10306
10307
10308
10309
10310
10311
10312
10313
10314
10315
10316
10317
10318
10319
10320
10321
10322
10323
10324
10325
10326
10327
10328
10329
10330
10331
10332
10333
10334
10335
10336
10337
10338
10339
10340
10341
10342
10343
10344
10345
10346
10347
10348
10349
10350
10351
10352
10353
10354
10355
10356
10357
10358
10359
10360
10361
10362
10363
10364
10365
10366
10367
10368
10369
10370
10371
10372
10373
10374
10375
10376
10377
10378
10379
10380
10381
10382
10383
10384
10385
10386
10387
10388
10389
10390
10391
10392
10393
10394
10395
10396
10397
10398
10399
10400
10401
10402
10403
10404
10405
10406
10407
10408
10409
10410
10411
10412
10413
10414
10415
10416
10417
10418
10419
10420
10421
10422
10423
10424
10425
10426
10427
10428
10429
10430
10431
10432
10433
10434
10435
10436
10437
10438
10439
10440
10441
10442
10443
10444
10445
10446
10447
10448
10449
10450
10451
10452
10453
10454
10455
10456
10457
10458
10459
10460
10461
10462
10463
10464
10465
10466
10467
10468
10469
10470
10471
10472
10473
10474
10475
10476
10477
10478
10479
10480
10481
10482
10483
10484
10485
10486
10487
10488
10489
10490
10491
10492
10493
10494
10495
10496
10497
10498
10499
10500
10501
10502
10503
10504
10505
10506
10507
10508
10509
10510
10511
10512
10513
10514
10515
10516
10517
10518
10519
10520
10521
10522
10523
10524
10525
10526
10527
10528
10529
10530
10531
10532
10533
10534
10535
10536
10537
10538
10539
10540
10541
10542
10543
10544
10545
10546
10547
10548
10549
10550
10551
10552
10553
10554
10555
10556
10557
10558
10559
10560
10561
10562
10563
10564
10565
10566
10567
10568
10569
10570
10571
10572
10573
10574
10575
10576
10577
10578
10579
10580
10581
10582
10583
10584
10585
10586
10587
10588
10589
10590
10591
10592
10593
10594
10595
10596
10597
10598
10599
10600
10601
10602
10603
10604
10605
10606
10607
10608
10609
10610
10611
10612
10613
10614
10615
10616
10617
10618
10619
10620
10621
10622
10623
10624
10625
10626
10627
10628
10629
10630
10631
10632
10633
10634
10635
10636
10637
10638
10639
10640
10641
10642
10643
10644
10645
10646
10647
10648
10649
10650
10651
10652
10653
10654
10655
10656
10657
10658
10659
10660
10661
10662
10663
10664
10665
10666
10667
10668
10669
10670
10671
10672
10673
10674
10675
10676
10677
10678
10679
10680
10681
10682
10683
10684
10685
10686
10687
10688
10689
10690
10691
10692
10693
10694
10695
10696
10697
10698
10699
10700
10701
10702
10703
10704
10705
10706
10707
10708
10709
10710
10711
10712
10713
10714
10715
10716
10717
10718
10719
10720
10721
10722
10723
10724
10725
10726
10727
10728
10729
10730
10731
10732
10733
10734
10735
10736
10737
10738
10739
10740
10741
10742
10743
10744
10745
10746
10747
10748
10749
10750
10751
10752
10753
10754
10755
10756
10757
10758
10759
10760
10761
10762
10763
10764
10765
10766
10767
10768
10769
10770
10771
10772
10773
10774
10775
10776
10777
10778
10779
10780
10781
10782
10783
10784
10785
10786
10787
10788
10789
10790
10791
10792
10793
10794
10795
10796
10797
10798
10799
10800
10801
10802
10803
10804
10805
10806
10807
10808
10809
10810
10811
10812
10813
10814
10815
10816
10817
10818
10819
10820
10821
10822
10823
10824
10825
10826
10827
10828
10829
10830
10831
10832
10833
10834
10835
10836
10837
10838
10839
10840
10841
10842
10843
10844
10845
10846
10847
10848
10849
10850
10851
10852
10853
10854
10855
10856
10857
10858
10859
10860
10861
10862
10863
10864
10865
10866
10867
10868
10869
10870
10871
10872
10873
10874
10875
10876
10877
10878
10879
10880
10881
10882
10883
10884
10885
10886
10887
10888
10889
10890
10891
10892
10893
10894
10895
10896
10897
10898
10899
10900
10901
10902
10903
10904
10905
10906
10907
10908
10909
10910
10911
10912
10913
10914
10915
10916
10917
10918
10919
10920
10921
10922
10923
10924
10925
10926
10927
10928
10929
10930
10931
10932
10933
10934
10935
10936
10937
10938
10939
10940
10941
10942
10943
10944
10945
10946
10947
10948
10949
10950
10951
10952
10953
10954
10955
10956
10957
10958
10959
10960
10961
10962
10963
10964
10965
10966
10967
10968
10969
10970
10971
10972
10973
10974
10975
10976
10977
10978
10979
10980
10981
10982
10983
10984
10985
10986
10987
10988
10989
10990
10991
10992
10993
10994
10995
10996
10997
10998
10999
11000
11001
11002
11003
11004
11005
11006
11007
11008
11009
11010
11011
11012
11013
11014
11015
11016
11017
11018
11019
11020
11021
11022
11023
11024
11025
11026
11027
11028
11029
11030
11031
11032
11033
11034
11035
11036
11037
11038
11039
11040
11041
11042
11043
11044
11045
11046
11047
11048
11049
11050
11051
11052
11053
11054
11055
11056
11057
11058
11059
11060
11061
11062
11063
11064
11065
11066
11067
11068
11069
11070
11071
11072
11073
11074
11075
11076
11077
11078
11079
11080
11081
11082
11083
11084
11085
11086
11087
11088
11089
11090
11091
11092
11093
11094
11095
11096
11097
11098
11099
11100
11101
11102
11103
11104
11105
11106
11107
11108
11109
11110
11111
11112
11113
11114
11115
11116
11117
11118
11119
11120
11121
11122
11123
11124
11125
11126
11127
11128
11129
11130
11131
11132
11133
11134
11135
11136
11137
11138
11139
11140
11141
11142
11143
11144
11145
11146
11147
11148
11149
11150
11151
11152
11153
11154
11155
11156
11157
11158
11159
11160
11161
11162
11163
11164
11165
11166
11167
11168
11169
11170
11171
11172
11173
11174
11175
11176
11177
11178
11179
11180
11181
11182
11183
11184
11185
11186
11187
11188
11189
11190
11191
11192
11193
11194
11195
11196
11197
11198
11199
11200
11201
11202
11203
11204
11205
11206
11207
11208
11209
11210
11211
11212
11213
11214
11215
11216
11217
11218
11219
11220
11221
11222
11223
11224
11225
11226
11227
11228
11229
11230
11231
11232
11233
11234
11235
11236
11237
11238
11239
11240
11241
11242
11243
11244
11245
11246
11247
11248
11249
11250
11251
11252
11253
11254
11255
11256
11257
11258
11259
11260
11261
11262
11263
11264
11265
11266
11267
11268
11269
11270
11271
11272
11273
11274
11275
11276
11277
11278
11279
11280
11281
11282
11283
11284
11285
11286
11287
11288
11289
11290
11291
11292
11293
11294
11295
11296
11297
11298
11299
11300
11301
11302
11303
11304
11305
11306
11307
11308
11309
11310
11311
11312
11313
11314
11315
11316
11317
11318
11319
11320
11321
11322
11323
11324
11325
11326
11327
11328
11329
11330
11331
11332
11333
11334
11335
11336
11337
11338
11339
11340
11341
11342
11343
11344
11345
11346
11347
11348
11349
11350
11351
11352
11353
11354
11355
11356
11357
11358
11359
11360
11361
11362
11363
11364
11365
11366
11367
11368
11369
11370
11371
11372
11373
11374
11375
11376
11377
11378
11379
11380
11381
11382
11383
11384
11385
11386
11387
11388
11389
11390
11391
11392
11393
11394
11395
11396
11397
11398
11399
11400
11401
11402
11403
11404
11405
11406
11407
11408
11409
11410
11411
11412
11413
11414
11415
11416
11417
11418
11419
11420
11421
11422
11423
11424
11425
11426
11427
11428
11429
11430
11431
11432
11433
11434
11435
11436
11437
11438
11439
11440
11441
11442
11443
11444
11445
11446
11447
11448
11449
11450
11451
11452
11453
11454
11455
11456
11457
11458
11459
11460
11461
11462
11463
11464
11465
11466
11467
11468
11469
11470
11471
11472
11473
11474
11475
11476
11477
11478
11479
11480
11481
11482
11483
11484
11485
11486
11487
11488
11489
11490
11491
11492
11493
11494
11495
11496
11497
11498
11499
11500
11501
11502
11503
11504
11505
11506
11507
11508
11509
11510
11511
11512
11513
11514
11515
11516
11517
11518
11519
11520
11521
11522
11523
11524
11525
11526
11527
11528
11529
11530
11531
11532
11533
11534
11535
11536
11537
11538
11539
11540
11541
11542
11543
11544
11545
11546
11547
11548
11549
11550
11551
11552
11553
11554
11555
11556
11557
11558
11559
11560
11561
11562
11563
11564
11565
11566
11567
11568
11569
11570
11571
11572
11573
11574
11575
11576
11577
11578
11579
11580
11581
11582
11583
11584
11585
11586
11587
11588
11589
11590
11591
11592
11593
11594
11595
11596
11597
11598
11599
11600
11601
11602
11603
11604
11605
11606
11607
11608
11609
11610
11611
11612
11613
11614
11615
11616
11617
11618
11619
11620
11621
11622
11623
11624
11625
11626
11627
11628
11629
11630
11631
11632
11633
11634
11635
11636
11637
11638
11639
11640
11641
11642
11643
11644
11645
11646
11647
11648
11649
11650
11651
11652
11653
11654
11655
11656
11657
11658
11659
11660
11661
11662
11663
11664
11665
11666
11667
11668
11669
11670
11671
11672
11673
11674
11675
11676
11677
11678
11679
11680
11681
11682
11683
11684
11685
11686
11687
11688
11689
11690
11691
11692
11693
11694
11695
11696
11697
11698
11699
11700
11701
11702
11703
11704
11705
11706
11707
11708
11709
11710
11711
11712
11713
11714
11715
11716
11717
11718
11719
11720
11721
11722
11723
11724
11725
11726
11727
11728
11729
11730
11731
11732
11733
11734
11735
11736
11737
11738
11739
11740
11741
11742
11743
11744
11745
11746
11747
11748
11749
11750
11751
11752
11753
11754
11755
11756
11757
11758
11759
11760
11761
11762
11763
11764
11765
11766
11767
11768
11769
11770
11771
11772
11773
11774
11775
11776
11777
11778
11779
11780
11781
11782
11783
11784
11785
11786
11787
11788
11789
11790
11791
11792
11793
11794
11795
11796
11797
11798
11799
11800
11801
11802
11803
11804
11805
11806
11807
11808
11809
11810
11811
11812
11813
11814
11815
11816
11817
11818
11819
11820
11821
11822
11823
11824
11825
11826
11827
11828
11829
11830
11831
11832
11833
11834
11835
11836
11837
11838
11839
11840
11841
11842
11843
11844
11845
11846
11847
11848
11849
11850
11851
11852
11853
11854
11855
11856
11857
11858
11859
11860
11861
11862
11863
11864
11865
11866
11867
11868
11869
11870
11871
11872
11873
11874
11875
11876
11877
11878
11879
11880
11881
11882
11883
11884
11885
11886
11887
11888
11889
11890
11891
11892
11893
11894
11895
11896
11897
11898
11899
11900
11901
11902
11903
11904
11905
11906
11907
11908
11909
11910
11911
11912
11913
11914
11915
11916
11917
11918
11919
11920
11921
11922
11923
11924
11925
11926
11927
11928
11929
11930
11931
11932
11933
11934
11935
11936
11937
11938
11939
11940
11941
11942
11943
11944
11945
11946
11947
11948
11949
11950
11951
11952
11953
11954
11955
11956
11957
11958
11959
11960
11961
11962
11963
11964
11965
11966
11967
11968
11969
11970
11971
11972
11973
11974
11975
11976
11977
11978
11979
11980
11981
11982
11983
11984
11985
11986
11987
11988
11989
11990
11991
11992
11993
11994
11995
11996
11997
11998
11999
12000
12001
12002
12003
12004
12005
12006
12007
12008
12009
12010
12011
12012
12013
12014
12015
12016
12017
12018
12019
12020
12021
12022
12023
12024
12025
12026
12027
12028
12029
12030
12031
12032
12033
12034
12035
12036
12037
12038
12039
12040
12041
12042
12043
12044
12045
12046
12047
12048
12049
12050
12051
12052
12053
12054
12055
12056
12057
12058
12059
12060
12061
12062
12063
12064
12065
12066
12067
12068
12069
12070
12071
12072
12073
12074
12075
12076
12077
12078
12079
12080
12081
12082
12083
12084
12085
12086
12087
12088
12089
12090
12091
12092
12093
12094
12095
12096
12097
12098
12099
12100
12101
12102
12103
12104
12105
12106
12107
12108
12109
12110
12111
12112
12113
12114
12115
12116
12117
12118
12119
12120
12121
12122
12123
12124
12125
12126
12127
12128
12129
12130
12131
12132
12133
12134
12135
12136
12137
12138
12139
12140
12141
12142
12143
12144
12145
12146
12147
12148
12149
12150
12151
12152
12153
12154
12155
12156
12157
12158
12159
12160
12161
12162
12163
12164
12165
12166
12167
12168
12169
12170
12171
12172
12173
12174
12175
12176
12177
12178
12179
12180
12181
12182
12183
12184
12185
12186
12187
12188
12189
12190
12191
12192
12193
12194
12195
12196
12197
12198
12199
12200
12201
12202
12203
12204
12205
12206
12207
12208
12209
12210
12211
12212
12213
12214
12215
12216
12217
12218
12219
12220
12221
12222
12223
12224
12225
12226
12227
12228
12229
12230
12231
12232
12233
12234
12235
12236
12237
12238
12239
12240
12241
12242
12243
12244
12245
12246
12247
12248
12249
12250
12251
12252
12253
12254
12255
12256
12257
12258
12259
12260
12261
12262
12263
12264
12265
12266
12267
12268
12269
12270
12271
12272
12273
12274
12275
12276
12277
12278
12279
12280
12281
12282
12283
12284
12285
12286
12287
12288
12289
12290
12291
12292
12293
12294
12295
12296
12297
12298
12299
12300
12301
12302
12303
12304
12305
12306
12307
12308
12309
12310
12311
12312
12313
12314
12315
12316
12317
12318
12319
12320
12321
12322
12323
12324
12325
12326
12327
12328
12329
12330
12331
12332
12333
12334
12335
12336
12337
12338
12339
12340
12341
12342
12343
12344
12345
12346
12347
12348
12349
12350
12351
12352
12353
12354
12355
12356
12357
12358
12359
12360
12361
12362
12363
12364
12365
12366
12367
12368
12369
12370
12371
12372
12373
12374
12375
12376
12377
12378
12379
12380
12381
12382
12383
12384
12385
12386
12387
12388
12389
12390
12391
12392
12393
12394
12395
12396
12397
12398
12399
12400
12401
12402
12403
12404
12405
12406
12407
12408
12409
12410
12411
12412
12413
12414
12415
12416
12417
12418
12419
12420
12421
12422
12423
12424
12425
12426
12427
12428
12429
12430
12431
12432
12433
12434
12435
12436
12437
12438
12439
12440
12441
12442
12443
12444
12445
12446
12447
12448
12449
12450
12451
12452
12453
12454
12455
12456
12457
12458
12459
12460
12461
12462
12463
12464
12465
12466
12467
12468
12469
12470
12471
12472
12473
12474
12475
12476
12477
12478
12479
12480
12481
12482
12483
12484
12485
12486
12487
12488
12489
12490
12491
12492
12493
12494
12495
12496
12497
12498
12499
12500
12501
12502
12503
12504
12505
12506
12507
12508
12509
12510
12511
12512
12513
12514
12515
12516
12517
12518
12519
12520
12521
12522
12523
12524
12525
12526
12527
12528
12529
12530
12531
12532
12533
12534
12535
12536
12537
12538
12539
12540
12541
12542
12543
12544
12545
12546
12547
12548
12549
12550
12551
12552
12553
12554
12555
12556
12557
12558
12559
12560
12561
12562
12563
12564
12565
12566
12567
12568
12569
12570
12571
12572
12573
12574
12575
12576
12577
12578
12579
12580
12581
12582
12583
12584
12585
12586
12587
12588
12589
12590
12591
12592
12593
12594
12595
12596
12597
12598
12599
12600
12601
12602
12603
12604
12605
12606
12607
12608
12609
12610
12611
12612
12613
12614
12615
12616
12617
12618
12619
12620
12621
12622
12623
12624
12625
12626
12627
12628
12629
12630
12631
12632
12633
12634
12635
12636
12637
12638
12639
12640
12641
12642
12643
12644
12645
12646
12647
12648
12649
12650
12651
12652
12653
12654
12655
12656
12657
12658
12659
12660
12661
12662
12663
12664
12665
12666
12667
12668
12669
12670
12671
12672
12673
12674
12675
12676
12677
12678
12679
12680
12681
12682
12683
12684
12685
12686
12687
12688
12689
12690
12691
12692
12693
12694
12695
12696
12697
12698
12699
12700
12701
12702
12703
12704
12705
12706
12707
12708
12709
12710
12711
12712
12713
12714
12715
12716
12717
12718
12719
12720
12721
12722
12723
12724
12725
12726
12727
12728
12729
12730
12731
12732
12733
12734
12735
12736
12737
12738
12739
12740
12741
12742
12743
12744
12745
12746
12747
12748
12749
12750
12751
12752
12753
12754
12755
12756
12757
12758
12759
12760
12761
12762
12763
12764
12765
12766
12767
12768
12769
12770
12771
12772
12773
12774
12775
12776
12777
12778
12779
12780
12781
12782
12783
12784
12785
12786
12787
12788
12789
12790
12791
12792
12793
12794
12795
12796
12797
12798
12799
12800
12801
12802
12803
12804
12805
12806
12807
12808
12809
12810
12811
12812
12813
12814
12815
12816
12817
12818
12819
12820
12821
12822
12823
12824
12825
12826
12827
12828
12829
12830
12831
12832
12833
12834
12835
12836
12837
12838
12839
12840
12841
12842
12843
12844
12845
12846
12847
12848
12849
12850
12851
12852
12853
12854
12855
12856
12857
12858
12859
12860
12861
12862
12863
12864
12865
12866
12867
12868
12869
12870
12871
12872
12873
12874
12875
12876
12877
12878
12879
12880
12881
12882
12883
12884
12885
12886
12887
12888
12889
12890
12891
12892
12893
12894
12895
12896
12897
12898
12899
12900
12901
12902
12903
12904
12905
12906
12907
12908
12909
12910
12911
12912
12913
12914
12915
12916
12917
12918
12919
12920
12921
12922
12923
12924
12925
12926
12927
12928
12929
12930
12931
12932
12933
12934
12935
12936
12937
12938
12939
12940
12941
12942
12943
12944
12945
12946
12947
12948
12949
12950
12951
12952
12953
12954
12955
12956
12957
12958
12959
12960
12961
12962
12963
12964
12965
12966
12967
12968
12969
12970
12971
12972
12973
12974
12975
12976
12977
12978
12979
12980
12981
12982
12983
12984
12985
12986
12987
12988
12989
12990
12991
12992
12993
12994
12995
12996
12997
12998
12999
13000
13001
13002
13003
13004
13005
13006
13007
13008
13009
13010
13011
13012
13013
13014
13015
13016
13017
13018
13019
13020
13021
13022
13023
13024
13025
13026
13027
13028
13029
13030
13031
13032
13033
13034
13035
13036
13037
13038
13039
13040
13041
13042
13043
13044
13045
13046
13047
13048
13049
13050
13051
13052
13053
13054
13055
13056
13057
13058
13059
13060
13061
13062
13063
13064
13065
13066
13067
13068
13069
13070
13071
13072
13073
13074
13075
13076
13077
13078
13079
13080
13081
13082
13083
13084
13085
13086
13087
13088
13089
13090
13091
13092
13093
13094
13095
13096
13097
13098
13099
13100
13101
13102
13103
13104
13105
13106
13107
13108
13109
13110
13111
13112
13113
13114
13115
13116
13117
13118
13119
13120
13121
13122
13123
13124
13125
13126
13127
13128
13129
13130
13131
13132
13133
13134
13135
13136
13137
13138
13139
13140
13141
13142
13143
13144
13145
13146
13147
13148
13149
13150
13151
13152
13153
13154
13155
13156
13157
13158
13159
13160
13161
13162
13163
13164
13165
13166
13167
13168
13169
13170
13171
13172
13173
13174
13175
13176
13177
13178
13179
13180
13181
13182
13183
13184
13185
13186
13187
13188
13189
13190
13191
13192
13193
13194
13195
13196
13197
13198
13199
13200
13201
13202
13203
13204
13205
13206
13207
13208
13209
13210
13211
13212
13213
13214
13215
13216
13217
13218
13219
13220
13221
13222
13223
13224
13225
13226
13227
13228
13229
13230
13231
13232
13233
13234
13235
13236
13237
13238
13239
13240
13241
13242
13243
13244
13245
13246
13247
13248
13249
13250
13251
13252
13253
13254
13255
13256
13257
13258
13259
13260
13261
13262
13263
13264
13265
13266
13267
13268
13269
13270
13271
13272
13273
13274
13275
13276
13277
13278
13279
13280
13281
13282
13283
13284
13285
13286
13287
13288
13289
13290
13291
13292
13293
13294
13295
13296
13297
13298
13299
13300
13301
13302
13303
13304
13305
13306
13307
13308
13309
13310
13311
13312
13313
13314
13315
13316
13317
13318
13319
13320
13321
13322
13323
13324
13325
13326
13327
13328
13329
13330
13331
13332
13333
13334
13335
13336
13337
13338
13339
13340
13341
13342
13343
13344
13345
13346
13347
13348
13349
13350
13351
13352
13353
13354
13355
13356
13357
13358
13359
13360
13361
13362
13363
13364
13365
13366
13367
13368
13369
13370
13371
13372
13373
13374
13375
13376
13377
13378
13379
13380
13381
13382
13383
13384
13385
13386
13387
13388
13389
13390
13391
13392
13393
13394
13395
13396
13397
13398
13399
13400
13401
13402
13403
13404
13405
13406
13407
13408
13409
13410
13411
13412
13413
13414
13415
13416
13417
13418
13419
13420
13421
13422
13423
13424
13425
13426
13427
13428
13429
13430
13431
13432
13433
13434
13435
13436
13437
13438
13439
13440
13441
13442
13443
13444
13445
13446
13447
13448
13449
13450
13451
13452
13453
13454
13455
13456
13457
13458
13459
13460
13461
13462
13463
13464
13465
13466
13467
13468
13469
13470
13471
13472
13473
13474
13475
13476
13477
13478
13479
13480
13481
13482
13483
13484
13485
13486
13487
13488
13489
13490
13491
13492
13493
13494
13495
13496
13497
13498
13499
13500
13501
13502
13503
13504
13505
13506
13507
13508
13509
13510
13511
13512
13513
13514
13515
13516
13517
13518
13519
13520
13521
13522
13523
13524
13525
13526
13527
13528
13529
13530
13531
13532
13533
13534
13535
13536
13537
13538
13539
13540
13541
13542
13543
13544
13545
13546
13547
13548
13549
13550
13551
13552
13553
13554
13555
13556
13557
13558
13559
13560
13561
13562
13563
13564
13565
13566
13567
13568
13569
13570
13571
13572
13573
13574
13575
13576
13577
13578
13579
13580
13581
13582
13583
13584
13585
13586
13587
13588
13589
13590
13591
13592
13593
13594
13595
13596
13597
13598
13599
13600
13601
13602
13603
13604
13605
13606
13607
13608
13609
13610
13611
13612
13613
13614
13615
13616
13617
13618
13619
13620
13621
13622
13623
13624
13625
13626
13627
13628
13629
13630
13631
13632
13633
13634
13635
13636
13637
13638
13639
13640
13641
13642
13643
13644
13645
13646
13647
13648
13649
13650
13651
13652
13653
13654
13655
13656
13657
13658
13659
13660
13661
13662
13663
13664
13665
13666
13667
13668
13669
13670
13671
13672
13673
13674
13675
13676
13677
13678
13679
13680
13681
13682
13683
13684
13685
13686
13687
13688
13689
13690
13691
13692
13693
13694
13695
13696
13697
13698
13699
13700
13701
13702
13703
13704
13705
13706
13707
13708
13709
13710
13711
13712
13713
13714
13715
13716
13717
13718
13719
13720
13721
13722
13723
13724
13725
13726
13727
13728
13729
13730
13731
13732
13733
13734
13735
13736
13737
13738
13739
13740
13741
13742
13743
13744
13745
13746
13747
13748
13749
13750
13751
13752
13753
13754
13755
13756
13757
13758
13759
13760
13761
13762
13763
13764
13765
13766
13767
13768
13769
13770
13771
13772
13773
13774
13775
13776
13777
13778
13779
13780
13781
13782
13783
13784
13785
13786
13787
13788
13789
13790
13791
13792
13793
13794
13795
13796
13797
13798
13799
13800
13801
13802
13803
13804
13805
13806
13807
13808
13809
13810
13811
13812
13813
13814
13815
13816
13817
13818
13819
13820
13821
13822
13823
13824
13825
13826
13827
13828
13829
13830
13831
13832
13833
13834
13835
13836
13837
13838
13839
13840
13841
13842
13843
13844
13845
13846
13847
13848
13849
13850
13851
13852
13853
13854
13855
13856
13857
13858
13859
13860
13861
13862
13863
13864
13865
13866
13867
13868
13869
13870
13871
13872
13873
13874
13875
13876
13877
13878
13879
13880
13881
13882
13883
13884
13885
13886
13887
13888
13889
13890
13891
13892
13893
13894
13895
13896
13897
13898
13899
13900
13901
13902
13903
13904
13905
13906
13907
13908
13909
13910
13911
13912
13913
13914
13915
13916
13917
13918
13919
13920
13921
13922
13923
13924
13925
13926
13927
13928
13929
13930
13931
13932
13933
13934
13935
13936
13937
13938
13939
13940
13941
13942
13943
13944
13945
13946
13947
13948
13949
13950
13951
13952
13953
13954
13955
13956
13957
13958
13959
13960
13961
13962
13963
13964
13965
13966
13967
13968
13969
13970
13971
13972
13973
13974
13975
13976
13977
13978
13979
13980
13981
13982
13983
13984
13985
13986
13987
13988
13989
13990
13991
13992
13993
13994
13995
13996
13997
13998
13999
14000
14001
14002
14003
14004
14005
14006
14007
14008
14009
14010
14011
14012
14013
14014
14015
14016
14017
14018
14019
14020
14021
14022
14023
14024
14025
14026
14027
14028
14029
14030
14031
14032
14033
14034
14035
14036
14037
14038
14039
14040
14041
14042
14043
14044
14045
14046
14047
14048
14049
14050
14051
14052
14053
14054
14055
14056
14057
14058
14059
14060
14061
14062
14063
14064
14065
14066
14067
14068
14069
14070
14071
14072
14073
14074
14075
14076
14077
14078
14079
14080
14081
14082
14083
14084
14085
14086
14087
14088
14089
14090
14091
14092
14093
14094
14095
14096
14097
14098
14099
14100
14101
14102
14103
14104
14105
14106
14107
14108
14109
14110
14111
14112
14113
14114
14115
14116
14117
14118
14119
14120
14121
14122
14123
14124
14125
14126
14127
14128
14129
14130
14131
14132
14133
14134
14135
14136
14137
14138
14139
14140
14141
14142
14143
14144
14145
14146
14147
14148
14149
14150
14151
14152
14153
14154
14155
14156
14157
14158
14159
14160
14161
14162
14163
14164
14165
14166
14167
14168
14169
14170
14171
14172
14173
14174
14175
14176
14177
14178
14179
14180
14181
14182
14183
14184
14185
14186
14187
14188
14189
14190
14191
14192
14193
14194
14195
14196
14197
14198
14199
14200
14201
14202
14203
14204
14205
14206
14207
14208
14209
14210
14211
14212
14213
14214
14215
14216
14217
14218
14219
14220
14221
14222
14223
14224
14225
14226
14227
14228
14229
14230
14231
14232
14233
14234
14235
14236
14237
14238
14239
14240
14241
14242
14243
14244
14245
14246
14247
14248
14249
14250
14251
14252
14253
14254
14255
14256
14257
14258
14259
14260
14261
14262
14263
14264
14265
14266
14267
14268
14269
14270
14271
14272
14273
14274
14275
14276
14277
14278
14279
14280
14281
14282
14283
14284
14285
14286
14287
14288
14289
14290
14291
14292
14293
14294
14295
14296
14297
14298
14299
14300
14301
14302
14303
14304
14305
14306
14307
14308
14309
14310
14311
14312
14313
14314
14315
14316
14317
14318
14319
14320
14321
14322
14323
14324
14325
14326
14327
14328
14329
14330
14331
14332
14333
14334
14335
14336
14337
14338
14339
14340
14341
14342
14343
14344
14345
14346
14347
14348
14349
14350
14351
14352
14353
14354
14355
14356
14357
14358
14359
14360
14361
14362
14363
14364
14365
14366
14367
14368
14369
14370
14371
14372
14373
14374
14375
14376
14377
14378
14379
14380
14381
14382
14383
14384
14385
14386
14387
14388
14389
14390
14391
14392
14393
14394
14395
14396
14397
14398
14399
14400
14401
14402
14403
14404
14405
14406
14407
14408
14409
14410
14411
14412
14413
14414
14415
14416
14417
14418
14419
14420
14421
14422
14423
14424
14425
14426
14427
14428
14429
14430
14431
14432
14433
14434
14435
14436
14437
14438
14439
14440
14441
14442
14443
14444
14445
14446
14447
14448
14449
14450
14451
14452
14453
14454
14455
14456
14457
14458
14459
14460
14461
14462
14463
14464
14465
14466
14467
14468
14469
14470
14471
14472
14473
14474
14475
14476
14477
14478
14479
14480
14481
14482
14483
14484
14485
14486
14487
14488
14489
14490
14491
14492
14493
14494
14495
14496
14497
14498
14499
14500
14501
14502
14503
14504
14505
14506
14507
14508
14509
14510
14511
14512
14513
14514
14515
14516
14517
14518
14519
14520
14521
14522
14523
14524
14525
14526
14527
14528
14529
14530
14531
14532
14533
14534
14535
14536
14537
14538
14539
14540
14541
14542
14543
14544
14545
14546
14547
14548
14549
14550
14551
14552
14553
14554
14555
14556
14557
14558
14559
14560
14561
14562
14563
14564
14565
14566
14567
14568
14569
14570
14571
14572
14573
14574
14575
14576
14577
14578
14579
14580
14581
14582
14583
14584
14585
14586
14587
14588
14589
14590
14591
14592
14593
14594
14595
14596
14597
14598
14599
14600
14601
14602
14603
14604
14605
14606
14607
14608
14609
14610
14611
14612
14613
14614
14615
14616
14617
14618
14619
14620
14621
14622
14623
14624
14625
14626
14627
14628
14629
14630
14631
14632
14633
14634
14635
14636
14637
14638
14639
14640
14641
14642
14643
14644
14645
14646
14647
14648
14649
14650
14651
14652
14653
14654
14655
14656
14657
14658
14659
14660
14661
14662
14663
14664
14665
14666
14667
14668
14669
14670
14671
14672
14673
14674
14675
14676
14677
14678
14679
14680
14681
14682
14683
14684
14685
14686
14687
14688
14689
14690
14691
14692
14693
14694
14695
14696
14697
14698
14699
14700
14701
14702
14703
14704
14705
14706
14707
14708
14709
14710
14711
14712
14713
14714
14715
14716
14717
14718
14719
14720
14721
14722
14723
14724
14725
14726
14727
14728
14729
14730
14731
14732
14733
14734
14735
14736
14737
14738
14739
14740
14741
14742
14743
14744
14745
14746
14747
14748
14749
14750
14751
14752
14753
14754
14755
14756
14757
14758
14759
14760
14761
14762
14763
14764
14765
14766
14767
14768
14769
14770
14771
14772
14773
14774
14775
14776
14777
14778
14779
14780
14781
14782
14783
14784
14785
14786
14787
14788
14789
14790
14791
14792
14793
14794
14795
14796
14797
14798
14799
14800
14801
14802
14803
14804
14805
14806
14807
14808
14809
14810
14811
14812
14813
14814
14815
14816
14817
14818
14819
14820
14821
14822
14823
14824
14825
14826
14827
14828
14829
14830
14831
14832
14833
14834
14835
14836
14837
14838
14839
14840
14841
14842
14843
14844
14845
14846
14847
14848
14849
14850
14851
14852
14853
14854
14855
14856
14857
14858
14859
14860
14861
14862
14863
14864
14865
14866
14867
14868
14869
14870
14871
14872
14873
14874
14875
14876
14877
14878
14879
14880
14881
14882
14883
14884
14885
14886
14887
14888
14889
14890
14891
14892
14893
14894
14895
14896
14897
14898
14899
14900
14901
14902
14903
14904
14905
14906
14907
14908
14909
14910
14911
14912
14913
14914
14915
14916
14917
14918
14919
14920
14921
14922
14923
14924
14925
14926
14927
14928
14929
14930
14931
14932
14933
14934
14935
14936
14937
14938
14939
14940
14941
14942
14943
14944
14945
14946
14947
14948
14949
14950
14951
14952
14953
14954
14955
14956
14957
14958
14959
14960
14961
14962
14963
14964
14965
14966
14967
14968
14969
14970
14971
14972
14973
14974
14975
14976
14977
14978
14979
14980
14981
14982
14983
14984
14985
14986
14987
14988
14989
14990
14991
14992
14993
14994
14995
14996
14997
14998
14999
15000
15001
15002
15003
15004
15005
15006
15007
15008
15009
15010
15011
15012
15013
15014
15015
15016
15017
15018
15019
15020
15021
15022
15023
15024
15025
15026
15027
15028
15029
15030
15031
15032
15033
15034
15035
15036
15037
15038
15039
15040
15041
15042
15043
15044
15045
15046
15047
15048
15049
15050
15051
15052
15053
15054
15055
15056
15057
15058
15059
15060
15061
15062
15063
15064
15065
15066
15067
15068
15069
15070
15071
15072
15073
15074
15075
15076
15077
15078
15079
15080
15081
15082
15083
15084
15085
15086
15087
15088
15089
15090
15091
15092
15093
15094
15095
15096
15097
15098
15099
15100
15101
15102
15103
15104
15105
15106
15107
15108
15109
15110
15111
15112
15113
15114
15115
15116
15117
15118
15119
15120
15121
15122
15123
15124
15125
15126
15127
15128
15129
15130
15131
15132
15133
15134
15135
15136
15137
15138
15139
15140
15141
15142
15143
15144
15145
15146
15147
15148
15149
15150
15151
15152
15153
15154
15155
15156
15157
15158
15159
15160
15161
15162
15163
15164
15165
15166
15167
15168
15169
15170
15171
15172
15173
15174
15175
15176
15177
15178
15179
15180
15181
15182
15183
15184
15185
15186
15187
15188
15189
15190
15191
15192
15193
15194
15195
15196
15197
15198
15199
15200
15201
15202
15203
15204
15205
15206
15207
15208
15209
15210
15211
15212
15213
15214
15215
15216
15217
15218
15219
15220
15221
15222
15223
15224
15225
15226
15227
15228
15229
15230
15231
15232
15233
15234
15235
15236
15237
15238
15239
15240
15241
15242
15243
15244
15245
15246
15247
15248
15249
15250
15251
15252
15253
15254
15255
15256
15257
15258
15259
15260
15261
15262
15263
15264
15265
15266
15267
15268
15269
15270
15271
15272
15273
15274
15275
15276
15277
15278
15279
15280
15281
15282
15283
15284
15285
15286
15287
15288
15289
15290
15291
15292
15293
15294
15295
15296
15297
15298
15299
15300
15301
15302
15303
15304
15305
15306
15307
15308
15309
15310
15311
15312
15313
15314
15315
15316
15317
15318
15319
15320
15321
15322
15323
15324
15325
15326
15327
15328
15329
15330
15331
15332
15333
15334
15335
15336
15337
15338
15339
15340
15341
15342
15343
15344
15345
15346
15347
15348
15349
15350
15351
15352
15353
15354
15355
15356
15357
15358
15359
15360
15361
15362
15363
15364
15365
15366
15367
15368
15369
15370
15371
15372
15373
15374
15375
15376
15377
15378
15379
15380
15381
15382
15383
15384
15385
15386
15387
15388
15389
15390
15391
15392
15393
15394
15395
15396
15397
15398
15399
15400
15401
15402
15403
15404
15405
15406
15407
15408
15409
15410
15411
15412
15413
15414
15415
15416
15417
15418
15419
15420
15421
15422
15423
15424
15425
15426
15427
15428
15429
15430
15431
15432
15433
15434
15435
15436
15437
15438
15439
15440
15441
15442
15443
15444
15445
15446
15447
15448
15449
15450
15451
15452
15453
15454
15455
15456
15457
15458
15459
15460
15461
15462
15463
15464
15465
15466
15467
15468
15469
15470
15471
15472
15473
15474
15475
15476
15477
15478
15479
15480
15481
15482
15483
15484
15485
15486
15487
15488
15489
15490
15491
15492
15493
15494
15495
15496
15497
15498
15499
15500
15501
15502
15503
15504
15505
15506
15507
15508
15509
15510
15511
15512
15513
15514
15515
15516
15517
15518
15519
15520
15521
15522
15523
15524
15525
15526
15527
15528
15529
15530
15531
15532
15533
15534
15535
15536
15537
15538
15539
15540
15541
15542
15543
15544
15545
15546
15547
15548
15549
15550
15551
15552
15553
15554
15555
15556
15557
15558
15559
15560
15561
15562
15563
15564
15565
15566
15567
15568
15569
15570
15571
15572
15573
15574
15575
15576
15577
15578
15579
15580
15581
15582
15583
15584
15585
15586
15587
15588
15589
15590
15591
15592
15593
15594
15595
15596
15597
15598
15599
15600
15601
15602
15603
15604
15605
15606
15607
15608
15609
15610
15611
15612
15613
15614
15615
15616
15617
15618
15619
15620
15621
15622
15623
15624
15625
15626
15627
15628
15629
15630
15631
15632
15633
15634
15635
15636
15637
15638
15639
15640
15641
15642
15643
15644
15645
15646
15647
15648
15649
15650
15651
15652
15653
15654
15655
15656
15657
15658
15659
15660
15661
15662
15663
15664
15665
15666
15667
15668
15669
15670
15671
15672
15673
15674
15675
15676
15677
15678
15679
15680
15681
15682
15683
15684
15685
15686
15687
15688
15689
15690
15691
15692
15693
15694
15695
15696
15697
15698
15699
15700
15701
15702
15703
15704
15705
15706
15707
15708
15709
15710
15711
15712
15713
15714
15715
15716
15717
15718
15719
15720
15721
15722
15723
15724
15725
15726
15727
15728
15729
15730
15731
15732
15733
15734
15735
15736
15737
15738
15739
15740
15741
15742
15743
15744
15745
15746
15747
15748
15749
15750
15751
15752
15753
15754
15755
15756
15757
15758
15759
15760
15761
15762
15763
15764
15765
15766
15767
15768
15769
15770
15771
15772
15773
15774
15775
15776
15777
15778
15779
15780
15781
15782
15783
15784
15785
15786
15787
15788
15789
15790
15791
15792
15793
15794
15795
15796
15797
15798
15799
15800
15801
15802
15803
15804
15805
15806
15807
15808
15809
15810
15811
15812
15813
15814
15815
15816
15817
15818
15819
15820
15821
15822
15823
15824
15825
15826
15827
15828
15829
15830
15831
15832
15833
15834
15835
15836
15837
15838
15839
15840
15841
15842
15843
15844
15845
15846
15847
15848
15849
15850
15851
15852
15853
15854
15855
15856
15857
15858
15859
15860
15861
15862
15863
15864
15865
15866
15867
15868
15869
15870
15871
15872
15873
15874
15875
15876
15877
15878
15879
15880
15881
15882
15883
15884
15885
15886
15887
15888
15889
15890
15891
15892
15893
15894
15895
15896
15897
15898
15899
15900
15901
15902
15903
15904
15905
15906
15907
15908
15909
15910
15911
15912
15913
15914
15915
15916
15917
15918
15919
15920
15921
15922
15923
15924
15925
15926
15927
15928
15929
15930
15931
15932
15933
15934
15935
15936
15937
15938
15939
15940
15941
15942
15943
15944
15945
15946
15947
15948
15949
15950
15951
15952
15953
15954
15955
15956
15957
15958
15959
15960
15961
15962
15963
15964
15965
15966
15967
15968
15969
15970
15971
15972
15973
15974
15975
15976
15977
15978
15979
15980
15981
15982
15983
15984
15985
15986
15987
15988
15989
15990
15991
15992
15993
15994
15995
15996
15997
15998
15999
16000
16001
16002
16003
16004
16005
16006
16007
16008
16009
16010
16011
16012
16013
16014
16015
16016
16017
16018
16019
16020
16021
16022
16023
16024
16025
16026
16027
16028
16029
16030
16031
16032
16033
16034
16035
16036
16037
16038
16039
16040
16041
16042
16043
16044
16045
16046
16047
16048
16049
16050
16051
16052
16053
16054
16055
16056
16057
16058
16059
16060
16061
16062
16063
16064
16065
16066
16067
16068
16069
16070
16071
16072
16073
16074
16075
16076
16077
16078
16079
16080
16081
16082
16083
16084
16085
16086
16087
16088
16089
16090
16091
16092
16093
16094
16095
16096
16097
16098
16099
16100
16101
16102
16103
16104
16105
16106
16107
16108
16109
16110
16111
16112
16113
16114
16115
16116
16117
16118
16119
16120
16121
16122
16123
16124
16125
16126
16127
16128
16129
16130
16131
16132
16133
16134
16135
16136
16137
16138
16139
16140
16141
16142
16143
16144
16145
16146
16147
16148
16149
16150
16151
16152
16153
16154
16155
16156
16157
16158
16159
16160
16161
16162
16163
16164
16165
16166
16167
16168
16169
16170
16171
16172
16173
16174
16175
16176
16177
16178
16179
16180
16181
16182
16183
16184
16185
16186
16187
16188
16189
16190
16191
16192
16193
16194
16195
16196
16197
16198
16199
16200
16201
16202
16203
16204
16205
16206
16207
16208
16209
16210
16211
16212
16213
16214
16215
16216
16217
16218
16219
16220
16221
16222
16223
16224
16225
16226
16227
16228
16229
16230
16231
16232
16233
16234
16235
16236
16237
16238
16239
16240
16241
16242
16243
16244
16245
16246
16247
16248
16249
16250
16251
16252
16253
16254
16255
16256
16257
16258
16259
16260
16261
16262
16263
16264
16265
16266
16267
16268
16269
16270
16271
16272
16273
16274
16275
16276
16277
16278
16279
16280
16281
16282
16283
16284
16285
16286
16287
16288
16289
16290
16291
16292
16293
16294
16295
16296
16297
16298
16299
16300
16301
16302
16303
16304
16305
16306
16307
16308
16309
16310
16311
16312
16313
16314
16315
16316
16317
16318
16319
16320
16321
16322
16323
16324
16325
16326
16327
16328
16329
16330
16331
16332
16333
16334
16335
16336
16337
16338
16339
16340
16341
16342
16343
16344
16345
16346
16347
16348
16349
16350
16351
16352
16353
16354
16355
16356
16357
16358
16359
16360
16361
16362
16363
16364
16365
16366
16367
16368
16369
16370
16371
16372
16373
16374
16375
16376
16377
16378
16379
16380
16381
16382
16383
16384
16385
16386
16387
16388
16389
16390
16391
16392
16393
16394
16395
16396
16397
16398
16399
16400
16401
16402
16403
16404
16405
16406
16407
16408
16409
16410
16411
16412
16413
16414
16415
16416
16417
16418
16419
16420
16421
16422
16423
16424
16425
16426
16427
16428
16429
16430
16431
16432
16433
16434
16435
16436
16437
16438
16439
16440
16441
16442
16443
16444
16445
16446
16447
16448
16449
16450
16451
16452
16453
16454
16455
16456
16457
16458
16459
16460
16461
16462
16463
16464
16465
16466
16467
16468
16469
16470
16471
16472
16473
16474
16475
16476
16477
16478
16479
16480
16481
16482
16483
16484
16485
16486
16487
16488
16489
16490
16491
16492
16493
16494
16495
16496
16497
16498
16499
16500
16501
16502
16503
16504
16505
16506
16507
16508
16509
16510
16511
16512
16513
16514
16515
16516
16517
16518
16519
16520
16521
16522
16523
16524
16525
16526
16527
16528
16529
16530
16531
16532
16533
16534
16535
16536
16537
16538
16539
16540
16541
16542
16543
16544
16545
16546
16547
16548
16549
16550
16551
16552
16553
16554
16555
16556
16557
16558
16559
16560
16561
16562
16563
16564
16565
16566
16567
16568
16569
16570
16571
16572
16573
16574
16575
16576
16577
16578
16579
16580
16581
16582
16583
16584
16585
16586
16587
16588
16589
16590
16591
16592
16593
16594
16595
16596
16597
16598
16599
16600
16601
16602
16603
16604
16605
16606
16607
16608
16609
16610
16611
16612
16613
16614
16615
16616
16617
16618
16619
16620
16621
16622
16623
16624
16625
16626
16627
16628
16629
16630
16631
16632
16633
16634
16635
16636
16637
16638
16639
16640
16641
16642
16643
16644
16645
16646
16647
16648
16649
16650
16651
16652
16653
16654
16655
16656
16657
16658
16659
16660
16661
16662
16663
16664
16665
16666
16667
16668
16669
16670
16671
16672
16673
16674
16675
16676
16677
16678
16679
16680
16681
16682
16683
16684
16685
16686
16687
16688
16689
16690
16691
16692
16693
16694
16695
16696
16697
16698
16699
16700
16701
16702
16703
16704
16705
16706
16707
16708
16709
16710
16711
16712
16713
16714
16715
16716
16717
16718
16719
16720
16721
16722
16723
16724
16725
16726
16727
16728
16729
16730
16731
16732
16733
16734
16735
16736
16737
16738
16739
16740
16741
16742
16743
16744
16745
16746
16747
16748
16749
16750
16751
16752
16753
16754
16755
16756
16757
16758
16759
16760
16761
16762
16763
16764
16765
16766
16767
16768
16769
16770
16771
16772
16773
16774
16775
16776
16777
16778
16779
16780
16781
16782
16783
16784
16785
16786
16787
16788
16789
16790
16791
16792
16793
16794
16795
16796
16797
16798
16799
16800
16801
16802
16803
16804
16805
16806
16807
16808
16809
16810
16811
16812
16813
16814
16815
16816
16817
16818
16819
16820
16821
16822
16823
16824
16825
16826
16827
16828
16829
16830
16831
16832
16833
16834
16835
16836
16837
16838
16839
16840
16841
16842
16843
16844
16845
16846
16847
16848
16849
16850
16851
16852
16853
16854
16855
16856
16857
16858
16859
16860
16861
16862
16863
16864
16865
16866
16867
16868
16869
16870
16871
16872
16873
16874
16875
16876
16877
16878
16879
16880
16881
16882
16883
16884
16885
16886
16887
16888
16889
16890
16891
16892
16893
16894
16895
16896
16897
16898
16899
16900
16901
16902
16903
16904
16905
16906
16907
16908
16909
16910
16911
16912
16913
16914
16915
16916
16917
16918
16919
16920
16921
16922
16923
16924
16925
16926
16927
16928
16929
16930
16931
16932
16933
16934
16935
16936
16937
16938
16939
16940
16941
16942
16943
16944
16945
16946
16947
16948
16949
16950
16951
16952
16953
16954
16955
16956
16957
16958
16959
16960
16961
16962
16963
16964
16965
16966
16967
16968
16969
16970
16971
16972
16973
16974
16975
16976
16977
16978
16979
16980
16981
16982
16983
16984
16985
16986
16987
16988
16989
16990
16991
16992
16993
16994
16995
16996
16997
16998
16999
17000
17001
17002
17003
17004
17005
17006
17007
17008
17009
17010
17011
17012
17013
17014
17015
17016
17017
17018
17019
17020
17021
17022
17023
17024
17025
17026
17027
17028
17029
17030
17031
17032
17033
17034
17035
17036
17037
17038
17039
17040
17041
17042
17043
17044
17045
17046
17047
17048
17049
17050
17051
17052
17053
17054
17055
17056
17057
17058
17059
17060
17061
17062
17063
17064
17065
17066
17067
17068
17069
17070
17071
17072
17073
17074
17075
17076
17077
17078
17079
17080
17081
17082
17083
17084
17085
17086
17087
17088
17089
17090
17091
17092
17093
17094
17095
17096
17097
17098
17099
17100
17101
17102
17103
17104
17105
17106
17107
17108
17109
17110
17111
17112
17113
17114
17115
17116
17117
17118
17119
17120
17121
17122
17123
17124
17125
17126
17127
17128
17129
17130
17131
17132
17133
17134
17135
17136
17137
17138
17139
17140
17141
17142
17143
17144
17145
17146
17147
17148
17149
17150
17151
17152
17153
17154
17155
17156
17157
17158
17159
17160
17161
17162
17163
17164
17165
17166
17167
17168
17169
17170
17171
17172
17173
17174
17175
17176
17177
17178
17179
17180
17181
17182
17183
17184
17185
17186
17187
17188
17189
17190
17191
17192
17193
17194
17195
17196
17197
17198
17199
17200
17201
17202
17203
17204
17205
17206
17207
17208
17209
17210
17211
17212
17213
17214
17215
17216
17217
17218
17219
17220
17221
17222
17223
17224
17225
17226
17227
17228
17229
17230
17231
17232
17233
17234
17235
17236
17237
17238
17239
17240
17241
17242
17243
17244
17245
17246
17247
17248
17249
17250
17251
17252
17253
17254
17255
17256
17257
17258
17259
17260
17261
17262
17263
17264
17265
17266
17267
17268
17269
17270
17271
17272
17273
17274
17275
17276
17277
17278
17279
17280
17281
17282
17283
17284
17285
17286
17287
17288
17289
17290
17291
17292
17293
17294
17295
17296
17297
17298
17299
17300
17301
17302
17303
17304
17305
17306
17307
17308
17309
17310
17311
17312
17313
17314
17315
17316
17317
17318
17319
17320
17321
17322
17323
17324
17325
17326
17327
17328
17329
17330
17331
17332
17333
17334
17335
17336
17337
17338
17339
17340
17341
17342
17343
17344
17345
17346
17347
17348
17349
17350
17351
17352
17353
17354
17355
17356
17357
17358
17359
17360
17361
17362
17363
17364
17365
17366
17367
17368
17369
17370
17371
17372
17373
17374
17375
17376
17377
17378
17379
17380
17381
17382
17383
17384
17385
17386
17387
17388
17389
17390
17391
17392
17393
17394
17395
17396
17397
17398
17399
17400
17401
17402
17403
17404
17405
17406
17407
17408
17409
17410
17411
17412
17413
17414
17415
17416
17417
17418
17419
17420
17421
17422
17423
17424
17425
17426
17427
17428
17429
17430
17431
17432
17433
17434
17435
17436
17437
17438
17439
17440
17441
17442
17443
17444
17445
17446
17447
17448
17449
17450
17451
17452
17453
17454
17455
17456
17457
17458
17459
17460
17461
17462
17463
17464
17465
17466
17467
17468
17469
17470
17471
17472
17473
17474
17475
17476
17477
17478
17479
17480
17481
17482
17483
17484
17485
17486
17487
17488
17489
17490
17491
17492
17493
17494
17495
17496
17497
17498
17499
17500
17501
17502
17503
17504
17505
17506
17507
17508
17509
17510
17511
17512
17513
17514
17515
17516
17517
17518
17519
17520
17521
17522
17523
17524
17525
17526
17527
17528
17529
17530
17531
17532
17533
17534
17535
17536
17537
17538
17539
17540
17541
17542
17543
17544
17545
17546
17547
17548
17549
17550
17551
17552
17553
17554
17555
17556
17557
17558
17559
17560
17561
17562
17563
17564
17565
17566
17567
17568
17569
17570
17571
17572
17573
17574
17575
17576
17577
17578
17579
17580
17581
17582
17583
17584
17585
17586
17587
17588
17589
17590
17591
17592
17593
17594
17595
17596
17597
17598
17599
17600
17601
17602
17603
17604
17605
17606
17607
17608
17609
17610
17611
17612
17613
17614
17615
17616
17617
17618
17619
17620
17621
17622
17623
17624
17625
17626
17627
17628
17629
17630
17631
17632
17633
17634
17635
17636
17637
17638
17639
17640
17641
17642
17643
17644
17645
17646
17647
17648
17649
17650
17651
17652
17653
17654
17655
17656
17657
17658
17659
17660
17661
17662
17663
17664
17665
17666
17667
17668
17669
17670
17671
17672
17673
17674
17675
17676
17677
17678
17679
17680
17681
17682
17683
17684
17685
17686
17687
17688
17689
17690
17691
17692
17693
17694
17695
17696
17697
17698
17699
17700
17701
17702
17703
17704
17705
17706
17707
17708
17709
17710
17711
17712
17713
17714
17715
17716
17717
17718
17719
17720
17721
17722
17723
17724
17725
17726
17727
17728
17729
17730
17731
17732
17733
17734
17735
17736
17737
17738
17739
17740
17741
17742
17743
17744
17745
17746
17747
17748
17749
17750
17751
17752
17753
17754
17755
17756
17757
17758
17759
17760
17761
17762
17763
17764
17765
17766
17767
17768
17769
17770
17771
17772
17773
17774
17775
17776
17777
17778
17779
17780
17781
17782
17783
17784
17785
17786
17787
17788
17789
17790
17791
17792
17793
17794
17795
17796
17797
17798
17799
17800
17801
17802
17803
17804
17805
17806
17807
17808
17809
17810
17811
17812
17813
17814
17815
17816
17817
17818
17819
17820
17821
17822
17823
17824
17825
17826
17827
17828
17829
17830
17831
17832
17833
17834
17835
17836
17837
17838
17839
17840
17841
17842
17843
17844
17845
17846
17847
17848
17849
17850
17851
17852
17853
17854
17855
17856
17857
17858
17859
17860
17861
17862
17863
17864
17865
17866
17867
17868
17869
17870
17871
17872
17873
17874
17875
17876
17877
17878
17879
17880
17881
17882
17883
17884
17885
17886
17887
17888
17889
17890
17891
17892
17893
17894
17895
17896
17897
17898
17899
17900
17901
17902
17903
17904
17905
17906
17907
17908
17909
17910
17911
17912
17913
17914
17915
17916
17917
17918
17919
17920
17921
17922
17923
17924
17925
17926
17927
17928
17929
17930
17931
17932
17933
17934
17935
17936
17937
17938
17939
17940
17941
17942
17943
17944
17945
17946
17947
17948
17949
17950
17951
17952
17953
17954
17955
17956
17957
17958
17959
17960
17961
17962
17963
17964
17965
17966
17967
17968
17969
17970
17971
17972
17973
17974
17975
17976
17977
17978
17979
17980
17981
17982
17983
17984
17985
17986
17987
17988
17989
17990
17991
17992
17993
17994
17995
17996
17997
17998
17999
18000
18001
18002
18003
18004
18005
18006
18007
18008
18009
18010
18011
18012
18013
18014
18015
18016
18017
18018
18019
18020
18021
18022
18023
18024
18025
18026
18027
18028
18029
18030
18031
18032
18033
18034
18035
18036
18037
18038
18039
18040
18041
18042
18043
18044
18045
18046
18047
18048
18049
18050
18051
18052
18053
18054
18055
18056
18057
18058
18059
18060
18061
18062
18063
18064
18065
18066
18067
18068
18069
18070
18071
18072
18073
18074
18075
18076
18077
18078
18079
18080
18081
18082
18083
18084
18085
18086
18087
18088
18089
18090
18091
18092
18093
18094
18095
18096
18097
18098
18099
18100
18101
18102
18103
18104
18105
18106
18107
18108
18109
18110
18111
18112
18113
18114
18115
18116
18117
18118
18119
18120
18121
18122
18123
18124
18125
18126
18127
18128
18129
18130
18131
18132
18133
18134
18135
18136
18137
18138
18139
18140
18141
18142
18143
18144
18145
18146
18147
18148
18149
18150
18151
18152
18153
18154
18155
18156
18157
18158
18159
18160
18161
18162
18163
18164
18165
18166
18167
18168
18169
18170
18171
18172
18173
18174
18175
18176
18177
18178
18179
18180
18181
18182
18183
18184
18185
18186
18187
18188
18189
18190
18191
18192
18193
18194
18195
18196
18197
18198
18199
18200
18201
18202
18203
18204
18205
18206
18207
18208
18209
18210
18211
18212
18213
18214
18215
18216
18217
18218
18219
18220
18221
18222
18223
18224
18225
18226
18227
18228
18229
18230
18231
18232
18233
18234
18235
18236
18237
18238
18239
18240
18241
18242
18243
18244
18245
18246
18247
18248
18249
18250
18251
18252
18253
18254
18255
18256
18257
18258
18259
18260
18261
18262
18263
18264
18265
18266
18267
18268
18269
18270
18271
18272
18273
18274
18275
18276
18277
18278
18279
18280
18281
18282
18283
18284
18285
18286
18287
18288
18289
18290
18291
18292
18293
18294
18295
18296
18297
18298
18299
18300
18301
18302
18303
18304
18305
18306
18307
18308
18309
18310
18311
18312
18313
18314
18315
18316
18317
18318
18319
18320
18321
18322
18323
18324
18325
18326
18327
18328
18329
18330
18331
18332
18333
18334
18335
18336
18337
18338
18339
18340
18341
18342
18343
18344
18345
18346
18347
% -*- coding: iso-latin-1; -*-
%<*doc>
\def\lasttimestamp{Time-stamp <03-10-2013 22:14:18 CEST *>}
%</doc>
% xint.dtx, 1.09b (2013/10/03)
%
% Copyright (C) 2013 by Jean-François Burnol
%
% Style files which will self-extract from xint.dtx:
% (base) xint.sty       Expandable operations on long numbers
%        xintfrac.sty   Expandable operations on fractions
%        xintexpr.sty   Expandable expression parser
%        xintbinhex.sty Expandable binary and hexadecimal conversions
%        xintgcd.sty    Euclidean algorithm with xint package
%        xintseries.sty Expandable partial sums with xint package
%        xintcfrac.sty  Expandable continued fractions with xint package
% installation: --> TDS:tex/generic/xint/
%
%  License
%  =======
%
%  This work consists of the source file xint.dtx and of its derived files:
%  xint.sty, xintfrac.sty, xintexpr.sty, xintbinhex.sty, xintgcd.sty,
%  xintseries.sty, xintcfrac.sty, as well as xint.ins and the documentation
%  xint.pdf (or xint.dvi).
%
%     This work may be distributed and/or modified under the
%     conditions of the LaTeX Project Public License, either
%     version 1.3c of this license or (at your option) any later
%     version. This version of this license is in 
%          http://www.latex-project.org/lppl/lppl-1-3c.txt
%     and the latest version of this license is in
%          http://www.latex-project.org/lppl.txt
%     and version 1.3 or later is part of all distributions of
%     LaTeX version 2005/12/01 or later. 
% 
%  The author of this work is Jean-Francois Burnol <jfbu at free dot fr>. 
%  This work has the LPPL maintenance status `author-maintained'.
% 
%  Installation and Usage:
%  =======================
%
%  Run tex or latex on xint.dtx.
% 
%  This will extract the style files xint.sty, xintfrac.sty, xintexpr.sty,
%  xintbinhex.sty, xintgcd.sty, xintseries.sty, xintcfrac.sty (and xint.ins).
%
%  Files with the same names and in the same repertory will be overwritten.
%  The tex (not latex) run will stop with the complaint that it does not
%  understand \NeedsTeXFormat, but the style files will already have been
%  extracted by that time.
%
%  Alternatively, run tex or latex on xint.ins if available.
%
%  To get xint.pdf run pdflatex thrice on xint.dtx
%  
%             xint.sty |
%         xintfrac.sty |
%         xintexpr.sty | 
%       xintbinhex.sty | --> TDS:tex/generic/xint/
%          xintgcd.sty |
%       xintseries.sty |
%        xintcfrac.sty |
%             xint.dtx   --> TDS:source/generic/xint/
%             xint.pdf   --> TDS:doc/generic/xint/
% 
%  It may be necessary to then refresh the TeX installation filename
%  database.
%
%  Usage with LaTeX: \usepackage{xint}
%                    \usepackage{xintfrac}   % (loads xint)
%                    \usepackage{xintexpr}   % (loads xintfrac)
%
%                    \usepackage{xintbinhex} % (loads xint)
%                    \usepackage{xintgcd}    % (loads xint)
%                    \usepackage{xintseries} % (loads xintfrac)
%                    \usepackage{xintcfrac}  % (loads xintfrac)
%
%  Usage with TeX:   \input xint.sty\relax   
%                    \input xintfrac.sty\relax   % (loads xint)
%                    \input xintexpr.sty\relax   % (loads xintfrac)
%
%                    \input xintbinhex.sty\relax % (loads xint)
%                    \input xintgcd.sty\relax    % (loads xint)
%                    \input xintseries.sty\relax % (loads xintfrac)
%                    \input xintcfrac.sty\relax  % (loads xintfrac)
%
%%
%%----------------------------------------------------------------
%% The xint bundle (version 1.09b of October 3, 2013)
%<xint>%% xint: Expandable operations on long numbers
%<xintfrac>%% xintfrac: Expandable operations on fractions  
%<xintexpr>%% xintexpr: Expandable expression parser
%<xintbinhex>%% xintbinhex: Expandable binary and hexadecimal conversions
%<xintgcd>%% xintgcd: Euclidean algorithm with xint package 
%<xintseries>%% xintseries: Expandable partial sums with xint package
%<xintcfrac>%% xintcfrac: Expandable continued fractions with xint package
%% Copyright (C) 2013 by Jean-Francois Burnol 
%%----------------------------------------------------------------
%%
%<*doc>
\def\pkgversion{1.09b}
\def\pkgdate{2013/10/03}
\def\striptimestamp #1 <#2 #3 #4 #5>{#2 at #3 #4}
\def\getdocdate #1 <#2-#3-#4 #5>{#4/#3/#2}
\edef\docdate{\expandafter\getdocdate\lasttimestamp}
\edef\dtxtimestamp{\expandafter\striptimestamp\lasttimestamp}
\begingroup
\input docstrip.tex
\askforoverwritefalse
\generate{\nopreamble
\file{xint.ins}{\from{xint.dtx}{ins}}
\usepreamble\defaultpreamble
\file{xint.sty}{\from{xint.dtx}{xint}}
\file{xintbinhex.sty}{\from{xint.dtx}{xintbinhex}}
\file{xintgcd.sty}{\from{xint.dtx}{xintgcd}}
\file{xintfrac.sty}{\from{xint.dtx}{xintfrac}}
\file{xintseries.sty}{\from{xint.dtx}{xintseries}}
\file{xintcfrac.sty}{\from{xint.dtx}{xintcfrac}}
\file{xintexpr.sty}{\from{xint.dtx}{xintexpr}}}
\endgroup
\iffalse
%</doc>
%<*ins>
%----------- to .ins file ----------------------------------------
%%
%% This is a generated file. Run tex or latex on this file to
%% extract xint.sty, xintfrac.sty, xintexpr.sty, xintbinhex.sty,
%% xintgcd.sty, xintseries.sty and xintcfrac.sty from xint.dtx
%%
%% See xint.dtx for the copyright and the conditions for
%% distribution and/or modification of this work.
%%
\input docstrip.tex
\askforoverwritefalse
\generate{\usepreamble\defaultpreamble
\file{xint.sty}{\from{xint.dtx}{xint}}
\file{xintbinhex.sty}{\from{xint.dtx}{xintbinhex}}
\file{xintgcd.sty}{\from{xint.dtx}{xintgcd}}
\file{xintfrac.sty}{\from{xint.dtx}{xintfrac}}
\file{xintseries.sty}{\from{xint.dtx}{xintseries}}
\file{xintcfrac.sty}{\from{xint.dtx}{xintcfrac}}
\file{xintexpr.sty}{\from{xint.dtx}{xintexpr}}}
\endbatchfile
%----------- end of .ins file ------------------------------------
%</ins>
%<*doc>
\fi
\NeedsTeXFormat{LaTeX2e}
\ProvidesFile{xint.dtx}[bundle source and documentation (\dtxtimestamp)]

\documentclass[a4paper,11pt,abstract]{scrdoc}

%% \OnlyDescription

\pagestyle{headings}
\usepackage[latin1]{inputenc}
\usepackage[T1]{fontenc}

\usepackage{multicol}

%---- GEOMETRY WILL BE CHANGED FOR SOURCE CODE SECTIONS
\usepackage[hscale=0.66,vscale=0.75]{geometry}

\usepackage{xintexpr}

\usepackage{xintbinhex}
\usepackage{xintgcd}
\usepackage{xintseries}
\usepackage{xintcfrac}

\usepackage{amsmath} % for \cfrac in the documentation 

\usepackage{etoc}

%---- CHANGING TOCDEPTH MIDWAY THROUGH THE MAIN TOC (1.04, 18 avril 2013)
% je modifie le 27 mai car finalement j'ajoute des \localtableofcontents aux
% chapitres décrivant les commandes des packages, et je supprime ces
% sous-sections de la Table principale. OK, ça marche. Ok aussi pour les
% bookmarks du pdf.

\makeatletter
\def\resettocdepthto #1{\c@tocdepth #1\relax }%
% ainsi on modifie localement seulement puisque cela sera vu seulement dans le
% scope du group de la (local) tableofcontents faite par etoc et hyperref ne me
% jouera pas de tour avec les bookmarks

\def\SetInnerTocdepthTo #1{%
    \addtocontents {toc}{\protect\resettocdepthto {#1}}%
}%

\def\FutureTOCsDoNotObeyInnerTocdepth{%
    \let\resettocdepthto\@gobble 
    \etocmulticolstyle [1]{\subsection *{Contents}}%
}%
% parfait, modifs du 27 mai ok.

% ---- USING ETOC FOR CUSTOM SUBSECTION STYLE (pour 1.04, 21 avril 2013)
% attention comme je crée un groupe pour le typesetting dans les TOCs des
% sous-sections, je dois donc faire  attention de positionner \toctransition
% juste après le début de la section "implémentation de xint", sinon il est dans
% le scope de la précédente sous-section et l'action sur \c@tocdepth sera
% annulée aussitôt.
 
% 27 mai: la position, et la nature, de \toctransition modifiés car je ne mets
% plus les sous-sections des sections de «Commands» dans la Toc.

% 8 juin: je change à nouveau le nom de \toctransition (cf au-dessus)

\def\gobbletodot #1.{}

\let\savedsectionline\l@section
\etocsetstyle{section}{}{}
     {\savedsectionline{\numberline{\etocnumber}\etocname}{\etocpage}}{}%

% choix de style plus sophistiqué à partir de 1.08a
\etocsetstyle{subsection}
    {\begingroup
     \setlength{\premulticols}{0pt}
     \setlength{\multicolsep}{0pt}
     \setlength{\columnsep}{1em}
     \setlength{\columnseprule}{.4pt}
     \raggedcolumns % only added for 1.08a, I should have done it long time ago!
     \begin{multicols}{2}%
     \leftskip 2.3em\rightskip 0em\parfillskip 0em\relax
    }
    {}
    {\noindent
        \llap{\makebox[2.3em][l]
              {\ttfamily\bfseries\etoclink
                         {.\expandafter\gobbletodot\etocthenumber}}}%
        \strut 
        \etocname\leaders\etoctoclineleaders
        \hfill \strut\makebox[1.5em][r]{\normalfont\small\etocpage}\endgraf }
    {\end{multicols}\endgroup }%

\makeatother

% 4 juin 2013

% je me décide à utiliser les couleurs des liens via hyperref, mais je n'en veux
% pas (des couleurs) dans les TOCs (par contre je veux les liens évidemment).
% Idéalement j'aurais aimé pouvoir avoir pour les TOCs les liens sous la forme
% de rectangles mais je n'ai pas le temps de regarder si on peut dire à hyperref
% de faire cela. J'ai déterminé empiriquement qu'on peut tout-à-fait mettre
% \hypersetup{hidelinks} dans un groupe 

% à propos il faudrait une interface plus commode pour ce hook
% Mais c'est déjà bien qu'on ait ça!

\def\etocaftertitlehook {\hypersetup{hidelinks}}

%--- TXFONTS: TXTT WILL BE MADE SMALLER AND WILL ALLOW HYPHENATION
\usepackage{txfonts}

% malheureusement, comme j'utilise des diacritiques dans mes
% parties commentées, imprimées verbatim, je ne pourrai pas
% utiliser dvipdfmx qui a un problème avec txtt

\DeclareFontFamily{T1}{txtt}{}
\DeclareFontShape{T1}{txtt}{m}{n}{	%medium
     <->s*[.96] t1xtt%
}{}
\DeclareFontShape{T1}{txtt}{m}{sc}{	%cap & small cap
     <->s*[.96] t1xttsc%
}{}
\DeclareFontShape{T1}{txtt}{m}{sl}{	%slanted
     <->s*[.96] t1xttsl%
}{}
\DeclareFontShape{T1}{txtt}{m}{it}{	%italic
     <->ssub * txtt/m/sl%
}{}
\DeclareFontShape{T1}{txtt}{m}{ui}{   	%unslanted italic
     <->ssub * txtt/m/sl%
}{}
\DeclareFontShape{T1}{txtt}{bx}{n}{	%bold extended
     <->t1xbtt%
}{}
\DeclareFontShape{T1}{txtt}{bx}{sc}{	%bold extended cap & small cap
     <->t1xbttsc%
}{}
\DeclareFontShape{T1}{txtt}{bx}{sl}{	%bold extended slanted
     <->t1xbttsl%
}{}
\DeclareFontShape{T1}{txtt}{bx}{it}{	%bold extended italic
     <->ssub * txtt/bx/sl%
}{}
\DeclareFontShape{T1}{txtt}{bx}{ui}{  	%bold extended unslanted italic
     <->ssub * txtt/bx/sl%
}{}
\DeclareFontShape{T1}{txtt}{b}{n}{	%bold
     <->ssub * txtt/bx/n%
}{}
\DeclareFontShape{T1}{txtt}{b}{sc}{	%bold cap & small cap
     <->ssub * txtt/bx/sc%
}{}
\DeclareFontShape{T1}{txtt}{b}{sl}{	%bold slanted
     <->ssub * txtt/bx/sl%
}{}
\DeclareFontShape{T1}{txtt}{b}{it}{   	%bold italic
     <->ssub * txtt/bx/it%
}{}
\DeclareFontShape{T1}{txtt}{b}{ui}{   	%bold unslanted italic
     <->ssub * txtt/bx/ui%
}{}

% au bout d'un moment j'ai fini par être mal à l'aise avec le 0 de txtt, pour
% afficher les résultats des calculs faits pas xint. 
% 
% ***** Attention le - de cmtt est ÉPOUVANTABLE!***** bon, ça le disqualifie.
% le - de lmtt lui n'a PAS ce problème. Et lmtt, à sa taille naturelle,
% correspond bien à mon txtt réduit à 96%. Donc c'est très simple:

\def\digitstt {\bgroup\fontfamily {lmtt}\selectfont\let\next=}
 
% le nom de \digitstt n'est pas très bien choisi, mais bon il est en effet
% utilisé ici dans 95% des cas pour des nombres uniquement. 

\usepackage{xspace}
\usepackage{color}
\usepackage{framed}

\definecolor{joli}{RGB}{225,95,0}
\definecolor{JOLI}{RGB}{225,95,0}
\definecolor{BLUE}{RGB}{0,0,255}
\definecolor{niceone}{RGB}{38,128,192}
\definecolor{PineGreen}{cmyk}{0.92,0,0.59,0.25}% cf color.pro
\definecolor{Purple}{cmyk}{0.45,0.86,0,0}

\usepackage[english]{babel}
\usepackage[autolanguage,np]{numprint}
\AtBeginDocument{\npthousandsep{,\hskip .05em plus .01em minus .01em}}

\usepackage[pdfencoding=pdfdoc,bookmarks=true]{hyperref}
\hypersetup{%
linktoc=all,%
breaklinks=true,%
colorlinks=true,%
urlcolor=niceone,%
linkcolor=blue,%
pdfauthor={Jean-Fran\c cois Burnol},%
pdftitle={The xint bundle},%
pdfsubject={Arithmetic with TeX},%
pdfkeywords={Expansion, arithmetic, TeX},%
pdfstartview=FitH,%
pdfpagemode=UseOutlines}


%---- \MyMarginNote: a simple macro for some margin notes with no fuss
\makeatletter
\def\MyMarginNote {\@ifnextchar[\@MyMarginNote{\@MyMarginNote[]}}%
\def\@MyMarginNote [#1]#2{%
    \vadjust{\vskip-\dp\strutbox
             \smash{\hbox to 0pt
                       {\color{PineGreen}\normalfont\small
                        \hsize 1.5cm\rightskip.5cm minus.5cm
                        \hss\vtop{\noindent #2}\ $\to$#1\ }}%
             \vskip\dp\strutbox }\strut{}} 
\def\MyMarginNoteWithBrace #1{%
    \vadjust{\vskip-\dp\strutbox
             \smash{\hbox to 0pt
                       {\color{PineGreen}\normalfont\small
                        \hss #1\ $\Bigg\{$\ }}%
             \vskip\dp\strutbox }\strut{}} 
\def\IMPORTANT {\MyMarginNoteWithBrace {IMPORTANT!}}
\makeatother

%---- \centeredeline: OUR OWN LITTLE MACRO FOR CENTERING LINES

% 7 mars 2013
% This macro allows to conveniently center a line inside a paragraph and still
% use therein \verb or other commands changing catcodes.
% A proposito, the \LaTeX \centerline uses \hsize and not \linewidth ! 
% (which in my humble opinion is bad)

% \ignorespaces ajouté le 9 juin. Cela m'aurait évité des dizaines de % lorsque
% plusieurs \centeredline se suivent (car on reste en mode horizontal si on y
% est au début).

\makeatletter
\newcommand*\centeredline {%
      \ifhmode \\\relax
        \def\centeredline@{\hss\egroup\hskip\z@skip\ignorespaces }%
      \else 
        \def\centeredline@{\hss\egroup }%
      \fi
      \afterassignment\@centeredline
      \let\next=}
\def\@centeredline 
    {\hbox to \linewidth \bgroup \hss \bgroup \aftergroup\centeredline@ }
\makeatother

%---- MODIFIED \verb, and verbatim like `environments' FITS BETTER OUR USE OF IT
% le \verb de doc.sty est très chiant car il a retiré \verbatim@font pour mettre
% un \ttfamily hard-coded à la place. [en fin de compte j'utilise dorénavant le
% vocable \MicroFont plutôt que \verbatim@font]
% 
% Par ailleurs j'en ai marre des erreurs dues au fait que mes
% paragraphes reformatés dans emacs passent à la ligne au milieu
% d'un \verb. Je décide donc d'annuler l'effet du \dospecials sur les
% espaces dans la source. Et donc je retire le \verb@eol@error et
% il n'y a donc plus lieu d'un comportement différent pour
% l'impression des blancs, donné par la version étoilée.
% 
% Et il n'y avait donc pas de \obeylines puisque la fin de ligne
% devenait un message d'erreur dans \verb@eol@error 
%
% à propos \do@noligs:
% macro:#1->\catcode `#1\active \begingroup \lccode `\~=`#1\relax \lowercase
% {\endgroup \def ~{\leavevmode \kern \z@ \char `#1}} 
% ne manque-t-il pas un espace après le \char `#1? En effet! ça me pose des
% problèmes lorsque l'espace a catcode 10!!
% 
% attention au signe - par contre, on ne veut vraiment *pas* de ligatures avec
% lui, donc pour lui et seulement pour lui je fais le boulot de \do@noligs. OK,
% je pense que la raison pour laquelle je ne le faisais que pour - est celle du
% paragraphe précédent que je viens d'ajouter, donc finalement je fais le
% \do@noligs entier 
%  \catcode`\-\active \def-{\kern \z@ \char`\- }
%
% 12 et 13 mai 2013. Je dois m'occuper des verbatim, et comme je n'ai (pas ou
% plus) envie de perdre du temps à aller re-regarder verbatim et en particulier
% son emploi  de trivlist, avec les conséquences *lamentables* sur les
% espacements verticaux je décide de tester une variante de \verb spécialement
% pour remplacer mes blocs verbatim, particulièrement dans le code commenté. Et
% voilà \lverb! bye bye \begin{verbatim} 
%
% bref, pour \lverb: d'abord il est \long. Ensuite j'utilise $ si j'ai besoin de
% control sequences. [sans arguments, sinon il me faudrait avoir des caratères
% de catcode 1 et 2 aussi] En fait j'ai juste eu besoin pour \%. Car le % lui je
% le  mets (maintiens, donc la partie implémentation) à ignore. Ah, et
% finalement j'utilise aussi $\. Les espaces sont normaux. 
% Enfin, je fais de & un caractère de  commentaires. Tout cela c'est pour 
% la partie Implémentation. 
%
% Pour les verbatim dans la partie user manual, je fais une variante \dverb, qui
% elle respecte les lignes, en utilisant \obeylines. 
% 
% 8 juin: dans \dverb et aussi dans les shortverb, & est commentaire et *
% est actif et fait \lowast (\makestarlowast). J'utilisais avant ~ comme
% caractère actif dans les shortverbs mais je n'en ai pas besoin finalement,
% c'est plus simple avec un * actif.
% 
\def\MicroFont {\ttfamily }
\def\MacroFont {\ttfamily\baselineskip12pt\relax}
\makeatletter

% modif de \do@noligs: \char`#1} --> \char`#1 } 
\def\do@noligs #1%
{%
    \catcode `#1\active 
    \begingroup \lccode `\~=`#1\relax 
    \lowercase {\endgroup \def ~{\leavevmode \kern \z@ \char `#1 }}%
} 
% \makestarlowast ajouté le 8 juin. Le 22 septembre je supprime ici 
% le \catcode`\& 14 que j'avais ajouté, car je pense en avoir besoin
% uniquement dans \lverb et \dverb.
\def\verb 
{%
  \relax \ifmmode\hbox\else\leavevmode\null\fi
  \bgroup \MicroFont
  \let\do\do@noligs  \verbatim@nolig@list
  \let\do\@makeother \dospecials
  \catcode32 10 \makestarlowast \@jfverb 
}
\def\@jfverb #1{\catcode`#1\active\lccode`\~`#1\lowercase{\let~\egroup}}
% ATTENTION!
% \def~{\\\relax} cause des problèmes infinis. Donc je vais simplement utiliser
% dans les parties commentées du code $\ puisque $ a catcode 0. 
% attention à [, donc $\$relax en un endroit. 
% Le choix de $ est ok, car comme c'est dans des parties commentées, le mode
% docTeX de emacs ne fait pas de choses pénibles au-niveau de la coloration
% syntaxique. 
\long\def\lverb % pour utilisation dans la partie implémentation
{%
  \relax\par\smallskip\noindent\null
  \begingroup
  \let\par\@@par\hbadness 100 \hfuzz 100pt\relax
  \hsize .85\hsize 
  \MacroFont
  \bgroup
    \aftergroup\@@par \aftergroup\endgroup \aftergroup\medskip
    \let\do\do@noligs  \verbatim@nolig@list
    \let\do\@makeother \dospecials 
    \catcode32 10 \catcode`\% 9 \catcode`\& 14 \catcode`\$ 0
    \@jfverb 
}
% et voilà. Comme quoi, on peut aussi faire sans \trivlist si on veut.
\long\def\dverb % pour utilisation dans le manuel de l'utilisateur
% contrairement à \lverb, ici, on fait \obeylines 
% à utiliser sous la forme: (ou avec un autre à la place de |)(on aurait pu
% imaginer aussi prendre ^^A ou dans le genre
% \dverb|&
% blahblah
% |
% pour qu'il y ait bien un dernier end of line, qui est compensé a posteriori
{%
   \relax\par\smallskip
   \bgroup
     \parindent0pt 
     % \parskip0pt 
     \def\par{\@@par\leavevmode\null}%
     \let\do\do@noligs \verbatim@nolig@list
     \let\do\@makeother \dospecials 
     \catcode`\& 14 \makestarlowast
     \aftergroup\vskip\aftergroup-\aftergroup\baselineskip
     \aftergroup\smallskip
     \aftergroup\noindent\aftergroup\ignorespaces
     \MacroFont \obeylines \@vobeyspaces 
   \@jfverb 
}
% Mais j'ai besoin d'un mode verbatim différent pour les nombres car je
% ne veux pas passer en mode mathématique (que j'aime de moins en moins) et je
% ne veux pas les 0 du txtt pour cela. Comme je n'utilise pas de tabulation, je
% vais prendre &.
% Hmm, finalement je supporte de moins en moins les chiffres du roman. J'ai un
% peu de mal à me mettre d'accord sur un style uni de présentation.
% Update 8 juin: finalement je me décide ici aussi pour utiliser lmtt
% Donc dans &..& c'est comme dans \digitstt. Très bien.
\catcode`\& 13
\def&{\begingroup\fontfamily{lmtt}\selectfont
           \let\do\@makeother\dospecials
           \catcode`\& 13 
      \@jfendshrtverb }
\def\@jfendshrtverb #1&{#1\endgroup }
\makeatother

% Note: il n'y a plus de \hyphenchar-1 dans le \DeclareFontFamily de t1txtt
% MAIS ATTENTION CEPENDANT À CE QUI SE PASSE EN CAS DE CHANGEMENT DE TAILLE

% 11 mai 2013: j'utilise dorénavant _ là où avant c'était @
\catcode`\_=11

\def\csa_aux #1{\ttfamily\hyphenchar\font45 \char`\\#1\endgroup }
\def\csb_aux #1{\hyperref[#1]{\ttfamily
                              \hyphenchar\font45 \char`\\#1}\endgroup }

\DeclareRobustCommand\csa     {\begingroup\catcode`\_=11 \csa_aux }
\DeclareRobustCommand\csb     {\begingroup\catcode`\_=11 \csb_aux }
\DeclareRobustCommand\csbnolk {\begingroup\catcode`\_=11 \color{blue}\csa_aux }

\newcommand\csh[1]{\texorpdfstring{\csa{#1}}{\textbackslash #1}}
\newcommand\csbh[1]{\texorpdfstring{\csbnolk{#1}}{\textbackslash #1}}

\def\XINT_tmp_def #1%
{%
    \expandafter\def\csname #1name\endcsname
   {\texorpdfstring
                  {{\color{joli}\ttfamily\hyphenchar\font45 \bfseries #1}}
                  {#1}%
    \xspace }%
}%
\xintApplyUnbraced\XINT_tmp_def
    {{xint}{xintbinhex}{xintgcd}{xintfrac}{xintseries}{xintcfrac}{xintexpr}}

\let\XINT_tmp_def\empty
\catcode`\_=8

\frenchspacing
\renewcommand\familydefault\sfdefault

%---- QUICK WAY TO PRINT LONG THINGS, IN PARTICULAR, BUT NOT EXCLUSIVELY, LONG
%     NUMBERS 
\def\allowsplits #1%
{%
    \ifx #1\relax \else #1\hskip 0pt plus 1pt\relax
    \expandafter\allowsplits\fi
}%
\def\printnumber #1%
{\expandafter\expandafter\expandafter
    \allowsplits #1\relax }% Expands twice before printing.

%--- counts used in particular in the samples from the documentation of the
%    xintseries.sty package
\newcount\cnta
\newcount\cntb
\newcount\cntc

%--- printing (systematically) * in a lowered position in the various verbatim
%    blocks using txtt.

\def\lowast{\raisebox{-.25\height}{*}}
\begingroup
   \catcode`* 13
   \gdef\makestarlowast {\let*\lowast\catcode`\*\active}%
\endgroup

\begin{document}\thispagestyle{empty}\rmfamily
\pdfbookmark[1]{Title page}{TOP}

{\normalfont\Large\parindent0pt \parfillskip 0pt\relax 
 \leftskip 2cm plus 1fil \rightskip 2cm plus 1fil
 The \xintname bundle: \xintname, \xintfracname, \xintexprname,
    \xintbinhexname, \xintgcdname, \xintseriesname and \xintcfracname.\par}%
{\centering
  \textsc{Jean-François Burnol}\par
  \footnotesize \ttfamily
  jfbu (at) free (dot) fr\\
  Package version: \pkgversion\ (\pkgdate)\\
  Documentation generated from the source file\\
  with timestamp ``\dtxtimestamp''\par
}

\begin{abstract}
  The \xintname package implements with expandable \TeX{} macros the basic
  arithmetic operations of addition, subtraction, multiplication and division,
  applied to arbitrarily long numbers. The \xintfracname package extends the
  scope of \xintname to fractional numbers with arbitrarily long numerators and
  denominators.

  \xintexprname provides an expandable parser |\xintexpr . . . \relax| of
  expressions involving arithmetic operations in infix notation on decimal
  numbers, fractions, numbers in scientific notation, with parentheses,
  factorial symbol, function names, comparison operators, logic operators, 2way
  and 3way conditionals (not evaluating the false branches),
  sub-expressions, macros expanding to the previous items.

  The \xintbinhexname package is for conversions to and from binary and
  hexadecimal bases, \xintseriesname provides some basic functionality for
  computing in an expandable manner partial sums of series and power series with
  fractional coefficients, \xintgcdname implements the Euclidean algorithm and
  its typesetting, and \xintcfracname deals with the computation of continued
  fractions.

  Most macros, and all of those doing computations, work purely by expansion
  without assignments, and may thus be used almost everywhere in \TeX{}.

  The packages may be used with any flavor of \TeX{} supporting the \eTeX{}
  extensions. \LaTeX{} users will use |\usepackage| and others |\input| to
  load the package components.
\end{abstract}


\section{Quick introduction}

The \xintname bundle consists of three principal components \xintname,
\xintfracname (which loads \xintname), and \xintexprname (which loads
\xintfracname), and four additional modules. They may be used with Plain
\TeX{}, \LaTeX{} or any other macro package based on \TeX{}; the package
requires the \eTeX{} extensions (|\numexpr|, |\ifcsname|) which in modern
distributions are made available by default, except if you invoke \TeX{} under
the name |tex| in command line.

The goal is too compute \emph{exactly}, purely by expansion, without counters
nor assignments nor definitions, with arbitrarily big numbers and fractions. As
will be commented upon more later, this works fine when the data has
dozens of digits, but multiplying out two &1000& digits numbers under this
constraint of expandability is expensive; so in many cases the user will round
intermediate results. There are also macros working with arbitrary-precision
floating point numbers (default is &16& digits). The only non-algebraic
operation which is implemented is the extraction of square roots (with a given
floating point precision).

All computations can be done chaining the suitable
package macros; and \xintname also provides some expandable utilities for easing
up the task to write expandable macros depending on conditional evaluations.

Most users will prefer to access the package functionalities via the
\csb{xintexpr}| ... \relax| parser which allows infix notations, function names (corresponding
to some of the package macros), comparison operators, boolean operators, 2way
and 3way conditionals. Furthermore, it is naturally possible to use arbitrary
(expandable) macros within an |\xintexpr|-ession, but the  arguments (within
braces following the macro)
will be scooped by the macro
during its expansion (however the arguments may also be encapsulated in their
own |\xintexpr|-essions, if the need arises to use infix notation there).

\xintexprSafeCatcodes
\newcommand\formula[3]{\xinttheexpr round((#1 & (#2 | #3)) * (355/113*#3 -
  (#1 - #2/2)^2), 8)\relax }
\xintexprRestoreCatcodes


Here is some random formula, defining a \LaTeX{} command with three parameters,
\centeredline{\verb$\newcommand\formula[3]{\xinttheexpr ... \relax}$}
\centeredline{\verb$where ... is:  round((#1 & (#2 | #3)) * (355/113*#3 - (#1 -
  #2/2)^2), 8)$} 

\smallskip

Let |a=#1|, |b=#2|, |c=#3| be the parameters. The first term is the logical
operation |a and (b or c)| where a number or fraction has truth value &1& if it
is non-zero, and &0& otherwise. So here it means that |a| must be non-zero as
well as |b| or |c|, for this first operand to be &1&, else the formula returns
&0&. This multiplies a second term which is algebraic. Finally the result (where
all intermediate computations are done \emph{exactly}) is rounded to a value
with &8& digits after the decimal mark, and printed. \centeredline{|\formula
  {771.3/9.1}{1.51e2}{37.73} expands to |%
  \digitstt{\formula {771.3/9.1}{1.51e2}{37.73}}}

\begin{itemize}
\item as everything gets expanded, the characters
  \verb$+,-,*,/,^,&,|,?,:,<,>,=,(,)$ and the comma ($,$), which are used in the
  |infix| syntax, should not be active (for example if
  they serve as shorthands for some language in the |Babel| system) at the time
  of the expressions (if they are in use therein). The command
  \csb{xintexprSafeCatcodes} resets these characters to their standard catcodes
  and \csb{xintexprRestoreCatcodes} restores the status prevailing at the time
  of the previous \csa{xintexprSafeCatcodes}.
\item the formula may of course be written via the suitable chaining of the
  package macros. Here one could use:
  \centeredline
  {|\xintRound {8}{\xintMul {\xintAND {#1}{\xintOR {#2}{#3}}}{\xintSub |}
  \centeredline
  {| {\xintMul {355/113}{#3}}{\xintPow {\xintSub {#1}{\xintDiv {#2}{2}}}{2}}}}|}
  with the inherent difficulty of keeping up with braces and everything...
\item if such a formula is used thousands of times in a document (for plots?),
  this could impact some parts of the \TeX{} program memory (for technical
  reasons explained in \autoref{sec:comexpr}). So, a utility \csb{xintNewExpr}
  is provided to do the work of translating an |\xintexpr|-ession with
  parameters into a chain of macro evaluations.\footnote{As its makes some macro
    definitions, it is not an expandable command. It does not need protection
    against active characters as it does it itself.}
  \centeredline{|\xintNewExpr\formula[3]|}
  \centeredline{\verb${ round((#1 & (#2 | #3)) * (355/113*#3 - (#1 - #2/2)^2),
      8) }$}
  one gets a command |\formula| with three parameters and meaning:

\xintNewExpr\formula[3]
{ round((#1 & (#2 | #3)) * (355/113*#3 - (#1 - #2/2)^2),
      8) }

{\centering\ttfamily 

\meaning\formula

}
This does the same thing as the hand-written version from the previous item. The
use even thousands of times of such an |\xintNewExpr|-generated |\formula| 
has no memory impact. 
\item count registers and |\numexpr|-essions \emph{must} be prefixed by |\the|
  (or |\number|) when used inside |\xintexpr|. However, they may be used
  directly as arguments to most package macros, without being prefixed by
  |\the|. See \hyperlink{useofcount}{Use of count registers}. With release
  |1.09a| this functionality has been
  added to many of macros of the integer only \xintname (with the cost of a
  small extra overhead; earlier, this overhead was added through  the loading
  of 
  \xintfracname). 
\item like a |\numexpr|, an |\xintexpr| is not directly printable, one uses
  equivalently |\xintthe\xintexpr| or \csb{xinttheexpr}. One may for example
  define: \centeredline{|\def\x {\xintexpr \a + \b \relax} \def\y {\xintexpr \x
      * \a \relax}|} where |\x| could have been defined equivalently for its use
  in |\y| as {|\def\x {( \a + \b )}|} but the earlier method is better than with
  parentheses, as it allows {|\xintthe\x|}.
\item sometimes one needs an integer, not a fraction or decimal number. The
  |round| function rounds to the nearest integer (half-integers are rounded
  towards $\pm\infty$), and |\xintexpr round(...)\relax| has an alternative
  syntax as |\xintnumexpr ... \relax|. There is also the |\xintthenumexpr|. The
  rounding is applied to the final result only.
\item there is also |\xintfloatexpr ... \relax| where the algebra is done in
  floating point approximation (also for each intermediate result). Use the
  syntax 
  |\xintDigits:=N;| to set the precision. Default: &16& digits.
  \centeredline{|\xintthefloatexpr 2^100000\relax:| \digitstt{\xintthefloatexpr
    2^100000\relax }} The square-root operation can be used in |\xintexpr|, it
  is computed as a float with the precision set by |\xintDigits| or by the
  optional second argument: \centeredline{|\xinttheexpr sqrt(2,60)\relax|:}
  \centeredline{\digitstt{\xinttheexpr sqrt(2,60)\relax }} Notice the |a/b[n]|
  notation 
  (usually |/b| even if |b=1| gets printed; this is the exception)  which is the
  default format of the macros of the \xintfracname 
  package (hence of |\xintexpr|). To get a float format from the |\xintexpr| one
  needs something more: \centeredline{|\xintFloat[60]{\xinttheexpr
      sqrt(2,60)\relax}|:} \centeredline{\digitstt{\xintFloat[60]{\xinttheexpr
      sqrt(2,60)\relax }}} The precision used by |\xintfloatexpr| must be set by
  |\xintDigits|, it can not be passed as an option to |\xintfloatexpr|.
  \centeredline{|\xintDigits:=48; \xintthefloatexpr 2^100000\relax|: }
  \centeredline{\begingroup \xintDigits:=48;\digitstt{\xintthefloatexpr
    2^100000\relax}\endgroup} Floats are quickly indispensable when using the
  power function (which can only have an integer exponent), as exact results
  will easily have hundreds of digits.
\item when producing very long numbers there is the question of printing them on
  the page, without going beyond the page limits. In this document, I have most
  of the time made use of these little macros (not provided by the package:)
\begingroup\makeatletter\def\verbatim@font{\ttfamily\footnotesize}
\begin{verbatim}
\def\allowsplits #1%
{%
    \ifx #1\relax \else #1\hskip 0pt plus 1pt\relax
    \expandafter\allowsplits\fi
}%
\def\printnumber #1%
{\expandafter\expandafter\expandafter
    \allowsplits #1\relax }% Expands twice before printing.
%% (all macros from the xint bundle expand in two steps to their final output)
\end{verbatim}
\endgroup
An alternative (explained later) is to suitably configure the thousand separator
with tthe \href{http://www.ctan.org/pkg/numprint}{numprint} package (does not
work in math mode; I also tried \href{http://www.ctan.org/pkg/siunitx}{siunitx}
but even in text mode could not get it to break numbers accross lines).
\end{itemize}

\section{Summary of the \csh{xintexpr} syntax}\label{sec:exprsummary}

An expression is built with infix operators (including comparison and boolean
operators) and parentheses, and functions. And there are two special branching
constructs. The parser expands everything from the left to the right and
everything may thus be revealed step by step by expansion of macros. At any
given time the parser is in one of two modes: either it looks for a number or it
looks for an operator. When looking for a number it may find instead a function.
The function is evaluated after the comma separated list of its arguments has
been. Or it may find a minus sign as prefix. Or it may find an opening
parenthesis. When looking for an operator it may find the |!| for the factorial,
or the conditional operators |?| and |:|, or some more genuine infix operator,
in that case a comparison of precedences is made with the previously
found operator. The result is that the formula should evaluate as one expects.
Note that |2^-10| is perfectly accepted input, no need for parentheses. And
|-2^-10^-5*3| does |(-((2^(-10))^(-5)))*3|.

Spaces anywhere are allowed. 

The characters used in the syntax should not
of course have been made active. Use \csb{xintexprSafeCatcodes},
\csb{xintexprRestoreCatcodes} if need be (of course, this can not be done
expandably... ). Apart from that infix operators may be of catcode letter or
other, it does not matter, or even of catcode tabulation, math superscript, or
math subscript. This should cause no problem. As an alternative to
|\xintexprSafeCatcodes| one may also use |\string| inside the expression.

Although the |A/B[N]| notation is the output format of most \xintfracname
macros,\footnote{this format is convenient for chaining macros; when displaying
  the final result of a computation one has \csb{xintFrac} in math mode, or
  \csb{xintIrr} for inline text mode.}  for user input in an |\xintexpr..\relax| it is mandatory to use for such
a fraction rather the scientific notation |AeN/B| (or |A/Be-N|; capital |E| is
allowed): the square brackets are \emph{not} understood by the parser. Or, as an
alternative \emph{braces} can be used: |{A/B[N]}|. 

Braces are indeed allowed in their usual r\^ole for arguments to macros (which
are then not seen by the parser but scooped by the macro), or to encapsulate
\emph{arbitrary} completely expandable material which will not be parsed but
directly completely expanded and \emph{must} return an integer or fraction
possibly with decimal mark or in |A/B[N]| notation, but is not allowed to have
the |e| or |E|. Braced material is not allowed to expand to some infix operator
or parenthesis, it is allowed only in locations where the parser expects to find
a (decimal) number. There is a final r\^ole of braces with the conditional
operators |?| and |:|, described next.

One may use sub-|\xintexpr|-expressions nested within a larger one. It is even
possible to alternate |\xintfloatexpr|-essions with |\xintexpr|-essions. Do not
use |\xinttheexpr| inside an |\xintexpr|: this gives a number in |A/B[n]|
format which requires protection by braces. Do not put within braces numbers in
scientific notation.


Here is, listed from the highest priority categories to the lowest, the complete list of
operators and functions. Functions always produce \emph{numbers or fractions}.
The |?| and |:| conditional operators are a bit special, though. 

The minus sign as prefix has various precedence levels: |\xintexpr
-3-4*-5^-7\relax| evaluates as |(-3)-(4*(-(5^(-7))))| and |-3^-4*-5-7| as
|(-((3^(-4))*(-5)))-7|. 

The |\relax| at the end of an expression is absolutely \emph{mandatory}.

    % reduce,
    % sqr, sqrt, abs, sgn, floor, ceil, quo, rem, round, trunc, float, gcd, lcm,
    % max, min, sum, prd, add, mul, not, all, any, xor
    % ?, !, if, ifsgn, ?, :.

\begin{itemize}
\item
  These items are at the same top level of priority, apart from |!| for the
  factorial which takes precedence to everything: |sqrt(4)!| computes |sqrt(24)|
  (\digitstt{=\np{\xintthefloatexpr sqrt(4)!\relax}}) and not the factorial of
  |2|. 
  Possibly this could change in a future release.
  \begin{description}
  \item[functions with one argument]
    \texttt{floor, ceil, reduce, sqr, abs, sgn, ?, !, not}. The |?(x)| function
    returns 
    the truth value, &1& if |x<>0|, &0& if |x=0|. The |!(x)| is the logical
    not. The |reduce| function puts the fraction in irreducible form.
  \item[functions with one mandatory and a second optional argument] 
    \texttt{round, trunc, float, sqrt}. For example
    |round(2^9/3^5,12)=|\digitstt{\xinttheexpr round(2^9/3^5,12)\relax.}
  \item[functions with two arguments] 
    \texttt{quo, rem}. These functions are integer only, they give the quotient
    and remainder in Euclidean division (more generally one can use
    the |floor| function).
  \item[functions with three arguments] 
     |if(cond,yes,no)| checks if |cond| is true or false and takes
     the corresponding branch. Both ``branches'' are evaluated (they are not
     really branches but just numbers).
   \item[The ? operator] |(cond)?{yes}{no}| evaluates the condition. It then
     acts as a macro with two mandatory arguments within braces (hence this
     escapes from the parser scope, the braces can not be hidden in a macro),
     chooses the correct branch \emph{without evaluating the wrong one}. Once
     the braces are removed, the parser scans and expands the uncovered material
     so for example \centeredline{|\xintexpr (3>2)?{5+6}{7-1}2^3\relax|} is
     legal and computes
     |5+62^3=|\digitstt{\xinttheexpr(3>2)?{5+(6}{7-(1}2^3)\relax}. Note though
     that it would be better practice to include here the |2^3| inside the
     branches. The contents of the branches may be arbitrary as long as once
     glued to what is next the syntax is respected: \centeredline{|\xintexpr
       (3>2)?{5+(6}{7-(1}2^3)\relax| also works.}
   \item[functions with four arguments]   
     |ifsgn(cond,<0,=0,>0)| checks the sign of |cond| and
     proceeds correspondingly. All three are evaluated; contrarily to the |?|
     the formed operand is then final, the parser must found an operator after
     it, not more digits.
   \item[The : operator] |(cond):{<0}{=0}{>0}|. Only the correct branch is
     un-braced, the two others are swallowed. The un-braced material will then
     be parsed as usual.
  \item[functions with an arbitrary number of arguments] 
    \texttt{all, any, xor, add=sum, mul=prd, max, min, gcd, lcm}: the last two
    are integer-only and require the \xintgcdname package.
  \item[! as postfix] computes the factorial of an integer. This is the exact
    factorial even inside |\xintfloatexpr|.
  \end{description}
\item The |e| and |E| of the scientific notation. They are treated as infix
  operators of highest priority. The decimal mark is scanned in a special
  direct way: in |1.12e3| first |1.12| is formed then only |e| is found. |1e3-1|
  is |999|.
\item The power operator |^|.
\item Multiplication and division &*&, |/|.
\item Addition and subtraction |+|, |-|.
\item Comparison operators |<|, |>|, |=|.
\item Logical and: |&|.
\item Logical or: \verb$|$.
\item The comma |,|. One can thus do |\xintthenumexpr 2^3,3^4,5^6\relax|:
  \xintthenumexpr 2^3,3^4,5^6\relax.
\item The parentheses.
\end{itemize}

% \begin{framed}
%   Sep. 22, 2013. For lack of time, I have only minimally revised the remainder
%   of this documentation from its earlier state, which was for version |1.08b|. I
%   have shortened some sections, but some material may be now a little obsolete.
%   I have tried to include a brief summary of all new commands but may have
%   forgotten one or two. Apart from all the extensions to the |\xintexpr| syntax
%   other notable changes are:
%   \begin{itemize}
%   \item when only the \xintname package is loaded, the input format is relaxed
%     as use of the |\xintNum| normalizing macro has been added to most commands
%     (as was already the case with \xintfracname loaded). This means in
%     particular that count
%     registers may be input directly as arguments to the macros, without
%     prefixing by |\the|.
%   \item the |\xintNewExpr| constructor now works with the standard macro
%     parameter 
%     character |#|.
%   % \item \xintgcdname has the new functions |\xintGCDof| and |\xintLCMof| working
%   %   on lists of braces numbers. They are mapped to the |gcd| and |lcm| of
%   %   |\xintexpr|.
%   \end{itemize}
% \end{framed}
 

\setcounter{tocdepth}{2}

\tableofcontents

\FutureTOCsDoNotObeyInnerTocdepth   

%\clearpage

\section{Presentation}


\footnotesize

\subsection{Recent changes}

\noindent Release |1.09b| (|[2013/10/03]|):
\begin{itemize}
\item various improvements in the documentation,
\item more economical catcode management and re-loading handling,
\item removal of all those |[0]|'s previously forcefully added at the end of
  fractions by various macros of \xintcfracname,
\item |\xintNthElt| with a negative index returns from the tail of the list,
\item new macro |\xintPRaw| to have something like what |\xintFrac| does in math
  mode; i.e. a |\xintRaw| which does not print the denominator if it is one.
\end{itemize}


\noindent Release |1.09a| (|[2013/09/24]|):
\begin{itemize}
\item |\xintexpr..\relax| and
  |\xintfloatexpr..\relax| admit functions in their
  syntax, with comma separated values as arguments, among them \texttt{reduce,
    sqr, sqrt, abs, sgn, floor, ceil, quo, rem, round, trunc, float, gcd, lcm,
    max, min, sum, prd, add, mul, not, all, any, xor}.
\item comparison (|<|, |>|, |=|) and logical (\verb$|$, |&|) operators.
\item the command |\xintthe| which converts |\xintexpr|essions into printable
  format (like |\the| with |\numexpr|) is more efficient, for example one can do
  |\xintthe\x| if |\x| was def'ined to be an |\xintexpr..\relax|: 
\centeredline{|\def\x{\xintexpr 3^57\relax}\def\y{\xintexpr \x^(-2)\relax}|}
\centeredline{|\def\z{\xintexpr
    \y-3^-114\relax}|\hspace{1cm}|\xintthe\z=|\begingroup 
\def\x{\xintexpr 3^57\relax}\def\y{\xintexpr \x^(-2)\relax}%
\def\z{\xintexpr \y-3^-114\relax}\digitstt{\xintthe\z}\endgroup}
\item |\xintnumexpr .. \relax| is |\xintexpr round( .. ) \relax|.
\item |\xintNewExpr| now works with the standard macro parameter character |#|.
\item both regular |\xintexpr|-essions and commands defined by |\xintNewExpr|
  will work with comma separated lists of expressions,
\item new commands |\xintFloor|, |\xintCeil|, |\xintMaxof|, |\xintMinof|
  (package \xintfracname), |\xintGCDof|, |\xintLCM|, |\xintLCMof| (package
  \xintgcdname), |\xintifLt|, |\xintifGt|, |\xintifSgn|, |\xintANDof|,
  ...
\item The arithmetic macros from package \xintname now filter their operands via
  |\xintNum| which means that they may use directly count registers and
  |\numexpr|-essions without having to prefix them by |\the|. This is thus
  similar to the situation holding previously but with \xintfracname loaded.
\item a bug introduced in |1.08b| made |\xintCmp| crash when one of its
  arguments was zero. 
\end{itemize}


\noindent Release |1.08b| (|[2013/06/14]|):
\begin{itemize}
\item Correction of a problem with spaces inside |\xintexpr|-essions.
\item Additional improvements to the handling of floating point numbers.
\item The macros of \xintfracname allow to use count registers in their
  arguments in ways which were not previously documented. See
  \hyperlink{useofcount}{Use of count registers}.  
\end{itemize}

\noindent Release |1.08a| (|[2013/06/11]|):
\begin{itemize}
\item Improved efficiency of the basic conversion from exact
  fractions to floating point numbers,
  with ensuing speed gains especially for the power function macros
  \csb{xintFloatPow} and \csb{xintFloatPower},
\item Better management by the \xintfracname macros \csb{xintCmp},
  \csb{xintMax}, \csb{xintMin} and \csb{xintGeq} of inputs having big powers
  of ten in them.
\item Macros for floating point numbers added to the \xintseriesname package.
\end{itemize}

\noindent Release |1.08| (|[2013/06/07]|):
\begin{itemize}
\item Extraction of square roots, for floating point numbers
  (\csb{xintFloatSqrt}), and also in 
  a version adapted to integers (\csb{xintiSqrt}).
\item New package \xintbinhexname providing \hyperref[sec:combinhex]{conversion
    routines} to and from binary and hexadecimal bases.
\end{itemize}
 
\noindent Release |1.07| (|[2013/05/25)]|):
\begin{itemize}
\item The \xintfracname macros accept numbers written in scientific notation,
  the \csb{xintFloat} command serves to output its argument with a given number
  |D| of significant figures. The value of |D| is either given as optional
  argument to \csb{xintFloat} or set with |\xintDigits := D;|. The default value
  is |16|.
\item The \xintexprname package is a new core constituent (which loads
  automatically \xintfracname and \xintname) and implements the expandable
  expanding parsers \centeredline{{\color{blue}|\xintexpr . . . \relax|},
    and  its variant 
  {\color{blue}|\xintfloatexpr . . 
  . \relax|}} allowing on input formulas using the standard form with infix
  operators |+|, |-|, |*|, |/|, and |^|, and arbitrary levels of
  parenthesizing. Within a float expression the operations are executed
  according to the current value of \csb{xintDigits}. Within an
  |\xintexpr|-ession the binary operators are computed exactly.
\end{itemize}

% The |\xintexpr..\relax| and |\xintfloatexpr..\relax| are usable as
% sub-expressions but not directly printable; for this one has |\xinttheexpr|
% and 
% |\xintthefloatexpr|, or equivalently |\xintthe\xintexpr| and
% |\xintthe\xintfloatexpr|. 
The floating point precision |D| is set (this is a
local assignment to a |\mathchar| variable) with |\xintDigits := D;| and queried
with |\xinttheDigits|. It may be set to anything up to |32767|.\footnote{but
  values higher than 100 or 200 will presumably give too slow evaluations.} The
macro incarnations of the binary operations admit an optional argument which
will replace pointwise |D|; this argument may exceed the |32767| bound.

To write the |\xintexpr| parser I benefited from the commented source of the
\LaTeX3 parser; the |\xintexpr| parser has its own features and peculiarities.
See \hyperref[sec:comexpr]{its documentation}.

\noindent Release |1.0| (|[2013/03/28]|): initial release.



\normalsize

\subsection{Overview}

The main characteristics are:
\begin{enumerate}
\item exact algebra on arbitrarily big numbers, integers as well as fractions,
\item floating point variants with user-chosen precision,
\item implemented via macros compatible with expansion-only
  context.
\end{enumerate}

`Arbitrarily big': this means with less than
    |2^31-1|\digitstt{=\number"7FFFFFFF} digits, as most of the macros will
    have to compute the length of the inputs and these lengths must be treatable
    as \TeX{} integers, which are at most \digitstt{\number "7FFFFFFF} 
    in absolute value.
    This is a distant theoretical upper bound, 
the true limitation is from the \emph{time} taken by the
expansion-compatible algorithms, this will be commented upon soon.

As just recalled, ten-digits numbers starting with a &3& already exceed the
\TeX{} bound on integers; and \TeX{} does not have a native processing of
floating point numbers (multiplication by a decimal number of a dimension
register is allowed --- this is used for example by the
\href{http://www.ctan.org/tex-archive/graphics/pgf/base}{pgf} basic math
engine.)

\TeX{} elementary operations on numbers are done via the non-expandable
\emph{advance, multiply, \emph{and} divide} assignments. This was changed with
\eTeX{}'s |\numexpr| which does expandable computations using standard infix
notations with \TeX{} integers. But \eTeX{} did not modify the \TeX{} bound on
acceptable integers, and did not add floating point support.

The \href{http://www.ctan.org/pkg/bigintcalc}{bigintcalc} package by
\textsc{Heiko Oberdiek} provided expandable operations (using some of |\numexpr|
possibilities, when available) on arbitrarily big integers, beyond the \TeX{}
bound. The present package does this again, using more of |\numexpr| (\xintname
requires the \eTeX{} extensions) for higher speed, and also on fractions, not
only integers. Arbitrary precision floating points operations are a derivative,
and not the initial design goal.\footnote{currently (|v1.08|), the only
  non-elementary operation implemented for floating point numbers is the
  square-root extraction; furthermore no |NaN|'s nor error traps has been
  implemented, only the notion of `scientific notation with a given number of
  significant figures'.}${}^{\text{,\,}}$\footnote{multiplication of two floats
  with |P=\string\xinttheDigits| digits is first done exactly then rounded to
  |P| digits, rather than using a specially tailored multiplication for floating
  point numbers which would be more efficient (it is a waste to evaluate fully
  the multiplication result with |2P| or |2P-1| digits.)}

The \LaTeX3 project has implemented
expandably floating-point computations with 16 significant figures
(\href{http://www.ctan.org/tex-archive/macros/latex/contrib/l3kernel}{l3fp}), 
including special functions such as exp, log, sine and cosine.

The \xintname package can be used for 24, 40, etc... significant figures but one
rather quickly (not much beyond 100 figures perhaps) hits against a `wall'
created by the constraint of expandability: currently, multiplying out two
one-hundred digits numbers takes circa 80 or 90 times longer than for two
ten-digits numbers, which is reasonable, but multiplying out two one-thousand
digits numbers takes more than 500 times longer than for two one hundred-digits
numbers. This shows that the algorithm is drifting from quadratic to cubic in
that range. On my laptop multiplication of two 1000-digits numbers takes some
seconds, so it can not be done routinely in a document.\footnote{without
  entering 
  into too much technical details, the 
  source of this `wall' is that when dealing with two long operands, when one
  wants to pick some digits from the second one, one has to jump above all
  digits constituting the first one, which can not be stored away: expandability
  forbids assignments to memory storage. One may envision some sophisticated
  schemes, dealing with this problem in less naive ways, trying to move big
  chunks of data higher up in the input stream and come back to it later,
  etc...; but each `better' algorithm adds overhead for the smaller inputs. For
  example, I have another version of addition which is twice faster on inputs
  with 500 digits or more, but it is slightly less efficient for 50 digits or
  less. This `wall' dissuaded me to look into implementing `intelligent'
  multiplication which would be sub-quadratic in a model where storing and
  retrieving from memory do not cost much.}

The conclusion perhaps could be that it is in the end lucky that the speed gains
brought by \xintname for expandable operations on big numbers do open some
non-empty range of applicability in terms of the number of kept digits for
routine floating point operations.

The second conclusion, somewhat depressing after all the hard work, is
that if one really wants to do computations with \emph{hundreds} of digits, one
should drop the expandability requirement. And indeed, as clearly
demonstrated long ago by the \href{http://www.ctan.org/pkg/pi}{pi
  computing file} by \textsc{D. Roegel} one can program \TeX{} to
compute with many digits at a much higher speed than what \xintname
achieves: but, direct access to memory storage in one form or another
seems a necessity for this kind of speed and one has to renounce at the
complete expandability.\footnote{I could, naturally, be proven
  wrong!}\,\footnote{The Lua\TeX{} project possibly makes endeavours
  such as \xintname appear even more insane that they are, in truth.}


\subsection{Missing things}


`Arbitrary-precision' floating-point
operations are currently limited to the basic four operations, the power
function with integer exponent, and the extraction of square-roots.

\subsection{Some examples}

The main initial goal is to allow computations with integers and fractions of
arbitrary sizes.

Here are some examples. The first one uses only the base module \xintname, the
next two require the \xintfracname package, which deals with fractions. Then two
examples with the \xintgcdname package, one with the \xintseriesname package,
and finally a computation with a float. Some inputs are simplified by the use
of the \xintexprname package.

% There is also \xintcfracname for continued fractions computations.

{\color{magenta}&123456^99&: }\\
{\color{Purple}\csa{xintiPow}|{123456}{99}|}: \digitstt{\printnumber{\xintiPow {123456}{99}}}

{\color{magenta}1234/56789 with 1500 digits after the decimal point: }\\
{\color{Purple}\csa{xintTrunc}|{1500}{1234/56789}\dots|}: 
\digitstt{\printnumber {\xintTrunc {1500}{1234/56789}}\dots }

{\color{magenta}&0.99^{-100}& with 200 digits after the decimal point:}\\
{\color{Purple}\csa{xintTrunc}|{200}{\xinttheexpr .99^-100\relax}\dots|}:
\digitstt{\printnumber{\xintTrunc {200}{\xinttheexpr .99^-100\relax}}\dots }


{\color{magenta}Computation of a Bezout identity with  |7^200-3^200| and |2^200-1|:}\\
{\color{Purple}|\xintAssign\xintBezout|\\
\hspace*{2cm}|{\xintNum{\xinttheexpr 7^200-3^200\relax}}|\\
\hspace*{2cm}|{\xintNum{\xinttheexpr 2^200-1\relax}}\to\A\B\U\V\D|%
\centeredline{|\U$\times$(7^200-3^200)+\xintiOpp\V$\times$(2^200-1)=\D|}}%
\xintAssign\xintBezout {\xintNum{\xinttheexpr 7^200-3^200\relax}}{\xintNum{\xinttheexpr 2^200-1\relax}}\to\A\B\U\V\D
\digitstt{\printnumber\U$\times$(&7^200-3^200&)+\printnumber{\xintiOpp\V}$\times$(&2^200-1&)=\printnumber\D }

{\color{magenta}The Euclide algorithm applied to \np{179876541573} and
  \np{66172838904}:}\footnote{this example is computed tremendously faster than
  the
  other ones, but we had to limit the space taken by the output.}\\
{\color{Purple}|\xintTypesetEuclideAlgorithm {179876541573}{66172838904}|}
\xintTypesetEuclideAlgorithm {179876541573}{66172838904} \smallskip

{\color{magenta}$\sum_{n=1}^{500} (4n^2 - 9)^{-2}$ with each term rounded to
  twelve digits, and the sum to nine digits:} {\color{Purple}%
  |\def\coeff #1%|\\
  |   {\xintiRound {12}{1/\xintiSqr{\the\numexpr 4*#1*#1-9\relax }[0]}}|\\
  |\xintRound {9}{\xintiSeries {1}{500}{\coeff}[-12]}|:} \def\coeff #1%
{\xintiRound {12}{1/\xintiSqr{\the\numexpr 4*#1*#1-9\relax }[0]}} 
\digitstt{\xintRound {9}{\xintiSeries {1}{500}{\coeff}[-12]}}\endgraf 

The complete series, extended to
infinity, has value
$\frac{\pi^2}{144}-\frac1{162}={}$%
\digitstt{\np{0.06236607994583659534684445}\dots}\,%
\footnote{\label{fn:np}This number is typeset using the
  \href{http://www.ctan.org/pkg/numprint}{numprint} package, with
  \texttt{\detokenize{\npthousandsep{,\hskip .05em plus .01em minus .01em}}}.
  But the breaking accross 
  lines works only in text mode. The number itself was (of course...) computed
  initially with \xintname, with 30 digits of  $\pi$ as input.
  See 
  \hyperref[ssec:Machin]{{how \xintname may compute $\pi$
    from scratch}}.} I also used (this is a lengthier computation
than the one above) \xintseriesname to evaluate the sum with \np{100000} terms,
obtaining 16 
correct decimal digits for the complete sum. The
coefficient macro must be redefined to avoid a |\numexpr| overflow, as
|\numexpr| inputs must not exceed &2^31-1&; my choice
was: 
{\color{Purple}\dverb|& 
\def\coeff #1%
{\xintiRound {22}{1/\xintiSqr{\xintiMul{\the\numexpr 2*#1-3\relax}
                                       {\the\numexpr 2*#1+3\relax}}[0]}}
|}%


{\color{magenta}Computation of $2^{\np{999999999}}$ with |24| significant
  figures:}\\ 
{\color{Purple}|\xintFloatPow[24] {2}{999999999}|:}
\digitstt{\np{\xintFloatPow[24] {2}{999999999}}}


To see more of \xintname in action, jump to the
{\autoref{sec:series}} describing the commands of the
\xintseriesname{} package, especially as illustrated with the
\hyperref[ssec:Machin]{{traditional computations of $\pi$
    and $\log 2$}}, or also see the
{\hyperlink{e-convergents}{computation of the convergents
    of $e$}} made with the \xintcfracname package. 

Note that almost all of the computational results interspersed through the
documentation are not hard-coded in the source of the document but just written
there using the package macros, and were selected to not impact too much the
compilation time.

\subsection{Origins of the package}

Package |bigintcalc| by \textsc{Heiko Oberdiek} already
provides expandable arithmetic operations on ``big integers'',
exceeding the \TeX{} limits (of &2^{31}-1&), so why another\footnote{this section was written before the 
  \xintfracname package; the author is not aware of another package allowing
  expandable computations with arbitrarily big fractions.}
one?

I got started on this in early March 2013, via a thread on the
|c.t.tex| usenet group, where \textsc{Ulrich D\,i\,e\,z} used the
previously cited package together with a macro (|\ReverseOrder|)
which I had contributed to another thread.\footnote{the
  \csa{ReverseOrder} could be avoided in that circumstance, but it
  does play a crucial r\^ole here.} What I had learned in this
other thread thanks to interaction with \textsc{Ulrich D\,i\,e\,z} and
\textsc{GL} on expandable manipulations of tokens motivated me to
try my hands at addition and multiplication.

I wrote macros \csa{bigMul} and \csa{bigAdd} which I posted to the
newsgroup; they appeared to work comparatively fast. These first
versions did not use the \eTeX{} \csa{numexpr} primitive, they worked
one digit at a time, having previously stored carry-arithmetic in
1200 macros.

I noticed that the |bigintcalc| package used\csa{numexpr}
if available, but (as far as I could tell) not
to do computations many digits at a time. Using \csa{numexpr} for
one digit at a time for \csa{bigAdd} and \csa{bigMul} slowed them
a tiny bit but avoided cluttering \TeX{} memory with the 1200
macros storing pre-computed digit arithmetic. I wondered if some speed
could be gained by using \csa{numexpr} to do four digits at a time
for elementary multiplications (as the maximal admissible number
for \csa{numexpr} has ten digits).

The present package is the result of this initial questioning. 

\begin{framed}\centering
  \xintname requires the \eTeX{} extensions.
\end{framed}



\section{Expansions}

\SetInnerTocdepthTo {1}

Except for some specific macros dealing with assignments or typesetting, the
bundle macros all work in expansion-only context. For example, with the
following code snippet within |myfile.tex|:
\dverb|&
\newwrite\outfile
\immediate\openout\outfile \jobname-out\relax
\immediate\write\outfile {\xintQuo{\xintPow{2}{1000}}{\xintFac{100}}}
% \immediate\closeout\outfile
|
the tex run creates a file |myfile-out.tex|
containing the decimal representation of the integer quotient &2^{1000}/100!&.
Such macros can also be used inside a |\csname...\endcsname|, and
of course in an |\edef|.

\edef\x{\xintQuo{\xintPow {2}{1000}}{\xintFac{100}}}
\edef\y{\xintLen{\x}}

Furthermore the package macros give their final results in two expansion steps.
They expand `fully' (the first token of) their arguments so that they can be
arbitrarily chained. Hence \centeredline{%
  |\xintLen{\xintQuo{\xintPow{2}{1000}}{\xintFac{100}}}|} expands in two steps
and tells us that &[2^{1000}/100!]& has {\y} digits. This is not so many, let us
print them here: \digitstt{\printnumber\x}.

For the sake of typesetting this documentation and not have big numbers
extend into the margin and go beyond the page physical limits, I use
these commands (not provided by the package):
\dverb|&
\def\allowsplits #1{\ifx #1\relax \else #1\hskip 0pt plus 1pt \relax
                     \expandafter\allowsplits\fi}%
\def\printnumber #1{\expandafter\expandafter\expandafter
                    \allowsplits #1\relax }% 
% Expands twice before printing.
|

The |\printnumber| macro is not part of the package and would need additional
thinking for more general use.\footnote{as explained in
  \hyperref[fn:np]{a previous footnote},
  the |numprint| package may also be used, in text mode only (as the thousand
  separator seemingly ends up typeset in a |\string\hbox| when in math
  mode).} It may be used as |\printnumber 
{\xintQuo{\xintPow {2}{1000}}{\xintFac{100}}}|, or as |\printnumber\mynumber| if
the macro |\mynumber| was previously defined via an |\edef|, as for
example:\centeredline{ |\edef\mynumber {\xintQuo {\xintPow
      {2}{1000}}{\xintFac{100}}}|}% 
or as
  |\expandafter\printnumber\expandafter{\mynumber}|, if the macro |\mynumber| is
  defined by a |\newcommand| or a |\def| (see below {\autoref{item:xpxp}} for the
  underlying expansion issue; adding four |\expandafter|'s to |\printnumber|
  would allow to use it directly as |\printnumber\mynumber| with a |\mynumber|
  itself defined via a |\def| or |\newcommand|).


Just to show off, let's print 300 digits (after the decimal point) of
the decimal expansion of &0.7^{-25}&:\footnote{the |\string\np| typesetting
  macro 
  is from the |numprint| package.}
\centeredline{|\np {\xintTrunc {300}{\xinttheexpr .7^-25\relax}}\dots|}
\digitstt{\np {\xintTrunc {300}{\xinttheexpr .7^-25\relax}}\dots }

This computation uses the macro \csb{xintTrunc} from package \xintfracname
wich extends to fractions the basic arithmetic operations defined for
integers by \xintname. It also uses \csb{xinttheexpr} from package
\xintexprname, which allows to use standard notations. Note that the
fraction |.7^-25| is first evaluated exactly; for some more complex inputs,
such as |.7123045678952^-243|, the exact evaluation before truncation would
be expensive, and (assuming one needs twenty digits) one
would rather use floating mode:
\centeredline{|\xintDigits:=20;
               \np{\xintthefloatexpr .7123045678952^-243\relax}|}%
\xintDigits:=20;%
\centeredline{|.7123045678952^-243|${}\approx{}$%
\digitstt{\np{\xintthefloatexpr .7123045678952^-243\relax }}}

% 6.342,022,117,488,416,127,3  10^35
% maple n'aime pas ^-243 il veut les parenthèses, bon et il donne, en Digits
% = 24: 0.634202211748841612732270 10^36

\xintDigits:=16;

Important points, to be noted, related to the expansion of arguments:
\begin{enumerate}
\item the macros expand `fully' their arguments, this means that they expand
  the first token seen (for each argument), then expand
  \MyMarginNote{Changed in |1.06|}, etc..., until something un-expandable
  such as a\strut{} digit or a brace is hit against. This example
  \centeredline{|\def\x{98765}\def\y{43210}|%
    |\xintAdd {\x}{\x\y}|} is \emph{not} a legal construct, as the |\y| will
  remain untouched by expansion and not get converted into the digits which
  are expected by the sub-routines of |\xintAdd|. It is a |\numexpr|
  which will expand it and an arithmetic overflow will arise as |9876543210|
  exceeds the \TeX{} bounds.

  \begingroup\slshape
  The |1.07| novelty\MyMarginNote{New with |1.07|} \csb{xinttheexpr} has brought
  a solution: here one would write |\xinttheexpr \x+\x\y\relax|, or
  |\xintAdd\x{\xinttheexpr\x\y\relax}|.\hfill
  \endgroup

\item Unfortunately, after |\def\x {12}|, one can not use just
  {\color{blue}|-\x|} as input to one of the package macros: the rules above
  explain that the expansion will act only on the minus sign,
  hence do nothing. The only way is to use the \csb{xintOpp}
  macro, which replaces a number with its opposite.

  \begingroup\slshape
  Again, this is otherwise inside an \csb{xinttheexpr}-ession or
  \csb{xintthefloatexpr}-ession. There,\MyMarginNote{New with |1.07|} the
  minus sign may prefix macros which will expand to numbers (or parentheses
  etc...)
  \endgroup

\def\x {12}%
\def\AplusBC #1#2#3{\xintAdd {#1}{\xintMul {#2}{#3}}}%


\item \label{item:xpxp} With the definition \centeredline{%
    |\def\AplusBC #1#2#3{\xintAdd {#1}{\xintMul {#2}{#3}}}|} one
  obtains an expandable macro producing the expected result, not
  in two, but rather in three steps: a first expansion is consumed
  by the macro expanding to its definition. The new expansion policy starting
  with the package
  release |1.06| allows to use this inside other 
  package `primitives' or also similar macros: {|\xintAdd
    {\AplusBC {1}{2}{3}}{4}|} does work and returns \digitstt{\xintAdd
    {\AplusBC {1}{2}{3}}{4}}.

  If, for some reason, it is important to create a macro expanding in two steps
  to its final value, one may either do: 
\smallskip\centeredline {|\def\AplusBC
    #1#2#3{|{\color{blue}|\romannumeral-`0\xintAdd |}|{#1}{\xintMul {#2}{#3}}}|}or use the \emph{lowercase} form of
  \csa{xintAdd}: \smallskip\centeredline {|\def\AplusBC
    #1#2#3{|{\color{blue}|\romannumeral0\xintadd |}|{#1}{\xintMul {#2}{#3}}}|}
  
  and then \csa{AplusBC} will share the same properties as do the
  other \xintname `primitive' macros.


%   All \xintname provided public macros have such a lowercase form. To
%   more fully imitate the \xintname standard habits, the example above should
%   thus be treated via the creation of two macros:\par\parskip0pt
%   \hspace*{1cm}|\def\aplusbc #1#2#3{\xintadd {#1}{\xintMul {#2}{#3}}}|\par
%   \hspace*{1cm}|\def\AplusBC {\romannumeral0\aplusbc}|\par
%   Or, for people using the \LaTeX{} vocabulary:\par
%   \hspace*{1cm}|\newcommand*{\aplusbc}[3]{\xintadd {#1}{\xintMul
%       {#2}{#3}}}|\par 
%   \hspace*{1cm}|\newcommand*{\AplusBC}{\romannumeral0\aplusbc}|\par

%   This then allows further definitions of macros expanding in two steps only,
%   such as:\par
%   |\def\aplusbcsquared #1#2#3{\aplusbc {#1}{#2}{\xintSqr{#3}}}|\par
%   |\def\AplusBCSquared {\romannumeral0\aplusbcsquared}|\par
%   |\newcommand*\myalgebra [6]{\xintmul {\AplusBC {#1}{#2}{#3}}{\AplusBC
%       {#4}{#5}{#6}}}|\par
%   |\newcommand*\MyAlgebra {\romannumeral0\myalgebra}|\par
\end{enumerate}

The |\romannumeral0| and |\romannumeral-`0| things above look like an invitation
to hacker's territory; if it is not important that the macro expands in two
steps only, there is no reason to follow these guidelines. Just chain
arbitrarily the package macros, and the new ones will be completely expandable
and usable one within the other.

Release |1.07| has the \csb{xintNewExpr} command\MyMarginNote{New with
  |1.07|} which automatizes the creation of such expandable macros:
\centeredline{|\xintNewExpr\AplusBC[3]{#1+#2*#3}|} creates the |\AplusBC|
macro doing the above and expanding in two expansion steps.


\section {Inputs and outputs}\label{sec:inputs}

The core bundle constituents are \xintname, \xintfracname, \xintexprname,
each one loading its predecessor. The base constituent \xintname only deals
with integers, of arbitrary sizes, and apart from its macro \csb{xintNum},
the input format is rather strict. 

\begin{framed}
  With release |1.09a|, arithmetic macros of \xintname parse their arguments
  automatically through \csb{xintNum}. This means also that the arguments may
  already contain infix algebra with count registers, see
  \hyperlink{useofcount}{Use of count registers}.
\end{framed}

Then \xintfracname extends the scope to
fractions: numerators and
denominators are separated by a forward slash and may contain each an
optional fractional part after the decimal mark (which has to be a dot) and a
scientific part\MyMarginNote{New with |1.07|} (with a lower case |e|).


The numeric arguments to the bundle macros may be of various types,
extending in generality:

\begin{enumerate}
\item `short' integers, \emph{i.e.} less than (or equal to) in absolute value
  \np{\xintiSub{\xintiPow {2}{31}}1}. I will refer to this as the `\TeX{}' or
  `|\numexpr|' limit. This is the case for arguments which serve to count or
  index something. It is also the case for the exponent in the power function
  and for the argument to the factorial function. The bounds have been
  (arbitrarily) lowered to \np{999999999} and \np{999999} respectively for the
  latter cases.\footnote{the float power function limits the exponent to the
    \TeX{} bound, not |999999999|, and it has a variant with no imposed limit on
    the exponent; but the result of the computation must in all cases be
    representable with a power of ten exponent obeying the \TeX{} bound.} When
  the argument exceeds the \TeX{} bound (either positively or negatively), an
  error will originate from a \csa{numexpr} expression and it may sometimes be
  followed by a more specific error `message' from a package macro.
\item `long' integers, which are the bread and butter of the package commands.
  They are signed integers with an illimited number of digits.
  Theoretically though, most of the macros require that the number of digits
  itself be less than the \TeX-\csa{numexpr} bound.\footnote{and to be very
    precise, less than the \TeX{} bound minus eight, due to the way the length
    is evaluated.}
  Some macros, such as addition when \xintfracname has not been loaded, do not
  measure first the length of their arguments and could theoretically be used
  with `gigantic' integers with a larger number of digits. However memory
  constraints from the \TeX{} implementation probably exclude such inputs.
  Concretely though, multiplying out two 1000 digits numbers is already a
  longish operation.
\item `fractions': they become available after having loaded the \xintfracname
  package. Their format on input will be described next, a fraction has a
  numerator, a forward slash and then a denominator.\MyMarginNote{New with
    |1.07|} It is now possible to use scientific notation, with a lowercase
  |e| on input (an uppercase |E| is accepted inside the |\xintexpr|-essions).
  The decimal mark must be a dot and not a comma. No separator for thousands
  should be used on inputs, and except within |\xintexpr|-essions, spaces
  should be avoided.
\end{enumerate}

% \begin{framed}
%   With only package \xintname loaded \TeX{}'s count registers must be prefixed
%   by |\the| or |\number| inside the arguments to the package macros, except in
%   places (argument of the factorial, exponent of the power function, ...) where
%   the documentation of the macro says otherwise. 

%   With the macros\MyMarginNote[\kern\FrameSep\kern\FrameRule]{Not previously
%     documented} of \xintfracname (including those of \xintname extended to 
%   fractions) a count register is \emph{accepted} on input, with no need to be
%   prefixed by |\the| or |\number|.

%   Inside |\xinttheexpr...\relax|, count registers must again be prefixed by
%   |\the| or 
%   |\number| (if they are not arguments to macros of \xintfracname).
% \end{framed}


\edef\z {\xintAdd
    {+--0367.8920280/-++278.289287}{-109.2882/+270.12898}}

  The package macros first operate a `full' expansion\MyMarginNote{New with
    |1.06|} of their \strut{} arguments, as explained above: only the first
  token is repeatedly expanded until no more is possible.

  On the other hand, this expansion is a\MyMarginNote{New with |1.06|} complete
  one for those arguments which are constrained to obey the \TeX{} bounds on
  numbers, as they are systematically inserted inside a |\numexpr...\relax|
  expression.

%% \def\obsolete{\MyMarginNote{This paragraph made obsolete by \digitstt{1.09a}.}}

The allowed input formats for `long numbers' and `fractions' are:
\begin{enumerate}
\item the strict format is for some macros of \xintname. The number should
  be a string of digits, optionally preceded by a unique minus sign. The first
  digit can be zero only if the number is zero. A plus sign is not accepted.
  There is a macro \csb{xintNum} which normalizes to this form an input having
  arbitrarily many minus and plus signs, followed by a string of zeros, then
  digits:\centeredline{|\xintNum
  {+-+-+----++-++----00000000009876543210}|\digitstt{=\xintNum
    {+-+-+----++-++----0000000009876543210}}}%
  Note that |-0| is not legal input and will confuse \xintname (but not
  \csa{xintNum} which even accepts an  empty input).
\item the extended integer format is for the arithmetic macros of \xintname
  which 
  automatically parse their arguments via \csb{xintNum}, and for the fractions
  serving as input to 
  the macros of  \xintfracname: they are 
  (or expand to) |A/B| (or just an integer |A|), where |A| and |B| will be
  automatically given to \csb{xintNum}.
  Each of |A| and |B| may be decimal numbers: with a decimal point and 
  digits following it. Here is an example: \centeredline{|\xintAdd
    {+--0367.8920280/-++278.289287}{-109.2882/+270.12898}|}%
  Incidentally this evaluates to \centeredline{\digitstt{=\z}}%
  \centeredline{\digitstt{=\xintIrr\z{} (irreducible)}}%
  \centeredline{\digitstt{=\xintTrunc {50}{\z}\dots}}%
  where the second line was produced with |\xintIrr| and the next with
  |\xintTrunc {50}| to get fifty digits of the decimal expansion following the
  decimal mark. Scientific notation\MyMarginNote{New with |1.07|} is accepted on
  input both for the numerators and denominators of fractions, and is produced
  on output by \csb{xintFloat}: \centeredline{|\xintAdd{10.1e1}{101.010e3}|%
    \digitstt{=\xintAdd{10.1e1}{101.010e3}}}%
This last example shows that fractions with a denominator equal to one, are
generally printed as fraction. In math mode \csb{xintFrac} will remove such
dummy denominators, and in inline text mode one has \csb{xintPRaw}.
 \centeredline{|\xintPRaw{\xintAdd{10.1e1}{101.010e3}}|%
    \digitstt{=\xintPRaw{\xintAdd{10.1e1}{101.010e3}}}} \centeredline{|\xintRaw{1.234e5/6.789e3}|\digitstt{=\xintRaw{1.234e5/6.789e3}}}%
  \centeredline{|\xintFloat[24]{1/66049}|\digitstt{=\xintFloat[24]{1/66049}}}
\end{enumerate}
Of course, even with \xintfracname is loaded, some macros by their nature can
not accept fractions on input. Starting with release |1.05| most of them have
also been extended to accept a fraction actually reducing to an integer. For
example it used to be the case with the earlier releases that |\xintQuo
{100/2}{12/3}| would not work (the macro \csb{xintQuo} computes a euclidean
quotient). It now does, because its arguments are, after simplification,
integers.

A number can start directly with a decimal point:
\centeredline{|\xintPow{-.3/.7}{11}|\digitstt{=\xintPow{-.3/+.7}{11}}}%
\centeredline{|\xinttheexpr (-.3/.7)^11\relax|%
               \digitstt{=\xinttheexpr (-.3/.7)^11\relax}}
It is also licit to use |\A/\B| as input if each of |\A| and |\B| expands (in
the sense previously described) to a ``decimal number'' as examplified above by
the numerators and denominators (thus, possibly with a `scientific' exponent
part, with a lowercase `e'). Or one may have just one macro |\C| which
expands to such a ``fraction with optional decimal points'', or mixed things
such as |\A 245/7.77|, where the numerator will be the concatenation of the
expansion of |\A| and |245|. But, as explained already |123\A| is a no-go,
\emph{except inside an |\string\xintexpr|-ession}!

Finally, after the decimal point there may be |eN| where |N| is a positive
or negative number (obeying the \TeX{} bounds on
integers).\MyMarginNote{New with |1.07|} This `|e|' part (which must be in
lowercase, except inside |\xintexpr|-essions) may appear both at the numerator
and at the denominator. \centeredline{|\xintRaw
  {+--+1253.2782e++--3/---0087.123e---5}|\digitstt{=\xintRaw
    {+--+1253.2782e++--3/---0087.123e---5}}}

\hypertarget{useofcount}{\paragraph{Use of count registers:}} when\MyMarginNote{New
  documentation section (|1.08b|)} an argument
to a macro is said in the documentation to have to obey the \TeX{} bound, this
means that it is fed to a |\numexpr...\relax|, hence it is subjected to a
complete expansion which must delivers an integer, and count registers and even
algebraic expressions with them like
|\mycountA+\mycountB*17-\mycountC/12+\mycountD| are admissible arguments (the
slash stands here for the integer (rounded) division done by |\numexpr|). This
applies in particular to the number of digits to truncate or round with, to the
indices of a series partial sum, \dots

With \xintfracname.sty loaded and for arguments of macros accepting fractions on
inputs, use of count
registers and even direct algebra with them is possible: a count register
|\mycountA| or |\count 255| is admissible as numerator or also as denominator,
with no need to be prefixed by |\the| or |\number|. It is even possible to have
algebraic expressions, with the limitation (how to overcome it in complete
generality will be explained later) that each of the numerator and
denominator should be expressed with at most \emph{eight} tokens, and the
forward slash symbol must be protected by braces to be used inside the
|\numexpr| and not be interpreted as the fraction slash. Note that |\mycountA|
is 
one token but |\count 255| is four tokens. Example:
|\mycountA+\mycountB{/}17/1+\mycountA*\mycountB|, or |\count 0+\count
2{/}17/1+\count 0*\count 2|, but in the latter case the numerator has
the maximal allowed number of tokens (the braced slash counts for only one).
\centeredline{|\cnta 10 \cntb 35 \xintRaw
  {\cnta+\cntb{/}17/1+\cnta*\cntb}|\digitstt{->\cnta 10 \cntb 35 \xintRaw
    {\cnta+\cntb{/}17/1+\cnta*\cntb}}}

% This possibility of using directly count registers and even algebraic expression
% is only for arguments to macros of \xintfracname: inside |\xintexpr...\relax|
% one can not use directly a count register, it must be prefixed by |\the| or
% |\number|. 

% And with only \xintname.sty is loaded, the \emph{only} macro allowing
% the
% above is \csb{xintNum}:  
% \centeredline{|\cnta 10 \cntb 100 \xintNum
%   {\cnta+\cntb+\cnta*\cntb}|\digitstt{->\cnta 10 \cntb 100 \xintNum
%     {\cnta+\cntb+\cnta*\cntb}}} 
% Note that |\cnta+\cntb+2*\cnta*\cntb| would be too long (it has nine tokens).
% Using braces works:
% \centeredline{|\cnta 10 \cntb 100 \xintNum
%   {\cnta+\cntb+{2*\cnta*\cntb}}|\digitstt{->\cnta 10 \cntb 100 \xintNum
%     {\cnta+\cntb+{2*\cnta*\cntb}}}} 
% The braces should be used for some sub-part of the expression, not for the
% entire thing; 

For long algebraic expressions, the trick is to encompass them in |\numexpr
... \relax| \emph{inside a pair of braces}: 
\dverb|&
\cnta 100 \cntb 10 \cntc 1 
\xintPRaw {\numexpr {\cnta*\cnta+\cntb*\cntb+\cntc*\cntc+
                    2*\cnta*\cntb+2*\cnta*\cntc+2*\cntb*\cntc}\relax/%
          \numexpr {\cnta*\cnta+\cntb*\cntb+\cntc*\cntc}\relax }|
\cnta 100 \cntb 10 \cntc 1 
\centeredline{\digitstt{\xintPRaw {\numexpr
      {\cnta*\cnta+\cntb*\cntb+\cntc*\cntc+ 
                    2*\cnta*\cntb+2*\cnta*\cntc+2*\cntb*\cntc}\relax/%
          \numexpr {\cnta*\cnta+\cntb*\cntb+\cntc*\cntc}\relax }}}
    \begin{framed}
      Macros expecting fractions may be fed with arbitrarily long
      |\numexpr|-expressions by the trick of using 
      |\numexpr {long_expression}\relax| as numerator and/or denominator of the
      argument to the macro. This is a trick as the braces would not be accepted
      as regular 
|\numexpr|-syntax: and indeed, they 
        are removed at some point in the processing.


      Contrarily, macros expecting an
      integer obeying the \TeX{} bound are capable of  receiving directly
      |long_expression| as argument, the |\numexpr ... \relax| will be
      added internally (without the braces of course, they are not legal inside
      |\numexpr|).
    \end{framed}

    \paragraph {Outputs: } loading \xintfracname not only relaxes the format of
    the inputs; it also modifies the format of the outputs: except when a
    fraction is filtered on output by \csb{xintIrr} or \csb{xintRawWithZeros},
    or \csb{xintPRaw}, or by the truncation or rounding macros, or is given as
    argument in math mode to \csb{xintFrac}, the output format is normally of
    the the \fbox{|A/B[n]|} form (which stands for |(A/B)|$\times$|10^n|). The
    |A| and |B| may end in zeros (\emph{i.e}, |n| does not represent all powers
    of ten), and will generally have a common factor. The denominator |B| is
    always strictly positive.

A macro \csb{xintFrac} is provided
for the typesetting (math-mode only) of such a `raw' output. Of course, the
\csb{xintFrac} itself is not accepted as input to the package macros.

Direct user input of things such as |16000/289072[17]| or |3[-4]| is authorized.
It is even possible to use |\A/\B[17]| if |\A| expands to |16000| and |\B| to
|289072|, or |\A| if |\A| expands to |3[-4]|. However,%\IMPORTANT{}
\MyMarginNote{Important! }
NEITHER the numerator NOR 
the denominator may then have a decimal
point. And, for this format, ONLY the numerator may carry
a UNIQUE minus sign (and no superfluous leading zeros; and NO plus sign).
This format with a power of ten represented by a number within
  square brackets is the output format used by (almost all) \xintfracname
  macros dealing with fractions.
  It is allowed for user input but the parsing is minimal and it
  is very important to follow the above rules. This reduced
  flexibility, compared to the format without the square brackets,
  allows chaining package macros without too much speed impact, as
  they always output computation results in the |A/B[n]| form. 

  \begin{framed}
    All computations done by \xintfracname on fractions are exact. Inputs
    containing decimal points or scientific parts do not make the package switch
    to a `floating-point' mode. The inputs, however long, are always converted
    into exact internal representations.

    Floating point evaluations are done with special macros containing
    `Float' in their names, or inside |\xintthefloatexpr|-essions.
  \end{framed}

Generally speaking, there should be no spaces among the digits in the inputs
(in arguments to the package macros).
Although most would be harmless in most macros, there are some cases
where spaces could break havoc. So the best is to avoid them entirely.

This is entirely otherwise inside an |\xintexpr|-ession, where spaces are
expected to, as a general rule (with possible exceptions related to the
allowed use of braces, see the
\hyperref[sec:comexpr]{documentation}) be completely
harmless, and even recommended for making the source more legible.

Syntax such as |\xintMul\A\B| is accepted and equivalent\footnote{see however
  near the end of \hyperref[sec:ifcase]{this later section} for the important
  difference when used in contexts where \TeX{} expects a number, such as
  following an \csa{ifcase} or an \csa{ifnum}.} to |\xintMul {\A}{\B}|. Or
course |\xintAdd\xintMul\A\B\C| does not work, the product operation must be put
within braces: |\xintAdd{\xintMul\A\B}\C|. It would be nice to have a functional
form |\add(x,\mul(y,z))| but this is not provided by the package.\footnote{yes
  it is with the |1.09a| \csa{xintexpr}, \csa{xintexpr}
  \texttt{add(x,mul(y,z))}\csa{relax}.} Arguments must be either within braces
or a 
single control sequence.

Note that |-| and |+| may serve only as unary operators, on \emph{explicit}
numbers. They can not serve to prefix macros evaluating to such numbers,
\emph{except inside an |\string\xintexpr|-ession.}

\section{More on fractions}

With package \xintfracname loaded, the routines \csb{xintAdd}, \csb{xintSub},
\csb{xintMul}, \csb{xintPow}, \csb{xintSum}, \csb{xintPrd} are modified to allow
fractions on input,\footnote{of course, the power function does not accept a
  fractional exponent. Or rather, does not expect, and errors will result if one
  is provided.}\,\footnote{macros \csb{xintiAdd}, \csb{xintiSub},
  \csb{xintiMul}, \csb{xintiPow}, \csb{xintiSum}, \csb{xintiPrd} are the
  original ones dealing only with integers. They are available as synonyms, also
  when \xintfracname is not loaded. }\,\footnote{also \csb{xintCmp},
  \csb{xintSgn}, \csb{xintOpp}, \csb{xintAbs}, \csb{xintMax}, \csb{xintMin} are
  extended to fractions and have their integer-only initial
  synonyms.}\,\footnote{and \csb{xintFac}, \csb{xintQuo}, \csb{xintRem},
  \csb{xintDivision}, \csb{xintGeq}, \csb{xintFDg}, \csb{xintLDg},
  \csb{xintOdd}, \csb{xintMON}, \csb{xintMMON} all accept a fractional input as
  long as it reduces to an integer.} and produce on output a fractional number
|f=A/B[n]| where |A| and |B| are integers, with |B| positive, and |n| is a
signed ``small'' integer (\emph{i.e} less in absolute value than |2^{31}-9|).
This represents |(A/B)| times |10^n|. The fraction |f| may be, and generally is,
reducible, and |A| and |B| may well end up with zeros (\emph{i.e.} |n| does not
contain all powers of 10). Conversely, this format is accepted on input (and is
parsed more quickly than fractions containing decimal points; the input may be a
number without denominator).\footnote{at each stage of the computations, the sum
  of |n| and the length of |A|, or of the absolute value of |n| and the length
  of |B|, must be kept less than |2\string^\string{31\string}-9|.}

The \csb{xintiAdd}, \csb{xintiSub}, \csb{xintiMul}, \csb{xintiPow},
\csb{xintiSum}, \csb{xintiPrd}, etc... are the
original\MyMarginNote{\digitstt{1.09a}: the original now also use \csa{xintNum}}
un-modified 
integer-only versions. They have less parsing overhead.



The macro \csb{xintRaw} prints the fraction 
directly from its internal representation in |A/B[n]| form. To convert
the trailing |[n]| into explicit zeros either at the numerator or the
denominator, use \csb{xintRawWithZeros}. In both cases the |B| is printed
even if it has value |1|. The macro \csb{xintPRaw} will not print the |[n]| if
|n=0| and will not print the |/B| if |B=1|.

Conversely (sort of), the macro \csb{xintREZ}
 puts all powers of ten into the |[n]| (REZ stands for remove zeros).
Here also, the |B| is printed even if it has value |1|.

The macro \csb{xintIrr} reduces the fraction to its irreducible form |C/D|
(without a trailing |[0]|), and\MyMarginNote{Changed in |1.08|} it prints
the |D| even if |D=1|. 

The macro \csb{xintNum} from package \xintname is extended: it now does like
\csa{xintIrr}, raises an error if the fraction did not reduce to an integer, and
outputs the numerator. This macro
should be used when one knows that necessarily the result of a computation is an
integer, and one wants to get rid of its denominator |/1| which would be left by
\csa{xintIrr}.


The macro \csb{xintTrunc}|{N}{f}| prints\footnote{`prints' does not at all mean
  that this macro is designed for typesetting; I am just using the verb here in
  analogy to the effect of the functioning of a computing software in console
  mode. The package does not provide any `printing' facility, besides its
  rudimentary \csb{xintFrac} and \csb{xintFwOver} math-mode only macros. To deal
  with really long numbers, some macros are necessary as \TeX{} by default will
  print a long number on a single line extending beyond the page limits. The
  \csa{printnumber} command used in this documentation is just one way to
  address this problem, some other method should be used if it is important that
  digits occupy the same width always.} the decimal expansion of |f| with |N|
digits after the decimal point.\footnote{the current release does not provide a
  macro to get the period of the decimal expansion.} Currently, it does not
verify that |N| is non-negative and strange things could happen with a negative
|N|. Of course a negative |f| is no problem, needless to say. When the original
fraction is negative and its truncation has only zeros, it is printed as
|-0.0...0|, with |N| zeros following the decimal point:
\centeredline{|\xintTrunc {5}{\xintPow {-13}{-9}}|\digitstt{=\xintTrunc
    {5}{\xintPow {-13}{-9}}}}%
\centeredline{|\xintTrunc {20}{\xintPow {-13}{-9}}|\digitstt{=\xintTrunc
    {20}{\xintPow {-13}{-9}}}} The output always contains a decimal point (even
for |N=0|) followed by |N| digits, except when the original fraction was zero.
In that case the output is |0|, with no decimal point. \centeredline{|\xintTrunc
  {10}{\xintSum {{1/2}{1/3}{1/5}{-31/30}}}|%
  \digitstt{=\xintTrunc {10}{\xintSum {{1/2}{1/3}{1/5}{-31/30}}}}}

% The output of \csb{xintTrunc} may of course serve as input to the other
% macros. And this is almost necessary when summing hundreds of
% terms of a series with fractional coefficients, as the exact
% rational number quickly becomes quite big (when doing the sum from
% |n=|1 to |n=|1000 of |1/n|, the raw denominator is &1000!&, which
% has 2568 digits) ; but for less than fifty terms with small
% denominators it is often possible to work with the exact
% value without too much toll on the compilation time. 

% The macro \csb{xintiTrunc}|{N}{f}| is like \csa{xintTrunc}|{N}{f}|
% followed by multiplication by |10^N|. Thus, it outputs an integer
% in a format acceptable by the integer-only macros. This is also
% convenient when computing partial sums of series, with a fixed number of
% digits after the decimal point: it is a bit
% faster to sum with \csb{xintiSeries} the integers produced by
% \csa{xintiTrunc}|{N}| than it is to use the general
% \csb{xintSeries} on the decimal numbers produced by
% \csa{xintTrunc}|{N}|. These latter macros belong to the \xintseriesname
% package.

% Needless to say when using \csa{xintTrunc} or \csa{xintiTrunc} on
% intermediate computations the ending digits of the final result
% are, pending further analysis, only indications of those of the
% fraction an exact computation would have produced.

\edef\z {\xintPow {1.01}{100}}

The macro \csb{xintiTrunc}|{N}{f}| is like \csa{xintTrunc}|{N}{f}|
followed by multiplication by |10^N|. Thus, it outputs an integer
in a format acceptable by the integer-only macros. 
To get the integer part of the decimal expansion of |f|, use
|\xintiTrunc{0}{f}|: \centeredline{|\xintiTrunc {0}{\xintPow
    {1.01}{100}}|\digitstt{=\xintiTrunc {0}\z}}%
\centeredline{|\xintiTrunc {0}{\xintPow{0.123}{-10}}|\digitstt{=\xintiTrunc
    {0}{\xintPow{0.123}{-10}}}}

See also the documentations of \csb{xintRound}, \csb{xintiRound} and
\csb{xintFloat}.

\section{\csh{ifcase}, \csh{ifnum}, ... constructs}\label{sec:ifcase}

When using things such as |\ifcase \xintSgn{\A}| one has to leave
a space after the closing brace for \TeX{} to
stop its scanning for a number: once \TeX{} has finished expanding
|\xintSgn{\A}| and has so far obtained either |1|, |0|, or |-1|, a
space (or something `unexpandable') must stop it looking for more
digits. Using |\ifcase\xintSgn\A| without the braces is very dangerous,
because the blanks (including the end of line) following |\A| will be
skipped and not serve to stop the number which |\ifcase| is looking for.
With |\def\A{1}|:
\dverb|&
\ifcase \xintSgn\A   0\or OK\else ERROR\fi   ---> gives ERROR
\ifcase \xintSgn{\A} 0\or OK\else ERROR\fi   ---> gives OK
|
% \def\A{1}
% \ifcase \xintSgn\A   0\or OK\else ERROR\fi\ 
% \ifcase \xintSgn{\A} 0\or OK\else ERROR\fi

Release |1.07| provides the expandable\MyMarginNote{New with |1.07|}
\csb{xintSgnFork} which chooses one of three branches according to whether its
argument expands to |-1|, |0| or |1|. This, rather than the corresponding
|\ifcase|, should be used when such a fork is needed as argument to one of the
package macros.

Release |1.09a| has \csb{xintifSgn} which does not require\MyMarginNote{New with |1.09a|} its first argument to
be |-1|, |0|, |1|, it first computes the sign. There are also \csb{xintifZero},
\csb{xintifNotZero}, \csb{xintifGt}, \csb{xintifLt}, \csb{xintifEq}.


\section{Multiple outputs}\label{sec:multout}

Some macros have an output consisting of more than one number, each one is then
within braces. Examples of multiple-output macros are \csb{xintDivision} which
gives first the quotient and then the remainder of euclidean division,
\csb{xintBezout} from the \xintgcdname package which outputs five numbers,
\csb{xintFtoCv} from the \xintcfracname package which returns the list of the
convergents of a fraction, ... the next two sections explain ways to deal,
expandably or not, with such outputs.

See the \autoref{xintDecSplit} for a rare example of a bundle macro which may
return an empty string, or a number prefixed by a chain of zeros. This is the
only situation where a macro from the package \xintname may output something
which could require parsing through \csa{xintNum} before further processing by
the other (integer-only) package macros from \xintname.


\section{Assignments}

\xintAssign\xintBezout{357}{323}\to\tmpA\tmpB\tmpU\tmpV\tmpD

It might not be necessary to maintain at all times complete
expandability. For example why not allow oneself the two definitions
|\edef\A {\xintQuo{100}{3}}| and |\edef\B {\xintRem {100}{3}}|. A special
  syntax is provided to make these things more efficient, as the package
  provides 
 \csa{xintDivision} which computes both quotient and
  remainder at the same time:
  \centeredline{\csb{xintAssign}\csa{xintDivision}|{100}{3}|\csbnolk{to}|\A\B|}
  \centeredline{\csb{xintAssign}\csa{xintDivision}%
|{\xintiPow {2}{1000}}{\xintFac{100}}|\csbnolk{to}|\A\B|} gives
\xintAssign\xintDivision{\xintiPow {2}{1000}}{\xintFac{100}}\to\A\B
|\meaning\A|\digitstt{: \expandafter\allowsplits\meaning\A\relax} and
|\meaning\B|\digitstt{: \expandafter\allowsplits\meaning\B\relax}. 


  Another example (which uses a macro from the \xintgcdname
  package):
  \centeredline{\csb{xintAssign}\csa{xintBezout}|{357}{323}|%
    \csbnolk{to}|\A\B\U\V\D|} is equivalent to setting |\A| to
  \digitstt{\tmpA}, |\B| to \digitstt{\tmpB}, |\U| to \digitstt{\tmpU},
  |\V| to \digitstt{\tmpV}, and |\D| to \digitstt{\tmpD}. And indeed
  \digitstt{(\tmpU)$\times$\tmpA-(\tmpV)$\times$\tmpB$=$%
   \xintiSub{\xintiMul\tmpU\tmpA}{\xintiMul\tmpV\tmpB}}
  is a Bezout Identity.

\xintAssign\xintBezout{3570902836026}{200467139463}\to\tmpA\tmpB\tmpU\tmpV\tmpD
\centeredline{\csb{xintAssign}\csa{xintBezout}|{3570902836026}{200467139463}|%
    \csbnolk{to}|\A\B\U\V\D|} gives then |\U|\digitstt{:
    \expandafter\allowsplits\meaning\tmpU\relax},
  |\V|\digitstt{: 
    \expandafter\allowsplits\meaning\tmpV\relax} and |\D|\digitstt{=\tmpD}.

  When one does not know in advance the number of tokens, one can use
  \csa{xintAssignArray} or its synonym \csa{xintDigitsOf}:
  \centeredline{\csb{xintDigitsOf}\csa{xintiPow}|{2}{100}|\csbnolk{to}\csa{Out}}
  This defines \csa{Out} to be macro with one parameter, \csa{Out}|{0}| gives
  the size |N| of the array and \csa{Out}|{n}|, for |n| from |1| to |N| then
  gives the |n|th element of the array, here the |n|th digit of &2^{100}&, from
  the most significant to the least significant. As usual, the generated macro
  \csa{Out} is completely expandable (in two steps). As it wouldn't make much
  sense to allow indices exceeding the \TeX{} bounds, the macros created by
  \csb{xintAssignArray} put their argument inside a
  \csa{numexpr},\MyMarginNoteWithBrace{Changed in |1.06|}
   so it is completely expanded and
may be a count register, not necessarily prefixed by |\the| or |\number|.
Consider the following code snippet:
\dverb+&
\newcount\cnta
\newcount\cntb
\begingroup
\xintDigitsOf\xintiPow{2}{100}\to\Out
\cnta = 1
\cntb = 0
\loop
\advance \cntb \xintiSqr{\Out{\cnta}}
\ifnum \cnta < \Out{0}
\advance\cnta 1
\repeat

|2^{100}| (=\xintiPow {2}{100}) has \Out{0} digits and the sum of
their squares is \the\cntb. These digits are, from the least to
the most significant: \cnta = \Out{0} 
\loop \Out{\cnta}\ifnum \cnta > 1 \advance\cnta -1 , \repeat.
\endgroup
+

\edef\z{\xintiPow {2}{100}}

\begingroup
\xintDigitsOf\z\to\Out
\cnta = 1
\cntb = 0
\loop
\advance \cntb \xintiSqr{\Out{\cnta}}
\ifnum \cnta < \Out{0}
\advance\cnta 1
\repeat

&2^{100}& (=\z) has \Out{0} digits and the sum of
their squares is \the\cntb. These digits are, from the least to
the most significant: \cnta = \Out{0} 
\loop \Out{\cnta}\ifnum \cnta > 1 \advance\cnta -1 , \repeat.
\endgroup

We used a group in order to release the memory taken by the
\csa{Out} array: indeed internally, besides \csa{Out} itself,
additional macros are defined which are \csa{Out0}, \csa{Out00},
\csa{Out1}, \csa{Out2}, ..., \csa{OutN}, where |N| is the size of
the array (which is the value returned by |\Out{0}|; the digits
are parts of the names not arguments). 

The command \csb{xintRelaxArray}\csa{Out} sets all these macros to
\csa{relax}, but it was simpler to put everything withing a group.

Needless to say \csb{xintAssign}, \csb{xintAssignArray} and
\csb{xintDigitsOf} do not do any check on whether the macros they
define are already defined.

In the example above, we deliberately broke all rules of complete
expandability, but had we wanted to compute the sum of the digits,
not the sum of the squares, we could just have written:
\centeredline{\csb{xintiSum}|{\xintiPow{2}{100}}|\digitstt{=%
    \xintiSum\z}} Indeed, \csa{xintiSum} is usually
used as in \centeredline{%
  \csb{xintiSum}|{{123}{-345}{\xintFac{7}}{\xintiOpp{\xintRem{3347}{591}}}}|%
                 \digitstt{=%
    \xintiSum{{123}{-345}{\xintFac{7}}{\xintiOpp{\xintRem{3347}{591}}}}}}
but in the example above each digit of &2^{100}& is treated as
would have been a summand enclosed within braces, due to the rules
of \TeX{} for parsing macro arguments.

Note that |{-\xintRem{3347}{591}}| is not a valid input, because
the expansion will apply only to the minus sign and leave
unaffected the |\xintRem|. So we used \csa{xint}\-|iOpp| which replaces
a number with its opposite.


As a last example with \csa{xintAssignArray} here is one line
extracted from the source code of the \xintgcdname macro
\csb{xintTypesetEuclideAlgorithm}:
\centeredline{|\xintAssignArray\xintEuclideAlgorithm
  {#1}{#2}\to\U|}
This is done inside a group. After this command |\U{1}| contains
the number |N| of steps of the algorithm (not to be confused with
|\U{0}=2N+4| which is the number of elements in the |\U| array),
and the GCD is to be found in |\U{3}|, a convenient location
between |\U{2}| and |\U{4}| which are (absolute values of the
expansion of) the
initial inputs. Then follow |N| quotients and remainders
from the first to the last step of the algorithm. The
\csa{xintTypesetEuclideAlgorithm} macro organizes this data
for typesetting: this is just an example of one way to do it. 

\section{Utilities for expandable manipulations}

The\MyMarginNote{Extended in |1.06|} package now has more utilities to deal
expandably with `lists of things', which were treated un-expandably in the
previous section with \csa{xintAssign} and \csa{xintAssignArray}: \csb{xintRev},
\csb{xintReverseOrder}, \csb{xintLen} and \csb{xintLength} since the first
release, \csb{xintApply} and \csb{xintListWithSep} since |1.04|,
\csb{xintRevWithBraces}, \csb{xintCSVtoList}, \csb{xintNthElt} with |1.06|, and
\csb{xintApplyUnbraced}, new with |1.06b|.

\edef\z{\xintiPow {2}{100}}

As an example the following code uses only expandable operations:
\dverb+&
|2^{100}| (=\xintiPow {2}{100}) has \xintLen{\xintiPow {2}{100}}} digits 
and the sum of their squares is  
\xintiSum{\xintApply {\xintiSqr}{\xintiPow {2}{100}}}. 
These digits are, from the least to the most significant: 
\xintListWithSep {, }{\xintRev{\xintiPow {2}{100}}}. The thirteenth most
significant digit is \xintNthElt{13}{\xintiPow {2}{100}}. The seventh 
least significant one is \xintNthElt{7}{\xintRev{\xintiPow {2}{100}}}.
+
|2^{100}| (=\z) has \xintLen{\z} digits and the sum of
their squares is \xintiSum{\xintApply\xintiSqr\z}. These digits are, from the
least to the most significant: \xintListWithSep {, }{\xintRev\z}.  The
thirteenth most 
significant digit is \xintNthElt{13}{\z}. The seventh 
least significant one is \xintNthElt{7}{\xintRev\z}. 

% The
% thirteenth most 
% significant digit is \xintNthElt{13}{\xintiPow {2}{100}}. The seventh least
% significant one is \xintNthElt{7}{\xintRev{\xintiPow {2}{100}}}.

Of course, it would be nicer to do
|\edef\z{\xintiPow {2}{100}}|, and then use |\z| in place of 
  |\xintiPow {2}{100}| everywhere as this would  spare the CPU some repetitions.

\section{Exceptions (error messages)}

In situations such as division by zero, the package will insert in the
\TeX{} processing an undefined control sequence (we copy this method
from the |bigintcalc| package). This will trigger the writing to the log
of a message signaling an undefined control sequence. The name of the
control sequence is the message. The error is raised \emph{before} the
end of the expansion so as to not disturb further processing of the
token stream, after completion of the operation. Generally the problematic
operation will output a zero. Possible such error message control
sequences: 
\dverb|&
\xintError:ArrayIndexIsNegative
\xintError:ArrayIndexBeyondLimit
\xintError:FactorialOfNegativeNumber
\xintError:FactorialOfTooBigNumber
\xintError:DivisionByZero
\xintError:NaN
\xintError:FractionRoundedToZero
\xintError:NotAnInteger
\xintError:ExponentTooBig
\xintError:TooBigDecimalShift
\xintError:TooBigDecimalSplit
\xintError:RootOfNegative
\xintError:NoBezoutForZeros
\xintError:ignored
\xintError:removed
\xintError:inserted
\xintError:use_xintthe!
\xintError:bigtroubleahead
\xintError:unknownfunction
|

\section{Common input errors when using the package macros}

\edef\x{\xintMul {3}{5}/\xintMul{7}{9}}

Here is a list of  common input errors. Some will cause compilation errors,
others are more annoying as they may pass through unsignaled.
\begin{itemize}
\item using |-| to prefix some macro: |-\xintiSqr{35}/271|.\footnote{to the
    contrary, this \emph{is} 
    allowed inside an |\string\xintexpr|-ession.}  
\item using one pair of braces too many |\xintIrr{{\xintiPow {3}{13}}/243}| (the
  computation goes through with no error signaled, but the result is completely
  wrong). 
\item using |[]| and decimal points at the same time |1.5/3.5[2]|, or with a
  sign in the denominator |3/-5[7]|. The scientific notation has no such
  restriction, the two inputs |1.5/-3.5e-2| and |-1.5e2/3.5| are equivalent:
  |\xintRaw{1.5/-3.5e-2}|\digitstt{=\xintRaw{1.5/-3.5e-2}},
  |\xintRaw{-1.5e2/3.5}|\digitstt{=\xintRaw{-1.5e2/3.5}}. 
\item specifying numerators and
  denominators with macros producing fractions when \xintfracname is loaded:
  |\edef\x{|\allowbreak|\xintMul {3}{5}/\xintMul{7}{9}}|. This expands to
  \texttt{\x} which is 
  invalid on input. Using this |\x| in a fraction macro will most certainly
  cause a compilation error, with its usual arcane and undecipherable
  accompanying message. The fix here would be to use |\xintiMul|. The simpler
  alternative with package \xintexprname:
  |\xinttheexpr 3*5/(7*9)\relax|.
\item generally speaking, using in a context expecting an integer (possibly
  restricted to the \TeX{} bound) a macro or expression which returns a
  fraction: |\xinttheexpr 4/2\relax| outputs \digitstt{\xinttheexpr 4/2\relax},
  not &2&. Use |\xintNum {\xinttheexpr 4/2\relax}|. 
\end{itemize}


\section{Package namespace}

Inner macros of \xintname, \xintfracname, \xintexprname,
\xintbinhexname, \xintgcdname, \xintseriesname, and \xintcfracname{} all
begin either with |\XINT_| or with |\xint_|.\footnote{starting with
  release |1.06b| the style files use for macro names a more modern
  underscore |\_| rather than the |@| sign. Probability of a name clash
  with \LaTeX2e packages is now even closer to nil, and with \LaTeX3
  packages it is also close to nil as our control sequences are all
  lacking the argument specifier part of \LaTeX3 function names. A few
  macros starting with |\string\XINT| do not have the underscore.} The
package public commands all start with |\xint|. The major forms have
their initials capitalized, and lowercase forms, prefixed with
|\romannumeral0|, allow definitions of further macros expanding in only
two steps to their final outputs. Some other control sequences are used
only as delimiters, and left undefined, they may have been defined
elsewhere, their meaning doesn't matter and is not touched.

\section{Loading and usage}

\dverb|&
Usage with LaTeX: \usepackage{xint}
                  \usepackage{xintfrac}   % (loads xint)
                  \usepackage{xintexpr}   % (loads xintfrac)

                  \usepackage{xintbinhex} % (loads xint)
                  \usepackage{xintgcd}    % (loads xint)
                  \usepackage{xintseries} % (loads xintfrac)
                  \usepackage{xintcfrac}  % (loads xintfrac)

Usage with TeX:   \input xint.sty\relax   
                  \input xintfrac.sty\relax   % (loads xint)
                  \input xintexpr.sty\relax   % (loads xintfrac)

                  \input xintbinhex.sty\relax % (loads xint)
                  \input xintgcd.sty\relax    % (loads xint)
                  \input xintseries.sty\relax % (loads xintfrac)
                  \input xintcfrac.sty\relax  % (loads xintfrac)
|

We have added, directly copied from packages by \textsc{Heiko
 Oberdiek}, a mecanism of re-load and \eTeX{} detection,
especially for Plain \TeX{}. As \eTeX{} is required, the
executable |tex| can not be used, |etex| or |pdftex| (version
|1.40| or later) or ..., must
be invoked.

Furthermore, \xintfracname, \xintbinhexname, and \xintgcdname check for the
previous loading of \xintname, and will try to load it if this was not
already done. Similarly \xintseriesname, \xintcfracname and \xintexprname do
the necessary loading of \xintfracname. Each package will refuse to be
loaded twice.

Also inspired from the \textsc{Heiko Oberdiek} packages we have included
a complete catcode protection mecanism. The packages may be loaded in
any catcode configuration satisfying these requirements: the percent is
of category code comment character, the backslash is of category code
escape character, digits have category code other and letters have
category code letter. Nothing else is assumed, and the previous
configuration is restored after the loading of each one of the packages.

This is for the loading of the packages. 

For the actual use of the
macros, note that when feeding them with negative numbers the
minus sign must have category code other, as is standard. Similarly the
slash used for inputting fractions must be of category other, as usual.
And the square brackets also must be of category code other, if used on
input. The `e' of the scientific notation must be of category code letter.
All of that is relaxed when inside an 
|\xintexpr|-ession (but arguments to macros which have been inserted in
the expression must obey the rules, as it is the macro and not the parser which
will get the tokens). In an |\xintexpr|-ession, the scientific `e' may be `E'.

The components of the \xintname bundle presuppose that the usual
\csa{space} and \csa{empty} macros are pre-defined, which is the case in
Plain \TeX{} as well as in \LaTeX.

Lastly, the macros \csa{xintRelaxArray} (of \xintname) and
\csa{xintTypesetEuclideAlgorithm} and
\csa{xintTypesetBezoutAlgorithm} (of \xintgcdname) use 
\csa{loop}, both Plain and \LaTeX{} incarnations are
compatible. \csa{xintTypesetBezoutAlgorithm} also uses the
\csa{endgraf} macro.
 

\section{Installation}

\dverb+&
Run tex or latex on xint.dtx.

This will extract the style files xint.sty, xintfrac.sty, xintexpr.sty,
xintbinhex.sty, xintgcd.sty, xintseries.sty, xintcfrac.sty (and xint.ins).

Files with the same names and in the same repertory will be overwritten.
The tex (not latex) run will stop with the complaint that it does not
understand \NeedsTeXFormat, but the style files will already have been
extracted by that time.

Alternatively, run tex or latex on xint.ins if available.

To get xint.pdf run pdflatex thrice on xint.dtx

           xint.sty |
       xintfrac.sty |
       xintexpr.sty | 
     xintbinhex.sty | --> TDS:tex/generic/xint/
        xintgcd.sty |
     xintseries.sty |
      xintcfrac.sty |
           xint.dtx   --> TDS:source/generic/xint/
           xint.pdf   --> TDS:doc/generic/xint/

It may be necessary to then refresh the TeX installation filename
database.
+


\section{Commands of the \xintname package}\label{sec:comxint}

\def\n{\string{N\string}}
\def\m{\string{M\string}}
\def\x{\string{x\string}}

\texttt{\n} (or also \texttt{\m}) stands for a (long) number within braces with
one optional minus sign and no leading zeros,\MyMarginNote{|1.09a| uses
  \csa{xintNum} in most macros}  or for a control sequence possibly
within braces and expanding to such a number (without the braces!), or for
material within braces which expands to such a number after repeated expansions
of the first token.

The letter \texttt{x} stands for something which will be inserted in-between a
|\numexpr| and a |\relax|. It will thus be completely expanded and must give an
integer obeying the \TeX{} bounds. Thus, it may be for example a count register,
or itself a \csa{numexpr} expression, or just a number written explicitely with
digits or something like |4*\count 255 + 17|, etc...

A count register or \csa{numexpr} expression, used as an argument to a macro
dealing with long integers, must be prefixed by |\the| or
|\number|.\MyMarginNote{Changed in |1.09a|, see below}

Some of these macros are extended by \xintfracname to accept fractions on input,
and, generally, to output a fraction. This will be mentioned and the original
integer only macro \csa{xintAbc} remains then available under the name
\csa{xintiAbc}. Even the original integer-only macros may now accept fractions
on input as long as they are integers in disguise; they still produce on output
integers without any forward slash mark nor trailing |[n]|. On the other hand
macros such as |\xintAdd| will output fractions |A/B[n]|, with |B| present even
if its value is one. To
remove this unit denominator and convert the |[n]| part into explicit zeros, one
has \csb{xintNum}. This is mandatory when the computation result is fetched into
a context where \TeX{} expects a number (assuming it does not exceed &2^31&).
See the also the \xintfracname \hyperref[sec:comfrac]{documentation} for more
information on how macros of \xintname are modified after loading \xintfracname
(or \xintexprname).


In release |1.09a|, even with \xintfracname not loaded, many macros parse
automatically their arguments via \csb{xintNum} which removes extraneous plus or
minus signs, leading zeros, and allows direct use of a count register, without
|\the|.




% \begin{framed}
%   For macros extended by \xintfracname.sty, count registers
%   used in their arguments need no |\the| prefix. See the
%   previous `\hyperlink{useofcount}{Use of count registers}' section.
% \end{framed}


% Some macros such as \csa{xintQuo} or \csa{xintNum} (which are among those made
% to accept fractions on input when \xintfracname.sty is loaded) check that the
% fraction is an integer in disguise. 


% The integer-only macros are a bit more efficient, even for simple things such as
% determining the sign of a (long) number, as there is always some overhead due to
% the parsing the fraction format on input. This overhead, when package
% \xintfracname has been loaded and has modified the \xintname routines, usually
% will not matter much, but there are contexts where obtaining\strut{} an integer
% without 
% a forward slash nor trailing |[n]| is mandatory:\IMPORTANT{}
% for example after an |\ifnum| or inside a
% |\numexpr| (for `short' integers) or when used as argument to one of the package
% macros which are stricly integer-only on input such as \csb{xintiSqrt}, or
% \csb{xintDouble} or \csb{xintDecSplit}. 



\localtableofcontents

\subsection{\csbh{xintRev}} \label{xintRev}

\csa{xintRev\n} will revert the order of the digits of the number,
keeping the optional sign. Leading zeros
resulting from the operation are not removed (see the
\csa{xintNum} macro for this). As described early, this macro and all other
macros dealing with numbers first expand `fully' their arguments. 
\centeredline{|\xintRev{-123000}|\digitstt{=\xintRev{-123000}}}
\centeredline{|\xintNum{\xintRev{-123000}}|%
               \digitstt{=\xintNum{\xintRev{-123000}}}}

\subsection{\csbh{xintReverseOrder}}\label{xintReverseOrder}

\csa{xintReverseOrder}\marg{list} does not do any
expansion of its argument and just reverses the order of the
tokens in the \meta{list}.\footnote{the argument is not a token list variable,
  just a 
  \meta{list} of tokens.} Brace pairs encountered are removed once and the
enclosed 
material does not get reverted. Spaces are gobbled.
\centeredline{|\xintReverseOrder{\xintDigitsOf\xintiPow {2}{100}\to\Stuff}|}
\centeredline{gives: 
   \ttfamily{\string\Stuff\string\to1002\string\xintiPow\string\xintDigitsOf}}

\subsection{\csbh{xintRevWithBraces}}\label{xintRevWithBraces}

{\small New in release |1.06|.\par}
\edef\X{\xintRevWithBraces{12345}}
\edef\y{\xintRevWithBraces\X}
\expandafter\def\expandafter\w\expandafter
     {\romannumeral0\xintrevwithbraces{{\A}{\B}{\C}{\D}{\E}}}


\csa{xintRevWithBraces}\marg{list} first does the expansion of its argument
(which thus may be macro), then it reverses the order of the tokens, or braced
material, it encounters, adding a pair of braces to each (thus, maintaining
brace pairs already existing). Spaces (in-between external brace pairs) are
gobbled. This macro is mainly thought out for use on a \meta{list} of such
braced 
material; with such a list as argument the expansion will only hit against the
first opening brace, hence do nothing, and the braced stuff may thus be macros
one does not want to expand. \centeredline{|\edef\x{\xintRevWithBraces{12345}}|}
\centeredline{|\meaning\x:|\ttfamily{\meaning\X}}
\centeredline{|\edef\y{\xintRevWithBraces\x}|}%
\centeredline{|\meaning\y:|\ttfamily{\meaning\y}} The examples above could be
defined with |\edef|'s because the braced material did not contain macros.
Alternatively: \centeredline{|\expandafter\def\expandafter\w\expandafter|}%
\centeredline{|{\romannumeral0\xintrevwithbraces{{\A}{\B}{\C}{\D}{\E}}}|}
\centeredline{|\meaning\w:|\ttfamily{\meaning\w}} The macro
\csa{xintReverseWithBracesNoExpand} 
does the same job without the initial expansion of its argument.

\subsection{\csbh{xintLen}}\label{xintiLen}

\csa{xintLen\n} returns the length of the number, not counting the sign.
\centeredline{|\xintLen{-12345678901234567890123456789}|\digitstt
  {=\xintLen{-12345678901234567890123456789}}} Extended by \xintfracname to
fractions: the length of |A/B[n]| is the length of |A| plus the length of |B|
plus the absolute value of |n| and minus one (an integer input as |N| is
internally |N/1[0]| so the minus one means that the extended \csa{xintLen}
behaves the same as the original for integers). The whole thing should sum up to
less than circa &2^{31}&. 

\subsection{\csbh{xintLength}}\label{xintLength}

\csa{xintLength}\marg{list} does not do any expansion of its argument and just
counts how many tokens there are (possibly none). Things enclosed in braces
count as one. \centeredline{|\xintLength {\xintiPow
    {2}{100}}|\digitstt{=\xintLength {\xintiPow{2}{100}}}}
\centeredline{${}\neq{}$|\xintLen {\xintiPow {2}{100}}|\digitstt{=\xintLen
    {\xintiPow{2}{100}}}}

\subsection{\csbh{xintCSVtoList}}\label{xintCSVtoList}

{\small New with release |1.06|.\par}

\edef\X{\xintCSVtoList {1,2,a , b   ,c  d,x,y }}
\def\y {a,b,c,d,e}
\edef\z{\xintCSVtoList \y}

\csa{xintCSVtoList}|{a,b,c...,z}| returns |{a}{b}{c}...{z}|. The argument may be
a macro. It is first expanded: this means that if the argument is |a,b,..|, then
|a|, if a macro, will be expanded which may or may not be a good thing (starting
the replacement text of the macro with |\space| stops the expansion at the first
level and gobbles
the space; prefixing a macro with |\space| stops preemptively the expansion and
gobbles the space). Chains of
contiguous spaces are collapsed by the \TeX{} scanning into single spaces.
\centeredline{|\xintCSVtoList {1,2,a , b ,c d,x,y
  }->|\makeatletter\digitstt{\expandafter\strip@prefix\meaning\X}\makeatother}
\centeredline{|\def\y{a,b,c,d,e}\xintCSVtoList\y->|%
      \makeatletter\digitstt{\expandafter\strip@prefix\meaning\z}\makeatother} 

The macro \csa{xintCSVtoListNoExpand} does the same job without the initial
expansion.

\subsection{\csbh{xintNthElt}}\label{xintNthElt}

{\small New in release |1.06|. With |1.09b| negative indices count from the tail.\par}

\def\macro #1{\the\numexpr 9-#1\relax}

\csa{xintNthElt\x}\marg{list} gets (expandably) the |x|th element of the
\meta{list}, which may be a macro: the list argument is first expanded. The seeked element is returned with
one pair of braces removed (if initially present).  \centeredline{|\xintNthElt
  {3}{{agh}\u{zzz}\v{Z}}| is \texttt{\xintNthElt
  {3}{{agh}\u{zzz}\v{Z}}}}\centeredline{|\xintNthElt
  {37}{\xintFac {100}}|\digitstt{=\xintNthElt {37}{\xintFac {100}}} is the
thirty-seventh digit of &100!&.}
\centeredline{|\xintNthElt {10}{\xintFtoCv
    {566827/208524}}|\digitstt{=\xintNthElt {10}{\xintFtoCv {566827/208524}}}}
is 
the tenth convergent of &566827/208524& (uses \xintcfracname package). 
 \centeredline{|\xintNthElt {7}{\xintCSVtoList {1,2,3,4,5,6,7,8,9}}|%
  \digitstt{=\xintNthElt {7}{\xintCSVtoList {1,2,3,4,5,6,7,8,9}}}}%
\centeredline{|\xintNthElt {0}{\xintCSVtoList {1,2,3,4,5,6,7,8,9}}|%
  \digitstt{=\xintNthElt {0}{\xintCSVtoList {1,2,3,4,5,6,7,8,9}}}}
\centeredline{|\xintNthElt {-3}{\xintCSVtoList {1,2,3,4,5,6,7,8,9}}|%
  \digitstt{=\xintNthElt {-3}{\xintCSVtoList {1,2,3,4,5,6,7,8,9}}}}
If |x=0|, the macro returns the length of the expanded list: this is
not equivalent to \csb{xintLength} which does no  pre-expansion. And it
is different from \csb{xintLen} which is to be used only on integers or
fractions. 

If |x<0|, the macro returns the \texttt{|x|}th element from the end of the list.
   \centeredline{|\xintNthElt
  {-5}{{{agh}}\u{zzz}\v{Z}}| is \texttt{\expandafter\expandafter\expandafter
 \detokenize
 \expandafter\expandafter\expandafter{\xintNthElt
  {-5}{{{agh}}\u{zzz}\v{Z}}}}}

An |x| argument larger than the length of the list makes the macro returns
nothing.

The macro
\csa{xintNthEltNoExpand} does the same job but without first expanding the 
list argument.

\subsection{\csbh{xintListWithSep}}\label{xintListWithSep}

{\small New with release |1.04|.\par}

\def\macro #1{\the\numexpr 9-#1\relax}

\csa{xintListWithSep}|{sep}|\marg{list} just inserts the given separator |sep|
in-between all elements of the given list: this separator may be a macro but
will not be expanded. The second argument also may be itself a macro: it is
expanded as usual, \emph{i.e.} fully for what comes first. Applying
\csa{xintListWithSep} removes one level of top braces to each list constituent.
An empty input gives an empty output, a singleton gives a singleton, the
separator is used starting with at least two elements. Using an empty separator
has the net effect of removing one-level of brace pairs from each ot the
top-level braced material constituting the \meta{list}.
\centeredline{|\xintListWithSep{:}{\xintFac
    {20}}|\digitstt{=\xintListWithSep{:}{\xintFac {20}}}}

The  macro \csa{xintListWithSepNoExpand} does the same
job without the initial expansion.

\subsection{\csbh{xintApply}}\label{xintApply}

{\small New with release |1.04|.\par}

\def\macro #1{\the\numexpr 9-#1\relax}

\csa{xintApply}|{\macro}|\marg{list} expandably applies the one parameter
command |\macro| to each item in the \meta{list} given as second argument and
return a new list with these outputs: each item is given one after the other as
parameter to |\macro| which is expanded (as usual, \emph{i.e.} fully for what
comes first), and the result is braced. On output, a new list with these braced
results (if |\macro| is defined to start with a space, the space will be gobbled
and the following replacement text of |\macro| will not be executed; |\macro|
may aslo be something like |\macro|\marg{fixed\_first}, then the list elements
will serve as second argument to |\macro|). 

Being expandable, |\xintApply| is useful for example inside alignments where
implicit groups make standard loops constructs fail. In such situation it is
often not wished that the new list elements be braced, see
\csb{xintApplyUnbraced}.

For faster code, there is the non-expandable \csb{xintApplyInline} which does
like \csa{xintApplyUnbraced} but executes |\macro| immediately in the expansion
flow. 

The \meta{list} may
itself be some macro expanding (in the previously described way) to the list of
tokens to which the command |\macro| will be applied. For example, if the
\meta{list} expands to some positive number, then each digit will be replaced by
the result of applying |\macro| on it. \centeredline{|\def\macro #1{\the\numexpr
    9-#1\relax}|} \centeredline{|\xintApply\macro{\xintFac
    {20}}|\digitstt{=\xintApply\macro{\xintFac {20}}}}

The macro 
\csa{xintApplyNoExpand} does the same job without the first initial expansion
which gave the \meta{list}  of braced tokens to which |\macro| is applied.

\subsection{\csbh{xintApplyUnbraced}}\label{xintApplyUnbraced}

{\small New in release |1.06b|.\par}

\def\macro #1{\expandafter\def\csname myself#1\endcsname {#1}}
\xintApplyUnbraced\macro{{elta}{eltb}{eltc}}

\csa{xintApplyUnbraced}|{\macro}|\marg{list} is like \csb{xintApply}. The
difference is that after having expanding its second argument, and then applied
|\macro| fully expanded to each token or braced thing found, it reassembles the
outputs without enclosing them in braces. The net effect is the same as doing 
\centeredline{|\xintListWithSep {}{\xintApply {\macro}|\marg{list}|}|}
This is useful for preparing a macro which will itself define some other macros
or make assignments. 
% sorry also for the silly coding of the following verbatim block
\lverb|&
$ $ $ $ \def\macro #1{\expandafter\def\csname myself#1\endcsname {#1}}$\
$null$ $ $ $ \xintApplyUnbraced\macro{{elta}{eltb}{eltc}}$\
$null$ $ $ $ \meaning\myselfelta:$ $ $meaning$myselfelta
| 
The macro \csa{xintApplyUnbracedNoExpand} does the same job without the first
initial expansion which gave the \meta{list} of braced tokens to which
|\macro| 
is applied.

\subsection{\csbh{xintApplyInline}}\label{xintApplyInline}

{\small New in release |1.09a|.\par}

\csa{xintApplyInline}|{\macro}|\marg{list} works non expandably. It immediately
applies the one-parameter |\macro| to the first element of the expanded list,
and then with each element until reaching the end. This is to be used in
situations where the code needs to do immediately some repetitive things, it can
not be used to prepare material inside some macro for later execution,
contrarily to \csb{xintApply} or \csb{xintApplyUnbraced}.


\subsection{\csbh{xintAssign}}\label{xintAssign}


\csa{xintAssign}\meta{braced things}\csa{to}%
\meta{as many cs as they are things} defines (without checking if
something gets overwritten) the control sequences on the right of
\csa{to} to be the complete expansions of the successive braced things found on
the left of \csa{to}. 

A `full' expansion is first applied first to the
material in front of \csa{xintAssign}, which may thus be a macro expanding to a
list of braced items.

\xintAssign\xintiPow {7}{13}\to\SevenToThePowerThirteen
\xintAssign\xintDivision{1000000000000}{133333333}\to\Q\R

Special case: if after this initial expansion no brace is found immediately
after \csa{xintAssign}, it is assumed that there is only one control sequence
following |\to|, and this control sequence is then defined via |\edef| as the
complete expansion of the material between \csa{xintAssign} and \csa{to}.
\centeredline{|\xintAssign\xintDivision{1000000000000}{133333333}\to\Q\R|}
\centeredline{|\meaning\Q: |\digitstt{\meaning\Q}, |\meaning\R:|
  \digitstt{\meaning\R}} \centeredline{|\xintAssign\xintiPow
  {7}{13}\to\SevenToThePowerThirteen|}
\centeredline{|\SevenToThePowerThirteen|\digitstt{=\SevenToThePowerThirteen}}
\centeredline{(same as |\edef\SevenToThePowerThirteen{\xintiPow {7}{13}}|)} This
macro uses various \csa{edef}'s, thus is incompatible with expansion-only
contexts.  

\subsection{\csbh{xintAssignArray}}\label{xintAssignArray}

{\small Changed in release |1.06| to let the defined macro pass its
  argument through a |\numexpr...\relax|.\par}

\xintAssignArray\xintBezout {1000}{113}\to\Bez

\csa{xintAssignArray}\meta{braced things}\csa{to}\csa{myArray} first expands
fully what comes immediately after |\xintAssignArray| and expects to find a list
of braced things |{A}{B}...| (or tokens). It then defines \csa{myArray} as a
macro with one parameter, such that \csa{myArray\x} expands to give the
completely expanded |x|th braced thing of this original list (the argument
\texttt{\x} itself is fed to a |\numexpr| by |\myArray|, and |\myArray| expands
in two steps to its output). With |0| as parameter, \csa{myArray}|{0}| returns
the number |M| of elements of the array so that the successive elements are
\csa{myArray}|{1}|, \dots, \csa{myArray}|{M}|.
\centeredline{|\xintAssignArray\xintBezout {1000}{113}\to\Bez|} will set
|\Bez{0}| to \digitstt{\Bez0}, |\Bez{1}| to \digitstt{\Bez1}, |\Bez{2}| to
\digitstt{\Bez2}, |\Bez{3}| to \digitstt{\Bez3}, |\Bez{4}| to \digitstt{\Bez4},
and |\Bez{5}| to \digitstt{\Bez5}:
\digitstt{(\Bez3)${}\times{}$\Bez1${}-{}$(\Bez4)${}\times{}$\Bez2${}={}$\Bez5.}
This macro is incompatible with expansion-only contexts.

\subsection{\csbh{xintRelaxArray}}\label{xintRelaxArray}

\csa{xintRelaxArray}\csa{myArray} sets to \csa{relax} all 
macros which were defined by the previous \csa{xintAssignArray}
with \csa{myArray} as array name. 

\subsection{\csbh{xintDigitsOf}}\label{xintDigitsOf}

This is a synonym for \csa{xintAssignArray}, to be used to define
an array giving all the digits of a given number.
\begingroup\xintDigitsOf\xintiPow {7}{500}\to\digits
\centeredline{|\xintDigitsOf\xintiPow {7}{500}\to\digits|}
\noindent &7^500& has |\digits{0}=|\digits{0} digits, and the 123rd among them
(starting from the most significant) is
|\digits{123}=|\digits{123}.
\endgroup 

\subsection{\csbh{xintNum}}\label{xintiNum}

\csa{xintNum\n} removes chains of plus or minus signs, followed by zeros.
\centeredline{|\xintNum{+---++----+--000000000367941789479}|\digitstt
  {=\xintNum{+---++----+--000000000367941789479}}} Extended by \xintfracname to
accept also a fraction on input, as long as it reduces to an integer after
division of the numerator by the denominator.
\centeredline{|\xintNum{123.48/-0.03}|\digitstt{=\xintNum{123.48/-0.03}}}


\subsection{\csbh{xintSgn}}\label{xintiSgn}

\csa{xintSgn\n} returns 1 if the number is positive, 0 if it is
zero and -1 if it is negative. Extended by \xintfracname to fractions.

\subsection{\csbh{xintSgnFork}}\label{xintSgnFork}
{\small New with release |1.07|.\par}

\csa{xintSgnFork}\verb+{-1|0|1}+\marg{A}\marg{B}\marg{C} expandably
chooses to execute either the \meta{A}, \meta{B} or \meta{C} code,
depending on its first argument. This first argument should be anything
expanding to either |-1|, |0| or |1| (a count register should be
prefixed by |\the| and a |\numexpr...\relax| also should be prefixed by
|\the|). This utility is provided to help construct expandable macros
choosing depending on a condition which one of the package macros to
use, or which values to confer to their arguments. 
% \dverb(&
% \def\myfunction #1% 
% % expands to |x+1| if x < -1, x-1 if x > 1, else 1 - x^2
% % rounded to two decimal places
%    {\xintRound {2}{\xintSgnFork 
%        {\xintSgnFork{\xintGeq{#1}{1}}{}{0}{\xintSgn{#1}}}
%        {\xintSub{-1}{#1}}{\xintSub{1}{\xintSqr{#1}}}{\xintSub{#1}{1}}}}%
% \xintListWithSep{,\,}{\xintApply\myfunction
%                  {{-5/2}{-2}{-3/2}{-1}{-1/2}{0}{1/2}{1}{3/2}{2}{5/2}}}
% (

% \def\myfunction #1%
%    {\xintRound {2}{\xintSgnFork 
%        {\xintSgnFork{\xintGeq{#1}{1}}{}{0}{\xintSgn{#1}}}
%        {\xintSub{-1}{#1}}{\xintSub{1}{\xintSqr{#1}}}{\xintSub{#1}{1}}}}%
% \digitstt{\xintListWithSep{,\,}{\xintApply\myfunction
%                  {{-5/2}{-2}{-3/2}{-1}{-1/2}{0}{1/2}{1}{3/2}{2}{5/2}}}}

% Using an \xintexprname-ession, one may simplify the coding:
% \dverb*&
% \def\myfunction #1% expands to |x+1| if x < -1, x-1 if x > 1, else 1 - x^2
%    {\xintRound {2}{\xinttheexpr\xintSgnFork 
%        {\xintSgnFork{\xintGeq{#1}{1}}{}{0}{\xintSgn{#1}}}
%        { -#1 - 1 }{ 1 - (#1)^2 }{ #1 - 1 } \relax }}%
% *

% \def\myfunction #1% expands to |x+1| if x < -1, x-1 if x > 1, else 1 - x^2
%    {\xintRound {2}{\xinttheexpr\xintSgnFork 
%        {\xintSgnFork{\xintGeq{#1}{1}}{}{0}{\xintSgn{#1}}}
%        { -#1 - 1 }{ 1 - (#1)^2 }{ #1 - 1 } \relax }}%

% \digitstt{\xintListWithSep{,\,}{\xintApply\myfunction
%                  {{-5/2}{-2}{-3/2}{-1}{-1/2}{0}{1/2}{1}{3/2}{2}{5/2}}}}

% Notice the use of parentheses, with |#1=-1|, |1-#1^2| would give |1--1^2| which
% evaluates to |2|. Or with |#1=3/2|, |1-#1^2| gives |1-3/2^2| which evaluates
% inside an \xintexprname-ession to |1-3/4=1/4| not |1-9/4=-5/4|.

\subsection{\csbh{xintifSgn}}\label{xintifSgn}
{\small New with release |1.09a|.\par}

Same as \csa{xintSgnFork} except that the first argument may be any integer (or
fraction with \xintfracname loaded), it
is its sign whih decides the three way branching.

\subsection{\csbh{xintifZero}}\label{xintifZero}
{\small New with release |1.09a|.\par}

\subsection{\csbh{xintifNotZero}}\label{xintifNotZero}
{\small New with release |1.09a|.\par}

\subsection{\csbh{xintifEq}}\label{xintifEq}
{\small New with release |1.09a|.\par}

\subsection{\csbh{xintifGt}}\label{xintifGt}
{\small New with release |1.09a|.\par}

\subsection{\csbh{xintifLt}}\label{xintifLt}
{\small New with release |1.09a|.\par}



\subsection{\csbh{xintOpp}}\label{xintiOpp}

\csa{xintOpp\n} returns the opposite |-N| of the number |N|.
Extended by \xintfracname to fractions.


\subsection{\csbh{xintAbs}}\label{xintiAbs}

\csa{xintAbs\n} returns the absolute value of the number. Extended
by \xintfracname to fractions. 

\subsection{\csbh{xintAdd}}\label{xintiAdd}

\csa{xintAdd\n\m} returns the sum of the two numbers. Extended by
\xintfracname to fractions.

\subsection{\csbh{xintSub}}\label{xintiSub}

\csa{xintSub\n\m} returns the difference |N-M|. Extended by
\xintfracname to fractions.

\subsection{\csbh{xintCmp}}\label{xintiCmp}

\csa{xintCmp\n\m} returns 1 if |N>M|, 0 if |N=M|, and -1 if |N<M|.
Extended by \xintfracname to fractions.

\subsection{\csbh{xintEq}}\label{xintEq}
{\small New with release |1.09a|.\par}

\subsection{\csbh{xintGt}}\label{xintGt}
{\small New with release |1.09a|.\par}

\subsection{\csbh{xintLt}}\label{xintLt}
{\small New with release |1.09a|.\par}

\subsection{\csbh{xintIsZero}}\label{xintIsZero}
{\small New with release |1.09a|.\par}

\subsection{\csbh{xintIsNotZero}}\label{xintIsNotZero}
{\small New with release |1.09a|.\par}

\subsection{\csbh{xintIsOne}}\label{xintIsOne}
{\small New with release |1.09a|.\par}

\subsection{\csbh{xintAND}}\label{xintAND}
{\small New with release |1.09a|.\par}

\subsection{\csbh{xintOR}}\label{xintOR}
{\small New with release |1.09a|.\par}

\subsection{\csbh{xintXOR}}\label{xintXOR}
{\small New with release |1.09a|.\par}

\subsection{\csbh{xintANDof}}\label{xintANDof}
{\small New with release |1.09a|.\par}

\subsection{\csbh{xintORof}}\label{xintORof}
{\small New with release |1.09a|.\par}

\subsection{\csbh{xintXORof}}\label{xintXORof}
{\small New with release |1.09a|.\par}



\subsection{\csbh{xintGeq}}\label{xintiGeq}

\csa{xintGeq\n\m} returns 1 if the \emph{absolute value} of the first number is
at least equal to the absolute value of the second number. If \verb+|N|<|M|+ it
returns 0. Extended by \xintfracname to fractions (starting with release
|1.07|). Please note that the macro compares \emph{absolute values}.

\subsection{\csbh{xintMax}}\label{xintiMax}

\csa{xintMax\n\m} returns the largest of the two in the sense of the order
structure on the relative integers (\emph{i.e.} the right-most number if they
are put on a line with positive numbers on the right): |\xintiMax
{-5}{-6}|\digitstt{=\xintiMax{-5}{-6}}. Extended by \xintfracname to fractions.

\subsection{\csbh{xintMaxof}}\label{xintMaxof}
{\small New with release |1.09a|.\par}

\subsection{\csbh{xintMin}}\label{xintiMin}

\csa{xintMin\n\m} returns the smallest of the two in the sense of the order
structure on the relative integers (\emph{i.e.} the left-most number if they are
put on a line with positive numbers on the right): |\xintiMin
{-5}{-6}|\digitstt{=\xintiMin{-5}{-6}}. Extended by \xintfracname to fractions.

\subsection{\csbh{xintMinof}}\label{xintMinof}
{\small New with release |1.09a|.\par}

\subsection{\csbh{xintSum}}\label{xintiSum}

\csa{xintSum}\marg{braced things} after expanding its argument
expects to find a sequence of tokens (or braced material).
Each is expanded (with the usual meaning), and the sum of all these numbers is
returned. 
\centeredline{%
  \csa{xintiSum}|{{123}{-98763450}{\xintFac{7}}{\xintiMul{3347}{591}}}|%
    \digitstt{=\xintiSum{{123}{-98763450}{\xintFac{7}}{\xintiMul{3347}{591}}}}}
\centeredline{\csa{xintiSum}|{1234567890}|\digitstt{=\xintiSum{1234567890}}}
An empty sum is no error and returns zero: |\xintiSum
{}|\digitstt{=\xintiSum {}}. A sum with only one
term returns that number: |\xintiSum {{-1234}}|\digitstt{=\xintiSum
  {{-1234}}}. Attention that |\xintiSum {-1234}| is not legal input
and will make the \TeX{} run fail. On the other hand  |\xintiSum
{1234}|\digitstt{=\xintiSum{1234}}. Extended by \xintfracname
to fractions.

\subsection{\csbh{xintSumExpr}}\label{xintiSumExpr}

\csa{xintSumExpr}\meta{braced things}\csa{relax} is to what \csa{xintSum}
expands. The argument is then expanded (with the usual meaning) and should give
a list of braced quantities or macros, each one will be expanded in turn.
\centeredline{%
  \csa{xintiSumExpr}| {123}{-98763450}|%
  |{\xintFac{7}}{\xintiMul{3347}{591}}\relax|\digitstt{=%
    \xintiSumExpr {123}{-98763450}{\xintFac{7}}{\xintiMul{3347}{591}}\relax}}

Note: I am not so happy with the name which seems to suggest that the
|+| sign should be used instead of braces. Perhaps this will change
in the future.

Extended by \xintfracname to fractions.

\subsection{\csbh{xintMul}}\label{xintiMul}
{\small Modified in release |1.03|.\par}

\csa{xintMul\n\m} returns the product of the two numbers. Starting
with release |1.03| of \xintname, the macro checks the lengths of
the two numbers and then activates its algorithm with the best (or
at least, hoped-so) choice of which one to put first. This makes
the macro a bit slower for numbers up to 50 digits, but may give
substantial speed gain when one of the number has 100 digits or more.
Extended by \xintfracname to fractions.

\subsection{\csbh{xintSqr}}\label{xintiSqr}

\csa{xintSqr\n} returns the square. Extended by \xintfracname to fractions.

\subsection{\csbh{xintPrd}}\label{xintiPrd}

\csa{xintPrd}\marg{braced things} after expanding its argument expects to find a
sequence of tokens (or braced material). Each is expanded (with the usual
meaning), and the product of all these numbers is returned. 
\centeredline{%
  \csa{xintiPrd}|{{-9876}{\xintFac{7}}{\xintiMul{3347}{591}}}|%
  \digitstt{=%
    \xintiPrd{{-9876}{\xintFac{7}}{\xintiMul{3347}{591}}}}}
\centeredline{\csa{xintiPrd}|{123456789123456789}|\digitstt{=%
    \xintiPrd{123456789123456789}}} An empty product is no error and returns 1:
|\xintiPrd {}|\digitstt{=\xintiPrd {}}. A product reduced to a single term returns
this number: |\xintiPrd {{-1234}}|\digitstt{=\xintiPrd {{-1234}}}. Attention that
|\xintiPrd {-1234}| is not legal input and will make the \TeX{} compilation
fail. On the other hand |\xintiPrd {1234}|\digitstt{=\xintiPrd {1234}}.
\centeredline{$\displaystyle 2^{200}3^{100}7^{100}$} \centeredline{|=\xintiPrd
  {{\xintiPow {2}{200}}{\xintiPow {3}{100}}{\xintiPow {7}{100}}}|}
% \digitstt{=\expandafter\expandafter\expandafter\allowsplits \xintiPrd
%   {{\xintiPow {2}{200}}{\xintiPow {3}{100}}{\xintiPow {7}{100}}}\relax }
\digitstt{=\printnumber{\xintNum {\xinttheexpr 2^200*3^100*7^100\relax }}}
%\centeredline{|=\xintiPow {\xintiMul {\xintiPow {42}{9}}{43008}}{10}|} 

Extended by \xintfracname to fractions.

With \xintexprname, the above would be coded simply as \centeredline{|\xintNum
  {\xinttheexpr 2^200*3^100*7^100\relax }|} (\csa{xintNum} to print an integer, not a fraction).

% \printnumber{%
%    \xintPow {\xintMul {\xintPow {42}{9}}{43008}}{10}}

\subsection{\csbh{xintPrdExpr}}\label{xintiPrdExpr}

{\small Name change in |1.06a|! I apologize, but I suddenly decided that
  \csa{xintProductExpr} was a bad choice; so I just replaced it by the current
  name. \par}

\csa{xintPrdExpr}\marg{argument}\csa{relax} is to what \csa{xintPrd} expands
; its argument is expanded (with the usual meaning) and should give a list of
braced numbers or macros. Each will be expanded when it is its turn.
\centeredline{\csa{xintiPrdExpr}| 123456789123456789\relax|\digitstt{=%
    \xintiPrdExpr 123456789123456789\relax}}

Note: I am not so happy with the name which seems to suggest that the
|*| sign should be used instead of braces. Perhaps this will change
in the future.

Extended by \xintfracname to fractions.

\subsection{\csbh{xintPow}}\label{xintiPow}

\csa{xintPow\n\x} returns |N^x|. When |x| is zero, this is 1. If |N| is zero and
|x<0|, if \verb+|N|>1+ and |x<0| negative, or if \verb+|N|>1+ and |x>999999999|,
then an error is raised. |2^999999999| has \np{301029996} digits; each exact
multiplication of two one thousand digits numbers already takes a few seconds,
so needless to say this bound is completely irrealistic. Already |2^9999| has
\np{3010} digits,\footnote{on my laptop |\string\xintiPow \{2\}\{9999\}|
  obtains all |3010| digits in about ten or eleven seconds. In contrast, the
  float versions for 
  |8|, |16|, |24|, or even more significant figures, do their jobs in circa one
  hundredth of a second (|1.08b|). This is done without |log|/|exp| which are
  not (yet?) implemented in \xintfracname. The \LaTeX3
  \href{http://www.ctan.org/tex-archive/macros/latex/contrib/l3kernel}{l3fp}
  does this with |log|/|exp| and is ten times faster (|16| figures only).} so I
should perhaps lower the bound to |99999|.

Extended by \xintfracname to fractions (\csb{xintPow}) and also to floats
(\csb{xintFloatPow}). Of course, negative
exponents do not then cause errors anymore. The float version is able to deal
with things such as  
|2^999999999| without any problem. For example
|\xintFloatPow[4]{2}{9999}|\digitstt{=\xintFloatPow[4]{2}{9999}} and 
|\xintFloatPow[4]{2}{999999999}|
\digitstt{=\xintFloatPow[4]{2}{999999999}}.

\begin{framed}
  The macros described next are all integer-only on input. With \xintfracname
  loaded their argument is filtered through \csb{xintNum} and may thus be
  a fraction, as long as it is an integer in disguise.
\end{framed}

\subsection{\csbh{xintFac}}\label{xintiFac}

\csa{xintFac\x} returns the factorial. It is an error if the
argument is negative or at least &10^6&. It is not recommended to
launch the computation of things such as &100000!&, if you need
your computer for other tasks. Note that the argument is of the |x| type, it
must obey the \TeX{} bounds, but on the other hand may involve count registers
and even arithmetic operations as it will be completely expanded inside a
|\numexpr|.

With \xintfracname loaded, the macro also\MyMarginNote{Modified in |1.08b|}
accepts a fraction as argument, as long as this fraction turns out to be an
integer: |\xintFac {66/3}|\digitstt{=\xintFac {66/3}}.

% the construct |\xintFac{\xintAdd {2}{3}}| will fail,
% use either |\xintFac{\xintiAdd {2}{3}}| or |\xintFac{\xintNum{\xintAdd
%     {2}{3}}}|.

% temps obsolètes, mettre à jour
% On my laptop &1000!& (2568 digits)
% is computed in a little less than ten seconds, &2000!& (5736
% digits) is computed in a little less than one hundred seconds, and
% &3000!& (which has 9131 digits) needs close to seven minutes\dots
% I have no idea how much time &10000!& would need (do rather
% &9999!& if you can, the algorithm has some overhead at the
% transition from &N=9999& to &10000& and higher; &10000!& has 35660
% digits). Not to mention &100000!& which, from the Stirling formula,
% should have 456574 digits.

\subsection{\csbh{xintDivision}}\label{xintDivision}

\csa{xintDivision\n\m} returns |{quotient Q}{remainder R}|. This
is euclidean division: |N = QM + R|, |0|${}\leq{}$\verb+R < |M|+. So the
remainder is always non-negative and the formula |N = QM + R|
always holds independently of the signs of |N| or |M|. Division by
zero is of course an error (even if |N| vanishes) and returns |{0}{0}|.

This macro is integer only (with \xintfracname loaded it accepts
fractions on input, but they must be integers in disguise) and not to be
confused with the \xintfracname macro \csb{xintDiv} which divides one
fraction by another.

\subsection{\csbh{xintQuo}}\label{xintQuo}

\csa{xintQuo\n\m} returns the quotient from the euclidean division. When
both |N| and |M| are positive one has \csa{xintQuo\n\m}|=\xintiTrunc
{0}{N/M}| (using package \xintfracname). With \xintfracname loaded it
accepts fractions on input, but they must be integers in disguise.

\subsection{\csbh{xintRem}}\label{xintRem}

\csa{xintRem\n\m} returns the remainder from the euclidean division.
With \xintfracname loaded it accepts fractions on input, but they must
be integers in disguise.



\subsection{\csbh{xintFDg}}\label{xintFDg}

\csa{xintFDg\n} returns the first digit (most significant) of the
decimal expansion.

\subsection{\csbh{xintLDg}}\label{xintLDg}

\csa{xintLDg\n} returns the least significant digit. When the
number is positive, this is the same as the remainder in the
euclidean division by ten.

\subsection{\csbh{xintMON}, \csbh{xintMMON}}\label{xintiMON}%
\label{xintiMMON}\label{xintMON}\label{xintMMON}
{\small New in version |1.03|.\par}

\csa{xintMON\n} returns |(-1)^N| and \csa{xintMMON\n} returns
|(-1)^{N-1}|. \centeredline{|\xintMON {-280914019374101929}|\digitstt{=\xintMON
  {280914019374101929}}, |\xintMMON
{-280914019374101929}|\digitstt{=\xintMMON {280914019374101929}}}

\subsection{\csbh{xintOdd}}\label{xintOdd}

\csa{xintOdd\n} is 1 if the number is odd and 0 otherwise. 


\subsection{\csbh{xintiSqrt}, \csbh{xintiSquareRoot}}\label{xintiSqrt}
\label{xintiSquareRoot}
{\small New with |1.08|.\par}
\xintAssign\xintiSquareRoot {17000000000000000000000000}\to\A\B

\noindent\csa{xintiSqrt\n} returns the largest integer whose square is
at most equal to |N|. 
\centeredline{|\xintiSqrt {2000000000000000000000000000000000000}=|%
\digitstt{\xintiSqrt{2000000000000000000000000000000000000}}}
\centeredline{|\xintiSqrt {3000000000000000000000000000000000000}=|%
\digitstt{\xintiSqrt{3000000000000000000000000000000000000}}}
\centeredline{|\xintiSqrt {\xintDSH {-120}{2}}=|}%
\centeredline{\digitstt{\xintiSqrt {\xintDSH {-120}{2}}}}
\csa{xintiSquareRoot\n} returns |{M}{d}| with |d>0|, |M^2-d=N| and |M|
smallest (hence |=1+|\csa{xint\-iSqrt}|{N}|). 
\centeredline{|\xintAssign\xintiSquareRoot
  {17000000000000000000000000}\to\A\B|}% 
\centeredline{|\xintiSub{\xintiSqr\A}\B=\A^2-\B|}%
\centeredline{\digitstt{\xintiSub{\xintiSqr\A}\B=\A\string^2-\B}}
A rational approximation to
$\sqrt{|N|}$ is $|M|-\frac{|d|}{|2M|}$ (this is a majorant and the error is at
most |1/2M|; if |N| is a perfect square |k^2| then |M=k+1| and this gives
|k+1/(2k+2)|, not |k|). 

Package \xintfracname has \csb{xintFloatSqrt} for square
roots of floating point numbers. 

\begin{framed}
  The macros described next are strictly for integer-only arguments. If
  \xintfracname is loaded, use \csb{xintNum} to convert integers arising as
  results of computations into the strict format as required by these
  macros.
\end{framed}

\subsection{\csbh{xintInc}, \csbh{xintDec}}
\label{xintInc}
\label{xintDec}
{\small New with |1.08|.\par}

\csa{xintInc\n} is |N+1| and \csa{xintDec\n} is |N-1|. These macros remain
integer-only, even with \xintfracname loaded.

\subsection{\csbh{xintDouble}, \csbh{xintHalf}}
\label{xintDouble}
\label{xintHalf}
{\small New with |1.08|.\par}

\csa{xintDouble\n} returns |2N| and \csa{xintHalf\n} is |N/2| rounded
towards zero. These macros remain integer-only, even with \xintfracname loaded.

\subsection{\csbh{xintDSL}}\label{xintDSL}

\csa{xintDSL\n} is decimal shift left, \emph{i.e.} multiplication
by ten.

\subsection{\csbh{xintDSR}}\label{xintDSR}

\csa{xintDSR\n} is decimal shift right, \emph{i.e.} it removes the last digit
(keeping the sign), equivalently it is the closest integer to |N/10| when
starting at zero.

\subsection{\csbh{xintDSH}}\label{xintDSH}

\csa{xintDSH\x\n} is parametrized decimal shift. When |x| is
negative, it is like iterating \csa{xintDSL} \verb+|x|+ times
(\emph{i.e.} multiplication by &10^{-&|x|&}&). When |x| positive,
it is like iterating \csa{DSR} |x| times (and is more efficient of
course), and for a non-negative |N| this is thus the same as the
quotient from the euclidean division by |10^x|. 

\subsection{\csbh{xintDSHr}, \csbh{xintDSx}}\label{xintDSHr}\label{xintDSx}
{\small New in release |1.01|.\par}

\csa{xintDSHr\x\n} expects |x| to be zero or positive and it returns
then a value |R| which is correlated to the value |Q| returned by
\csa{xintDSH\x\n} in the following manner:
\begin{itemize}
\item if |N| is
  positive or zero, |Q| and |R| are the quotient and remainder in
  the euclidean division by |10^x| (obtained in a more efficient
  manner than using \csa{xintDivision}),
\item if |N| is negative let
  |Q1| and |R1| be the quotient and remainder in the euclidean
  division by |10^x| of the absolute value of |N|. If |Q1|
  does not vanish, then |Q=-Q1| and |R=R1|. If |Q1| vanishes, then
  |Q=0| and |R=-R1|.
\item for |x=0|, |Q=N| and |R=0|.
\end{itemize}
So one has |N = 10^x Q + R| if |Q| turns out to be zero or
positive, and |N = 10^x Q - R| if |Q| turns out to be negative,
which is exactly the case when |N| is at most |-10^x|.


\csa{xintDSx\x\n} for |x| negative is exactly as
\csa{xintDSH\x\n}, \emph{i.e.} multiplication by &10^{-&|x|&}&.
For |x| zero or positive it returns the two numbers |{Q}{R}|
described above, each one within braces. So |Q| is
\csa{xintDSH\x\n}, and |R| is \csa{xintDSHr\x\n}, but computed
simultaneously.

\begin{flushleft}
  \xintAssign\xintDSx {-1}{-123456789}\to\M 
  \noindent{|\xintAssign\xintDSx {-1}{-123456789}\to\M|}\\
  |\meaning\M: |\digitstt{\meaning\M}.\\
  \xintAssign\xintDSx {-20}{1234567689}\to\M 
  {|\xintAssign\xintDSx {-20}{123456789}\to\M|}\\ 
  |\meaning\M: |\digitstt{\meaning\M}.\\
  \xintAssign\xintDSx{0}{-123004321}\to\Q\R 
  {|\xintAssign\xintDSx {0}{-123004321}\to\Q\R|}\\
  \noindent|\meaning\Q: |\digitstt{\meaning\Q}, |\meaning\R:
  |\digitstt{\meaning\R.}\\
  |\xintDSH {0}{-123004321}|\digitstt{=\xintDSH {0}{-123004321}},
  |\xintDSHr {0}{-123004321}|\digitstt{=\xintDSHr {0}{-123004321}}\\
  \xintAssign\xintDSx {6}{-123004321}\to\Q\R 
  {|\xintAssign\xintDSx {6}{-123004321}\to\Q\R|}\\ 
  |\meaning\Q: |\digitstt{\meaning\Q},
  |\meaning\R: |\digitstt{\meaning\R.}\\
  |\xintDSH {6}{-123004321}|\digitstt{=\xintDSH {6}{-123004321}},
  |\xintDSHr {6}{-123004321}|\digitstt{=\xintDSHr {6}{-123004321}}\\
  \xintAssign\xintDSx {8}{-123004321}\to\Q\R 
  {|\xintAssign\xintDSx {8}{-123004321}\to\Q\R|}\\ 
  |\meaning\Q: |\digitstt{\meaning\Q},
  |\meaning\R: |\digitstt{\meaning\R.} \\
  |\xintDSH {8}{-123004321}|\digitstt{=\xintDSH {8}{-123004321}},
  |\xintDSHr {8}{-123004321}|\digitstt{=\xintDSHr {8}{-123004321}}\\
  \xintAssign\xintDSx {9}{-123004321}\to\Q\R 
  {|\xintAssign\xintDSx {9}{-123004321}\to\Q\R|}\\ 
  |\meaning\Q: |\digitstt{\meaning\Q},
  |\meaning\R: |\digitstt{\meaning\R.}\\
  |\xintDSH {9}{-123004321}|\digitstt{=\xintDSH {9}{-123004321}},
  |\xintDSHr {9}{-123004321}|\digitstt{=\xintDSHr {9}{-123004321}}\\
\end{flushleft}

\subsection{\csbh{xintDecSplit}}\label{xintDecSplit}

{\small This has been modified in release |1.01|.\par}

\csa{xintDecSplit\x\n} cuts the number into two pieces (each one within a
pair of enclosing braces). First the sign if present is \emph{removed}.
Then, for |x| positive or null, the second piece contains the |x| least
significant digits (\emph{empty} if |x=0|) and the first piece the remaining
digits (\emph{empty} when |x| equals or exceeds the length of |N|).
Leading zeros in the second piece are not removed. When |x| is negative
the first piece contains the \verb+|x|+ most significant digits and the
second piece the remaining digits (\emph{empty} if &|x|& equals or exceeds
the length of |N|). Leading zeros in this second piece are not removed.
So the absolute value of the original number is always the concatenation
of the first and second piece.

{\footnotesize This macro's behavior for |N| non-negative is final and will not
  change. I am still hesitant about what to do with the sign of a
  negative |N|.\par}


\xintAssign\xintDecSplit {0}{-123004321}\to\L\R
\centeredline{|\xintAssign\xintDecSplit {0}{-123004321}\to\L\R|}
\noindent|\meaning\L: |\digitstt{\meaning\L}, |\meaning\R: |\digitstt{\meaning\R.}
\xintAssign\xintDecSplit {5}{-123004321}\to\L\R
\centeredline{|\xintAssign\xintDecSplit {5}{-123004321}\to\L\R|}
|\meaning\L: |\digitstt{\meaning\L}, |\meaning\R: |\digitstt{\meaning\R.}
\xintAssign\xintDecSplit {9}{-123004321}\to\L\R
\centeredline{|\xintAssign\xintDecSplit {9}{-123004321}\to\L\R|}
|\meaning\L: |\digitstt{\meaning\L}, |\meaning\R: |\digitstt{\meaning\R.}
\xintAssign\xintDecSplit {10}{-123004321}\to\L\R
\centeredline{|\xintAssign\xintDecSplit {10}{-123004321}\to\L\R|}
|\meaning\L: |\digitstt{\meaning\L}, |\meaning\R: |\digitstt{\meaning\R.}
\xintAssign\xintDecSplit {-5}{-12300004321}\to\L\R
\centeredline{|\xintAssign\xintDecSplit {-5}{-12300004321}\to\L\R|}
|\meaning\L: |\digitstt{\meaning\L}, |\meaning\R: |\digitstt{\meaning\R.}
\xintAssign\xintDecSplit {-11}{-12300004321}\to\L\R
\centeredline{|\xintAssign\xintDecSplit {-11}{-12300004321}\to\L\R|}
|\meaning\L: |\digitstt{\meaning\L}, |\meaning\R: |\digitstt{\meaning\R.}
\xintAssign\xintDecSplit {-15}{-12300004321}\to\L\R
\centeredline{|\xintAssign\xintDecSplit {-15}{-12300004321}\to\L\R|}
|\meaning\L: |\digitstt{\meaning\L}, |\meaning\R: |\digitstt{\meaning\R.}

\subsection{\csbh{xintDecSplitL}}\label{xintDecSplitL}

\csa{xintDecSplitL\x\n} returns the first piece after the action
of \csa{xintDecSplit}.

\subsection{\csbh{xintDecSplitR}}\label{xintDecSplitR}

\csa{xintDecSplitR\x\n} returns the second piece after the action
of \csa{xintDecSplit}.



\section{Commands of the \xintfracname package}\label{sec:comfrac}

\def\x{\string{x\string}}

This package was first included in release |1.03| of the \xintname bundle. The
general rule of the bundle that each macro first expands (what comes first,
fully) each one of its arguments applies. 


|f| stands for an integer or a fraction (see \autoref{sec:inputs} for the
accepted input formats) or something which expands to an integer or fraction. It
is possible to use in the numerator or the denominator of |f| count
registers and even expressions with
infix arithmetic operators, under some rules which are explained in the previous
\hyperlink{useofcount}{Use of count registers} section.

As in the \hyperref[sec:comxint]{xint.sty} documentation, |x|
stands for something which will internally be embedded in a \csa{numexpr}.
It 
may thus be a count register or something like |4*\count 255 + 17|, etc..., but
must expand to an integer obeying the \TeX{} bound.

The fraction format on output is the scientific notation for the `float' macros,
and the |A/B[n]| format for all other fraction macros, with the exception of
\csb{xintTrunc}, {\color{blue}\string\xint\-Round} (which produce decimal
numbers) and \csb{xintIrr}, \csb{xintJrr}, \csb{xintRawWithZeros} (which returns
an |A/B| with no trailing |[n]|, and prints the |B| even if it is |1|),
\csb{xintPRaw} which does not print the |[n]| if |n=0| or the |B| if |B=1|. Use
\csb{xintNum} (or |\xintPRaw| if simplification is not needed) for fractions a
priori known to simplify to integers: |\xintNum {\xintAdd {2}{3}}| gives
\digitstt{\xintNum {\xintAdd {2}{3}}} whereas |\xintAdd {2}{3}| returns
\digitstt{\xintAdd {2}{3}}. Some macros (among them \csb{xintiTrunc},
\csb{xintiRound}, and \csb{xintFac}) already produce integers on output.


\localtableofcontents

\subsection{\csbh{xintLen}}\label{xintLen}

The original macro is extended to accept a fraction on input.
\centeredline {|\xintLen {201710/298219}|\digitstt{=\xintLen {201710/298219}},
|\xintLen {1234/1}|\digitstt{=\xintLen {1234/1}}, |\xintLen {1234}|%
                    \digitstt{=\xintLen {1234}}}


\subsection{\csbh{xintRaw}}\label{xintRaw}
{\small New with release |1.04|.\par}
{\small \color{red}MODIFIED IN |1.07|.\par}

This macro `prints' the 
fraction |f| as it is received by the package after its parsing and
expansion, in a form |A/B[n]| equivalent to the internal
representation: the denominator |B| is always strictly positive and is
printed even if it has value |1|. 
\centeredline{|\xintRaw{\the\numexpr 571*987\relax.123e-10/\the\numexpr
    -201+59\relax e-7}=|}%
\centeredline{\digitstt{\xintRaw{\the\numexpr
      571*987\relax.123e-10/\the\numexpr -201+59\relax e-7}}}

\subsection{\csbh{xintPRaw}}\label{xintPRaw}
{\small New in |1.09b|.\par}

|PRaw| stands for ``pretty raw''. It does \emph{not} show the |[n]| if |n=0| and
does \emph{not} show the |B| if |B=1|. \centeredline{|\xintPRaw
  {123e10/321e10}=|\digitstt{\xintPRaw {123e10/321e10}}, |\xintPRaw
  {123e9/321e10}=|\digitstt{\xintPRaw {123e9/321e10}}}
\centeredline{|\xintPRaw
  {\xintIrr{861/123}}=|\digitstt{\xintPRaw{\xintIrr{861/123}}} \ vz.\ 
|\xintIrr{861/123}=|\digitstt{\xintIrr{861/123}}} See also
\csb{xintFrac} (or \csb{xintFwOver}) for math mode. As is examplified above the
\csb{xintIrr} macro which puts the fraction into irreducible form does not
remove the |/1| if the fraction is an integer. One can use \csb{xintNum} for
that, but there will be an error message if the fraction was not an integer; so
the combination |\xintPRaw{\xintIrr{f}}| is the way to go.

\subsection{\csbh{xintNumerator}}\label{xintNumerator}

This returns the numerator corresponding to the internal representation of a
fraction, with positive powers of ten converted into zeros of this numerator:
\centeredline{|\xintNumerator
  {178000/25600000[17]}|\digitstt{=\xintNumerator {178000/25600000[17]}}}
\centeredline{|\xintNumerator {312.289001/20198.27}|%
      \digitstt{=\xintNumerator {312.289001/20198.27}}}
\centeredline{|\xintNumerator {178000e-3/256e5}|\digitstt{=\xintNumerator
    {178000e-3/256e5}}} 
\centeredline{|\xintNumerator {178.000/25600000}|\digitstt{=\xintNumerator
    {178.000/25600000}}} As shown by the examples, no simplification of the
input is done. For a result uniquely associated to the value of the fraction
first apply \csa{xintIrr}.

\subsection{\csbh{xintDenominator}}\label{xintDenominator}

This returns the denominator corresponding to the internal representation of the
fraction:\footnote{recall that the |[]| construct excludes presence of a decimal
  point.} \centeredline{|\xintDenominator
  {178000/25600000[17]}|\digitstt{=\xintDenominator {178000/25600000[17]}}}%
\centeredline{|\xintDenominator {312.289001/20198.27}|%
               \digitstt{=\xintDenominator {312.289001/20198.27}}}
\centeredline{|\xintDenominator {178000e-3/256e5}|\digitstt{=\xintDenominator
    {178000e-3/256e5}}} 
\centeredline{|\xintDenominator {178.000/25600000}|\digitstt{=\xintDenominator
    {178.000/25600000}}} As shown by the examples, no simplification of the
input is done. The denominator looks wrong in the last example, but the
numerator was tacitly multiplied by &1000& through the removal of the decimal
point.   For a result uniquely associated to the value of the fraction
first apply \csa{xintIrr}.

\subsection{\csbh{xintRawWithZeros}}\label{xintRawWithZeros}
{\small New name in |1.07| (former name |\xintRaw|).\par}

This macro `prints' the 
fraction |f| (after its parsing and expansion) in |A/B| form, with |A|
as returned by \csa{xintNumerator}|{f}| and |B| as returned by
\csa{xintDenominator}|{f}|.
\centeredline{|\xintRawWithZeros{\the\numexpr 571*987\relax.123e-10/\the\numexpr
    -201+59\relax e-7}=|}%
\centeredline{\digitstt{\xintRawWithZeros{\the\numexpr
      571*987\relax.123e-10/\the\numexpr -201+59\relax e-7}}} 


\subsection{\csbh{xintREZ}}\label{xintREZ}

This command normalizes a fraction by removing the powers of ten from its
numerator and denominator: \centeredline{|\xintREZ {178000/25600000[17]}|\digitstt{=\xintREZ
  {178000/25600000[17]}}}
\centeredline{|\xintREZ
{1780000000000e30/2560000000000e15}|\digitstt{=\xintREZ 
{1780000000000e30/2560000000000e15}}}
As shown by the example, it does not
otherwise simplify the fraction.


\subsection{\csbh{xintFrac}}\label{xintFrac}

This is a \LaTeX{} only command, to be used in math mode only. It will print a
fraction, internally represented as something equivalent to |A/B[n]| as |\frac
{A}{B}10^n|. The power of ten is omitted when |n=0|, the denominator is omitted
when it has value one, the number being separated from the power of ten by a
|\cdot|. |$\xintFrac {178.000/25600000}$| gives $\xintFrac {178.000/25600000}$,
|$\xintFrac {178.000/1}$| gives $\xintFrac {178.000/1}$,  |$\xintFrac
{3.5/5.7}$| gives $\xintFrac {3.5/5.7}$, and |$\xintFrac {\xintNum
  {\xintFac{10}/|\allowbreak|\xintiSqr{\xintFac {5}}}}$| gives
 $\xintFrac {\xintNum {\xintFac{10}/\xintiSqr{\xintFac {5}}}}$. 
As shown by the examples, 
simplification of the input (apart from removing the decimal points and
moving the minus sign to the numerator) is not done automatically and must be
the result of macros such as |\xintIrr|, |\xintREZ|, or |\xintNum| (for
fractions being in fact integers.)

\subsection{\csbh{xintSignedFrac}}\label{xintSignedFrac}

{\small New with release |1.04|.\par}

This is as \csb{xintFrac} except that a negative fraction has the sign put in
front, not in the numerator.
\centeredline{|\[\xintFrac {-355/113}=\xintSignedFrac {-355/113}\]|}
\[\xintFrac {-355/113}=\xintSignedFrac {-355/113}\]

\subsection{\csbh{xintFwOver}}\label{xintFwOver}

This does the same as \csa{xintFrac} except that the \csa{over} primitive is
used for the fraction (in case the denominator is not one; and a pair of braces
contains the |A\over B| part). |$\xintFwOver {178.000/25600000}$| gives
$\xintFwOver {178.000/25600000}$, |$\xintFwOver {178.000/1}$| gives $\xintFwOver
{178.000/1}$, |$\xintFwOver {3.5/5.7}$| gives $\xintFwOver {3.5/5.7}$, and
|$\xintFwOver {\xintNum {\xintFac{10}/\xintiSqr{\xintFac {5}}}}$| gives
$\xintFwOver {\xintNum {\xintFac{10}/\xintiSqr{\xintFac {5}}}}$.

\subsection{\csbh{xintSignedFwOver}}\label{xintSignedFwOver}

{\small New with release |1.04|.\par}

This is as \csb{xintFwOver} except that a negative fraction has the sign put in
front, not in the numerator.
\centeredline{|\[\xintFwOver {-355/113}=\xintSignedFwOver {-355/113}\]|}
\[\xintFwOver {-355/113}=\xintSignedFwOver {-355/113}\]


\subsection{\csbh{xintIrr}}\label{xintIrr}
{\small \color{red}MODIFIED IN |1.08|.\par}

This puts the fraction into its unique irreducible form: \centeredline{|\xintIrr
  {178.256/256.178}|%
  \digitstt{=\xintIrr {178.256/256.178}}${}=\xintFrac{\xintIrr
    {178.256/256.178}[0]}$}%
Note that the current implementation does not cleverly first factor powers of 2
and 5, so input such as |\xintIrr {2/3[100]}| will make \xintfracname do the
Euclidean division of |2|\raisebox{.5ex}{|.|}|10^{100}| by |3|, which is a bit
stupid.

Starting with release |1.08|, \csa{xintIrr} does not remove the trailing |/1|
when the output is an integer. This was deemed better for various (stupid?)
reasons and thus the output format is now \emph{always} |A/B| with |B>0|. Use
\csb{xintPRaw} on top of \csa{xintIrr} if it is needed to get rid of a possible
trailing |/1|. For display in math mode, use rather |\xintFrac{\xintIrr {f}}| or
|\xintFwOver{\xintIrr {f}}|.

\subsection{\csbh{xintJrr}}\label{xintJrr}
{\small \color{red}MODIFIED IN |1.08|.\par}

This also puts the fraction into its unique irreducible form:
\centeredline{|\xintJrr {178.256/256.178}|%
  \digitstt{=\xintJrr {178.256/256.178}}}%
This is faster than \csa{xintIrr} for fractions having some big common
factor in the numerator and the denominator.\par
{\centering |\xintJrr {\xintiPow{\xintFac {15}}{3}/\xintiPrdExpr
{\xintFac{10}}{\xintFac{30}}{\xintFac{5}}\relax }|\digitstt{=%
 \xintJrr {\xintiPow{\xintFac {15}}{3}/\xintiPrdExpr
{\xintFac{10}}{\xintFac{30}}{\xintFac{5}}\relax }}\par} But to notice the
difference one would need computations with much bigger numbers than in this
example.
Starting with release |1.08|, \csa{xintJrr} does not remove the trailing |/1|
when the output is an integer. 


\subsection{\csbh{xintTrunc}}\label{xintTrunc}

\csa{xintTrunc}|{x}{f}| returns the start of the decimal expansion of the
fraction |f|, with |x| digits after the decimal point. The argument |x| should
be non-negative. When |x=0|, the integer part of |f| results, with an ending
decimal point. Only when |f| evaluates to zero does \csa{xintTrunc} not print a
decimal point. When |f| is not zero, the sign is maintained in the output, also
when the digits are all zero. \centeredline{|\xintTrunc
  {16}{-803.2028/20905.298}|\digitstt{=\xintTrunc {16}{-803.2028/20905.298}}}%
\centeredline{|\xintTrunc {20}{-803.2028/20905.298}|\digitstt{=\xintTrunc
    {20}{-803.2028/20905.298}}}%
\centeredline{|\xintTrunc {10}{\xintPow {-11}{-11}}|\digitstt{=\xintTrunc
    {10}{\xintPow {-11}{-11}}}}%
\centeredline{|\xintTrunc {12}{\xintPow {-11}{-11}}|\digitstt{=\xintTrunc
    {12}{\xintPow {-11}{-11}}}}%
\centeredline{|\xintTrunc {12}{\xintAdd {-1/3}{3/9}}|\digitstt{=\xintTrunc
    {12}{\xintAdd {-1/3}{3/9}}}} The digits printed are exact up to and
including the last one. The identity |\xintTrunc {x}{-f}=-\xintTrunc {x}{f}|
holds.\footnote{Recall that |-\string\macro| is not valid as argument to any
  package macro, one must use |\string\xintOpp\string{\string\macro\string}| or
  |\string\xintiOpp\string{\string\macro\string}|, except inside
  |\string\xinttheexpr...\string\relax|.}

\subsection{\csbh{xintiTrunc}}\label{xintiTrunc}

\csa{xintiTrunc}|{x}{f}| returns the integer equal to |10^x| times what
\csa{xintTrunc}|{x}{f}| would return. \centeredline{|\xintiTrunc
  {16}{-803.2028/20905.298}|\digitstt{=\xintiTrunc {16}{-803.2028/20905.298}}}%
 \centeredline{|\xintiTrunc
  {10}{\xintPow {-11}{-11}}|\digitstt{=\xintiTrunc
  {10}{\xintPow {-11}{-11}}}}%
 \centeredline{|\xintiTrunc
  {12}{\xintPow {-11}{-11}}|\digitstt{=\xintiTrunc
  {12}{\xintPow {-11}{-11}}}}%
Differences between \csa{xintTrunc}|{0}{f}| and \csa{xintiTrunc}|{0}{f}|:
the former cannot be used inside integer-only macros, and the latter
removes the decimal point, and never returns |-0| (and of course removes
all superfluous leading zeros.)

\subsection{\csbh{xintRound}}\label{xintRound}

{\small New with release |1.04|.\par}

\csa{xintRound}|{x}{f}| returns the start of the decimal expansion of the
fraction |f|, rounded to |x| digits precision after the decimal point. The
argument |x| should be non-negative. Only when |f| evaluates exactly to zero
does \csa{xintRound} return |0| without decimal point. When |f| is not zero, its
sign is given in the output, also when the digits printed are all zero.
\centeredline{|\xintRound {16}{-803.2028/20905.298}|\digitstt{=\xintRound
    {16}{-803.2028/20905.298}}}% 
 \centeredline{|\xintRound
  {20}{-803.2028/20905.298}|\digitstt{=\xintRound {20}{-803.2028/20905.298}}}%
 \centeredline{|\xintRound
  {10}{\xintPow {-11}{-11}}|\digitstt{=\xintRound
  {10}{\xintPow {-11}{-11}}}}%
 \centeredline{|\xintRound
  {12}{\xintPow {-11}{-11}}|\digitstt{=\xintRound
  {12}{\xintPow {-11}{-11}}}}%
\centeredline{|\xintRound {12}{\xintAdd {-1/3}{3/9}}|\digitstt{=\xintRound
    {12}{\xintAdd {-1/3}{3/9}}}} 
The identity |\xintRound {x}{-f}=-\xintRound {x}{f}| holds. And regarding
$(-11)^{-11}$ here is some more of its expansion: 
\centeredline{\digitstt{\xintTrunc  {50}{\xintPow {-11}{-11}}\dots}}

\subsection{\csbh{xintiRound}}\label{xintiRound}

{\small New with release |1.04|.\par}

\csa{xintiRound}|{x}{f}| returns the integer equal to |10^x| times what
\csa{xintRound}|{x}{f}| would return. \centeredline{|\xintiRound
  {16}{-803.2028/20905.298}|\digitstt{=\xintiRound {16}{-803.2028/20905.298}}}%
\centeredline{|\xintiRound {10}{\xintPow {-11}{-11}}|\digitstt{=\xintiRound
    {10}{\xintPow {-11}{-11}}}}%
Differences between \csa{xintRound}|{0}{f}| and \csa{xintiRound}|{0}{f}|: 
the former cannot be used inside integer-only macros, and the 
latter removes the decimal point, and never returns |-0| (and of course removes
all superfluous leading zeros.)

\subsection{\csbh{xintFloor}}\label{xintFloor}
{\small New with release |1.09a|.\par}

\subsection{\csbh{xintCeil}}\label{xintCeil}
{\small New with release |1.09a|.\par}


\subsection{\csbh{xintE}}\label{xintE}
{\small New with |1.07|.}

|\xintE {f}{x}| multiplies the fraction |f| by &10^x&. The \emph{second}
argument |x| must obey the \TeX{} bounds. Example: |\count
255 123456789 \xintE {10}{\count 255}|\digitstt{->\count
255 123456789 \xintE {10}{\count 255}}. Be careful that for obvious reasons such
gigantic numbers should not be given to \csb{xintNum}, or added to something
with a widely different order of magnitude, as the package always works to get
the \emph{exact} result. There is \emph{no problem} using them for
\emph{float} operations:\centeredline{|\xintFloatAdd
  {1e1234567890}{1}|\digitstt{=\xintFloatAdd {1e1234567890}{1}}}

\subsection{\csbh{xintDigits}, \csbh{xinttheDigits}}\label{xintDigits}

{\small New with release |1.07|.\par}

The syntax |\xintDigits := D;| (where spaces do not matter) assigns the
value of |D| to the number of digits to be used by floating point
operations. The default is |16|. The maximal value is |32767|. The macro
|\xinttheDigits| serves to print the current value.

\subsection{\csbh{xintFloat}}\label{xintFloat}

{\small New with release |1.07|.\par}

The macro |\xintFloat [P]{f}| has an optional argument |P| which replaces
the current value of |\xintDigits|. The (rounded truncation of the) fraction
|f| is then printed in scientific form, with |P| digits,
a lowercase |e| and an exponent |N|.  The first digit is from |1| to |9|, it is
preceded by an optional minus sign and 
is followed by a dot and |P-1| digits, the trailing zeros
are not trimmed. In the exceptional case where the
rounding went to the next power of ten, the output is |10.0...0eN|
(with a sign, perhaps). The sole exception is for a zero value, which then gets
output as |0.e0| (in an \csa{xintCmp} test it is the only possible output of
\csa{xintFloat} or one of the `Float' macros which will test positive for
equality with zero). 
\centeredline{|\xintFloat[32]{1234567/7654321}|%
               \digitstt{=\xintFloat[32]{1234567/7654321}}}
% \pdfresettimer
\centeredline{|\xintFloat[32]{1/\xintFac{100}}|%
               \digitstt{=\xintFloat[32]{1/\xintFac{100}}}}
% \the\pdfelapsedtime
% 992: plus rapide que ce que j'aurais cru..

The argument to \csa{xintFloat} may be an |\xinttheexpr|-ession, like the
other macros; only its final evaluation is submitted to \csa{xintFloat}: the
inner evaluations of chained arguments are not at all done in `floating'
mode. For this one must use |\xintthefloatexpr|.


\subsection{\csbh{xintAdd}}\label{xintAdd}

The original macro is extended to accept fractions on input. Its output will now
always be in the form |A/B[n]|. The original is available as \csb{xintiAdd}.

\subsection{\csbh{xintFloatAdd}}\label{xintFloatAdd}

{\small New with release |1.07|.\par}

|\xintFloatAdd [P]{f}{g}| first replaces |f| and |g| with their float
approximations, with 2 safety digits. It then adds exactly and outputs in
float format with precision |P| (which is optional) or |\xintDigits| if |P|
was absent, the result of this computation.


\subsection{\csbh{xintSub}}\label{xintSub}

The original macro is extended to accept fractions on input. Its output will now
always be in the form |A/B[n]|.
The original is available as \csb{xintiSub}.

\subsection{\csbh{xintFloatSub}}\label{xintFloatSub}

{\small New with release |1.07|.\par}

|\xintFloatSub [P]{f}{g}| first replaces |f| and |g| with their float
approximations, with 2 safety digits. It then subtracts exactly and outputs in
float format with precision |P| (which is optional), or |\xintDigits| if |P|
was absent, the result of this computation.


\subsection{\csbh{xintMul}}\label{xintMul}

The original macro is extended to accept fractions on input. Its output will now
always be in the form |A/B[n]|. 
The original is available as \csb{xintiMul}.

\subsection{\csbh{xintFloatMul}}\label{xintFloatMul}

{\small New with release |1.07|.\par}

|\xintFloatMul [P]{f}{g}| first replaces |f| and |g| with their float
approximations, with 2 safety digits. It then multiplies exactly and outputs in
float format with precision |P| (which is optional), or |\xintDigits| if |P|
was absent, the result of this computation.

\subsection{\csbh{xintSqr}}\label{xintSqr}

The original macro is extended to accept a fraction on input. Its output will
now always be in the form |A/B[n]|. The original is available as
\csb{xintiSqr}.

\subsection{\csbh{xintDiv}}\label{xintDiv}

\csa{xintDiv}|{f}{g}| computes the fraction |f/g|. As with all other computation
macros, no simplification is done on the output, which is in the form |A/B[n]|.

\subsection{\csbh{xintFloatDiv}}\label{xintFloatDiv}

{\small New with release |1.07|.\par}

|\xintFloatDiv [P]{f}{g}| first replaces |f| and |g| with their float
approximations, with 2 safety digits. It then divides exactly and outputs in
float format with precision |P| (which is optional), or |\xintDigits| if |P|
was absent, the result of this computation.


\subsection{\csbh{xintFac}}\label{xintFac}
{\small Modified in |1.08b| (to allow fractions on input).\par}

The original is extended to allow a fraction on input but this fraction |f| must
simplify to a integer |n| (non negative and at most |999999|, but already
|100000!| is prohibitively time-costly). On output |n!|
(no trailing |/1[0]|). The original macro
(which has less overhead) is still 
available as \csb{xintiFac}.

\subsection{\csbh{xintPow}}\label{xintPow}

\csa{xintPow}{|{f}{g}|}: the original macro is extended to accept fractions on
input. The output will now always be in the form
|A/B[n]| (even when the exponent vanishes: |\xintPow
{2/3}{0}|\digitstt{=\xintPow{2/3}{0}}). The original is available as
\csb{xintiPow}. 

% \xintDigits:= 3;

The exponent is allowed\MyMarginNote{Changed in |1.08b|} to be input as a
fraction but it must simplify to an integer: |\xintPow
{2/3}{10/2}|\digitstt{=\xintPow {2/3}{10/2}}. This integer will be checked to
not exceed |999999999|; future releases will presumably lower this limit as
even much much smaller values already create gigantic numerators and
denominators which can not be computed exactly in a reasonable time. Indeed
|2^999999999| has \digitstt{\xintLen {\xintFloatPow [1]{2}{999999999}}} digits. 



% \xintDigits:= 16;

\subsection{\csbh{xintFloatPow}}\label{xintFloatPow}
{\small New with |1.07|.\par}

|\xintFloatPow [P]{f}{x}| uses either the optional argument |P| or the value of
|\xintDigits|. It computes a floating approximation to |f^x|. 

The exponent |x| will be fed to a |\numexpr|, hence count registers are accepted
on input for this |x|. And the absolute value \verb+|x|+ must obey the \TeX{}
bound. For larger exponents use the slightly slower routine \csb{xintFloatPower}
which allows the exponent to be a fraction simplifying to an integer and does
not limit its size. This slightly slower routine is the one to which |^| is
mapped inside |\xintthefloatexpr...\relax|.


The macro |\xintFloatPow| chooses dynamically an appropriate number of
digits for the intermediate computations, large enough to achieve the desired
accuracy (hopefully).

\centeredline{|\xintFloatPow [8]{3.1415}{1234567890}|%
               \digitstt{=\xintFloatPow [8]{3.1415}{1234567890}}}



\subsection{\csbh{xintFloatPower}}\label{xintFloatPower}
{\small New with |1.07|.\par}

\csa{xintFloatPower}|{f}{g}| computes a floating point value |f^g| where the
exponent |g| is not constrained to be at most the \TeX{} bound
\texttt{\number "7FFFFFFF}. It may even be a
fraction |A/B| but must simplify to an integer.
\centeredline{|\xintFloatPower [8]{1.000000000001}{1e12}|%
               \digitstt{=\xintFloatPower [8]{1.000000000001}{1e12}}}
\centeredline{|\xintFloatPower [8]{3.1415}{3e9}|%
               \digitstt{=\xintFloatPower [8]{3.1415}{3e9}}}
Note that |3e9>2^31|. But  the number following |e| in the output must at any
rate obey the \TeX{}
\digitstt{\number"7FFFFFFF} bound.


Inside an |\xintfloatexpr|-ession, \csa{xintFloatPower} is the function to which
|^| is mapped. The exponent may then be something like |(144/3/(1.3-.5)-37)|
which is, in disguise, an integer.


The intermediate multiplications are done with a higher precision than
|\xintDigits| or the optional |P| argument, in order for the
final result to hopefully have the desired accuracy.

\subsection{\csbh{xintFloatSqrt}}\label{xintFloatSqrt}
{\small New with |1.08|.\par}

\csa{xintFloatSqrt}|[P]{f}| computes a floating point approximation of
$\sqrt{|f|}$, either using the optional precision |P| or the value of
|\xintDigits|. The computation is done for a precision of at least 17 figures
(and the output is rounded if the asked-for precision was smaller).
\centeredline{|\xintFloatSqrt [50]{12.3456789e12}|}%
\centeredline{${}\approx{}$\digitstt{\xintFloatSqrt [50]{12.3456789e12}}}%
\centeredline{|\xintDigits:=50;\xintFloatSqrt {\xintFloatSqrt {2}}|}%
\centeredline{%
  ${}\approx{}$\xintDigits:=50;\digitstt{\xintFloatSqrt {\xintFloatSqrt {2}}}}

% maple: 0.351364182864446216166582311675807703715914271812431919843183 1O^7
%         3.5136418286444621616658231167580770371591427181243e6
% maple: 1.18920711500272106671749997056047591529297209246381741301900
%        1.1892071150027210667174999705604759152929720924638e0


\xintDigits:=16;


\subsection{\csbh{xintSum}, \csbh{xintSumExpr}}\label{xintSum}% le % inutile
\label{xintSumExpr}

The original commands are extended to accept fractions on input and produce
fractions on output. Their outputs will now always be in the form |A/B[n]|. The
originals are available as \csa{xintiSum} and \csa{xintiSumExpr}.


\subsection{\csbh{xintPrd}, \csbh{xintPrdExpr}}\label{xintPrd}\label{xintPrdExpr}

The originals are extended to accept fractions on input and produce fractions on
output. Their outputs will now always be in the form |A/B[n]|. The originals are
available as \csa{xintiPrd} and \csa{xintiPrdExpr}.

\subsection{\csbh{xintCmp}}\label{xintCmp}
{\small Rewritten in |1.08a|.\par}

The macro is extended to fractions. Of course its output is still either
|-1|, |0|, or |1| with no forward slash nor trailing |[n]|. 
The original, which skips the overhead of
the fraction format parsing, is available as \csb{xintiCmp}.

For choosing branches according to the result of comparing |f| and |g|, the
following syntax is recommended: |\xintSgnFork{\xintCmp{f}{g}}{code for
  f<g}{code for f=g}{code for f>g}|.

Note that since release |1.08a| using this macro on inputs with large powers of
tens does not take a quasi-infinite time, contrarily to the earlier, somewhat
dumb version (the earlier version indirectly led to the creation of giant chains
of zeros in certain circumstances, causing a serious efficiency impact).

\subsection{\csbh{xintIsOne}}
{\small New with release |1.09a|.\par}

\subsection{\csbh{xintGeq}}\label{xintGeq}
{\small Rewritten in |1.08a|.\par}

The macro is extended to fractions. The original, which skips the overhead of
the fraction format parsing, is available as \csb{xintiGeq}. Beware that the
comparison is on 
the \emph{absolute values} of the fractions. Can be used as:
\verb+\xintSgnFork{\xintGeq{f}{g}}{}{code for |f|<|g|}{code for
  |f|+$\geqslant$\verb+|g|}+ 


Same improvements in |1.08a| as for
\csb{xintCmp}. 

\subsection{\csbh{xintMax}}\label{xintMax}
{\small Rewritten in |1.08a|.\par}

The macro is extended to fractions. But now |\xintMax {2}{3}| returns
\digitstt{\xintMax {2}{3}}. The original is available as
\csb{xintiMax}. 

\subsection{\csbh{xintMaxof}}
{\small New with release |1.09a|.\par}

\subsection{\csbh{xintMin}}\label{xintMin}
{\small Rewritten in |1.08a|.\par}

The macro is extended to fractions. The original is available as
\csb{xintiMin}.

\subsection{\csbh{xintMinof}}
{\small New with release |1.09a|.\par}

\subsection{\csbh{xintAbs}}\label{xintAbs}

The macro is extended to fractions. The original is available as
\csb{xintiAbs}. Note that |\xintAbs {-2}|\digitstt{=\xintAbs {-2}} whereas
|\xintiAbs {-2}|\digitstt{=\xintiAbs {-2}}.

\subsection{\csbh{xintSgn}}\label{xintSgn}

The macro is extended to fractions. Of course its output is still either
|-1|, |0|, or |1| with no forward slash nor trailing |[n]|. The
original, which skips the overhead of the fraction format parsing, is
available as \csb{xintiSgn}.

\subsection{\csbh{xintOpp}}\label{xintOpp}

The macro is extended to fractions. The original is available as
\csb{xintiOpp}. Note that |\xintOpp {3}| now outputs \digitstt{\xintOpp {3}}.

\subsection{\csbh{xintDivision}, \csbh{xint\-Quo}, \csbh{xint\-Rem},
  \csbh{xintFDg}, \csbh{xintLDg}, \csbh{xintMON}, \csbh{xintMMON}, \csbh{xintOdd}}

These macros are extended to accept a fraction on input if this fraction
in fact reduces to an integer (if not an |\xintError:NotAnInteger| will
be raised). As usual, the `{\color{blue}i}' variants all exist, they
accept on input only integers in the strict format and have less
overhead. There is no difference in the output, the difference is only
in the accepted format for the inputs.

\subsection{\csbh{xintNum}}\label{xintNum}

The macro is extended to accept a fraction on input. But this fraction should
reduce to an integer. If not an error will be raised. The original is available
as \csb{xintiNum}. It is imprudent to apply \csa{xintNum} to numbers with a
large power of ten given either in scientific notation or with the |[n]|
notation, as the macro will add the necessary zeros to get an explicit
integer.\centeredline{|\xintNum {1e80}|}
\centeredline{\digitstt{\xintNum{1e80}}}


\section{Expandable expressions with the \xintexprname package}%
\label{sec:comexpr}

\SetInnerTocdepthTo {2}

The \xintexprname package was first released with version |1.07| of the
\xintname bundle. Loading this package automatically loads \xintfracname, hence
also \xintname.

\begin{framed}
  Release |1.09a| has extended the scope of |\xintexpr|-essions with infix
  comparison operators (|<|, |>|, |=|), logical operators (|&|, \verb+|+),
  functions (|round|, |sqrt|, |max|, |all|, etc...) and conditional branching
  (|if| and |?|, |ifsgn| and |:|, the function forms evaluate the skipped
  branches, the |?| and |:| operators do not).

  Refer to the first pages of this manual for the current situation. Apart from
  some adjustments in the description of |\xintNewExpr| which now works with
  |#|, and removal of obsolete material, the documentation in this section is
  close to its earlier state describing |1.08b| and is lacking in examples
  illustrating all the new functionality with |1.09a|.
\end{framed}

%% \clearpage

\localtableofcontents

\subsection{The \csbh{xintexpr} expressions}\label{xintexpr}%
\label{xinttheexpr}\label{xintthe}


An \xintexprname{}ession is a construct
\csb{xintexpr}\meta{expandable\_expression}|\relax| where the expandable
expression is read and expanded from left to right, and whose constituents\MyMarginNote{See \autoref{sec:exprsummary} for
  up-to-date information}
should be (they are uncovered by iterated left to right expansion of the
contents during the scanning):
\begin{itemize}
\item integers or decimal numbers, such as |123.345|, or numbers in scientific
  notation |6.02e23| or |6.02E23| (or anything expanding to
  these things; a decimal number may start directly with a decimal point), 
\item fractions |A/B|, or |a.b/c.d| or |a.beN/c.deM|, if they are to be treated
  as one entity should then be parenthesized, \emph{e.g.} disambiguating |A/B^2|
  from |(A/B)^2|,
\item the standard binary operators, |+|, |-|, |*|, |/|, and |^| (the |**|
  notation for exponentiation is not recognized and will give an error),
\item opening and closing parentheses, with arbitrary level of nesting,
\item |+| and |-| as prefix operators,
\item |!| as postfix factorial operator (applied to a non-negative integer),
\item and sub-expressions |\xintexpr|\meta{stuff}|\relax| (they do not need
  to be put within parentheses).
\item braced material |{...}| which is only allowed to arise when the parser is
  starting to fetch an operand; the material will be completely expanded and
  \emph{must} deliver some number |A|, or fraction |A/B|, possibly with decimal
  mark or ending |[n]|, but without the |e|, |E| of the scientific notation.
  Conversely fractions in |A/B[n]| format with the ending |[n]| \emph{must} be
  enclosed in such braces. Of course braces also appear in the completely
    other r\^ole of feeding macros with their parameters, they will then not be
    seen by the parser at all as they are managed by the macro.
\end{itemize}


Such an expression, like a |\numexpr| expression, is not directly printable, nor
can it be directly used as argument to the other package macros. For this one
uses one of the two equivalent forms:
\begin{itemize}
\item \csb{xinttheexpr}\meta{expandable\_expression}|\relax|, or
\item \csb{xintthe}|\xintexpr|\meta{expandable\_expression}|\relax|.
\end{itemize}

As with other package macros the computations are done \emph{exactly}, and with
no simplification of the result. The output format can be coded\MyMarginNote{new
  with |1.09a|} inside the expression through the use of one of the functions
|round|, |trunc|, |float|, |reduce|.\footnote{In |round| and |trunc| the second
  optional parameter is the number of digits of the fractional part; in |float|
  it is the total number of digits of the mantissa.} \par
\begingroup\raggedright\leftskip.5cm
{|\xinttheexpr 1/5!-1/7!-1/9!\relax|%
    \digitstt{=\xinttheexpr 1/5!-1/7!-1/9!\relax}}\\
{|\xinttheexpr round(1/5!-1/7!-1/9!,18)\relax|%
    \digitstt{=\xinttheexpr round(1/5!-1/7!-1/9!,18)\relax}}\\
{|\xinttheexpr float(1/5!-1/7!-1/9!,18)\relax|%
    \digitstt{=\xinttheexpr float(1/5!-1/7!-1/9!,18)\relax}}\\
{|\xinttheexpr reduce(1/5!-1/7!-1/9!)\relax|%
    \digitstt{=\xinttheexpr reduce(1/5!-1/7!-1/9!)\relax}}\\
{|\xinttheexpr 1.99^-2 - 2.01^-2 \relax|%
    \digitstt{=\xinttheexpr 1.99^-2 - 2.01^-2 \relax}}\\
{|\xinttheexpr round(1.99^-2 - 2.01^-2, 10)\relax|%
    \digitstt{=\xinttheexpr round(1.99^-2 - 2.01^-2, 10) \relax}}\par
\endgroup

\smallskip
\begin{itemize}
\item |\xintexpr|-essions evaluate through expansion to arbitrarily big
  fractions, and are prefixed by |\xintthe| for printing (or use
  |\xinttheexpr|).
\item the standard operations of addition, subtraction,
  multiplication, division, power, are written in infix form,
\item recognized numbers on input are either integers, decimal numbers, or
  numbers written in scientific notation, (or anything expanding to the previous
  things),
\item macros encountered on the way must be fully expandable, 
\item fractions on input with the ending |[n]| part, or macros expanding to
  such some |A/B[n]| must be enclosed in 
  (exactly one) pair of braces,
\item the expression may contain arbitrarily many levels of nested parenthesized
  sub-expressions,  
\item sub-contents giving numbers of fractions should be either
   \begin{enumerate}
   \item parenthesized,
   \item a sub-expression |\xintexpr...\relax|,
   \item or within braces. 
   \end{enumerate}
 \item an expression can not be given as argument to the other package macros,
   nor printed, for this one must use |\xinttheexpr...\relax| or
   |\xintthe\xintexpr...\relax|,
\item one does not use |\xinttheexpr...\relax| as a sub-constituent of an
  |\xintexpr...\relax| as it would have to be put
  within some braces, and it is simpler to write it directly as
  |\xintexpr...\relax|, 
\item as usual no simplification is done on the output and is the responsability
  of post-processing,
\item very long output will need special macros to break
  across lines, like the |\printnumber| macro used in this documentation,
\item use of |+|, |*|, ... inside parameters to macros is out of the scope of
  the |\xintexpr| parser, 
\item finally each \xintexprname{}ession is completely expandable and obtains
  its result in two expansion steps.
\end{itemize}

With defined macros destined to be re-used within another one, one has the
choice between parentheses or |\xintexpr...\relax|: |\def\x {(\a+\b)}| or
|\def\x {\xintexpr \a+\b\relax}|. The latter is better as it allows |\xintthe|.

\subsection{\texorpdfstring{\texttt{\protect\string\numexpr}}{\textbackslash numexpr} expressions, count and dimension registers}

They can not be used directly but must be prefixed by |\the| or |\number| for
the count registers and by |\number| for the dimension registers. The dimension
is then converted to its value in scalable points |sp|, which are |1/65536|th of
a point.

One may thus compute exactly and expandably with dimensions even exceeding
temporarily the \TeX{} limits and then convert back approximately to points by
division by |65536| and rounding to |4|,|5| or |6| decimal digits after the
decimal point.


\subsection{Catcodes and spaces}



\subsubsection{\csbh{xintexprSafeCatcodes}}\label{xintexprSafeCatcodes}
{\small New with release |1.09a|.\par}

Active characters will interfere with |\xintexpr|-essions. One may prefix them
with |\string| or use the command \csa{xintexprSafeCatcodes} before the
|\xintexpr|-essions. This (locally) sets the catcodes of the characters acting
as operators to safe values. The command \csb{xintNewExpr} does it by itself,
in a group.

\subsubsection{\csbh{xintexprRestoreCatcodes}}\label{xintexprRestoreCatcodes}
{\small New with release |1.09a|.\par}

Restores the catcodes to the earlier state. 

\bigskip

Spaces inside an |\xinttheexpr...\relax| should mostly be
innocuous (if the
expression contains macros, then it is the macro which is responsible for
grabbing its arguments, so spaces within the arguments are presumably to be
avoided, as a general rule.).

|\xintexpr| and |\xintthexpr| are very agnostic regarding catcodes: digits,
binary operators, minus and plus signs as prefixes, parentheses, decimal point,
may be indifferently of catcode letter or other or subscript or superscript,
..., it does not matter. Of course |+|, |-|, |*|, |/|, |^| or |!| should not be
active as everything is expanded along the way. If one of them (especially |!|
which is made active by Babel for certain languages) is active, it should be
prefixed with |\string|. In the case of the factorial, the macro |\xintFac| may
be used rather than the postfix |!|, preferably within braces as this will avoid
the subsequent slow scan digit by digit of its expansion (other macros from the
\xintfracname package generally \emph{must} be used within a brace pair, as they
expand to fractions |A/B[n]| with the trailing |[n]|; the |\xintFac| produces an
integer with no |[n]| and braces are only optional, but preferable, as the
scanner will get the job done faster.)

Sub-material within braces is treated technically in a different manner, and
depending on the macros used therein may be more sensitive to the catcode of the
five operations. Digits, slash, square
brackets, sign, produced on output by an |\xinttheexpr| are all of catcode 12.
For the output of |\xintthefloatexpr| digits, decimal dot, signs are of catcode
12, and the `e' is of catcode 11. 

Note that if some macro is inserted in the expression it will expand and grab
its arguments before the parser may get a chance to see them, so the situation
with catcodes and spaces is not as flexible within the macro arguments.


\subsection{Expandability}

As is the case with all other package macros |\xintexpr| expands in two steps to
its final (non-printable) result; and similarly for |\xinttheexpr|.

%  The
% `lowercase' form are a bit unusual as these macros are already in lowercase... :
% |\xinteval| for |\xintexpr| and |\xinttheeval| for |\xinttheexpr|. 

% Similarly,
% there are |\xintfloateval| and |\xintthefloateval|.

As explained above the expressions should contain only expandable material,
except that braces are allowed when they enclose either a fraction (or decimal
number) or something arbitrarily complicated but expanding (in a manner
compatible to an expansion only context) to such a fraction or decimal number.

\subsection{Memory considerations}

The parser creates an undefined control sequence for each intermediate
computation (this does not of course refer to the intermediate steps needed in
the evaluations of the \csb{xintAdd}, \csb{xintMul}, etc... macros corresponding
to the infix operators, but only to each conversion of such an infix operator
into a computation). So, a moderately sized expression might create 10, or 20
such control sequences. On my \TeX{} installation, the memory available for such
things is of circa \np{200000} multi-letter control words. So this means that a
document containing hundreds, perhaps even thousands of expressions will compile
with no problem. But, if the package is used for computing plots\footnote{this
  is not very probable as so far \xintname does not include a mathematical
  library with floating point calculations, but provides only the basic
  operations of algebra.}, this may cause a problem.

There is a solution.\footnote{which convinced me that I could stick with the
  parser implementation despite its potential impact on the hash-table.}

A
document can possibly do tens of thousands of evaluations only
if some formulas are being used repeatedly, for example inside loops, with
counters being incremented, or with data being fetched from a file. So it is the
same formula used again and again with varying numbers inside.

With the \csb{xintNewExpr} command, it is possible to convert once and for all
an expression containing parameters into an expandable macro with parameters.
Only this initial definition of this macro actually activates the \csb{xintexpr}
parser and will (very moderately) impact the hash-table: once this unique
parsing is done, a macro with parameters is produced which is built-up
recursively from the \csb{xintAdd}, \csb{xintMul}, etc... macros, exactly as it
was necessary to do before the availability of the \xintexprname package.

\subsection{The \csbh{xintNewExpr} command}\label{xintNewExpr}

% This allows to define a completely expandable macro with parameters, expanding
% in two steps to its final evaluation, and corresponding to the given
% \xintname{}expression where the parameters are input using the usual
% macro-parameter: |#1|, ..., |#9|.

The command is used
as:\centeredline{|\xintNewExpr{\myformula}[n]|\marg{stuff}, where}
\begin{itemize}
\item \meta{stuff} will be inserted inside |\xinttheexpr . . . \relax|,
\item |n| is an integer between zero and nine, inclusive, and tells how many
  parameters will |\myformula| have (it is \emph{mandatory} despite the bracket
  notation, and |n=0| if the macro to be defined  has no
  parameter,\footnote{there is some use for \csa{xintNewExpr}|[0]| compared to
    an 
    \csa{edef} as \csa{xintNewExpr} has some built-in catcode protection.}
\item the placeholders |#1|, |#2|, ..., |#n| are used inside \meta{stuff}
  in their usual r\^ole. 
\end{itemize}

The macro |\myformula| is defined without checking if it
already exists, \LaTeX{} users might prefer to do first |\newcommand*\myformula
{}| to get a reasonable error message in case |\myformula| already exists.

The definition of |\myformula| made by |\xintNewExpr| is global, it transcends
\TeX{} groups or \LaTeX{} environments. The protection against active characters
is done automatically.

It will be a completely expandable macro entirely built-up using |\xintAdd|,
|\xintSub|, |\xintMul|, |\xintDiv|, |\xintPow|, |\xintOpp| and
|\xintFac|\MyMarginNote{|1.09a|: and many others... } and 
corresponding to the formula as written with the infix
operators.

\begin{framed}
  A ``formula'' created by |\xintNewExpr| is thus a macro whose parameters are
  given to a possibly very complicated combination of the various macros of
  \xintname and \xintfracname; hence one can not use infix notation and hope to
  do |\myformula {28^7-35^12}| (contrarily to the case where one would just made
  earlier 
  \centeredline{|\def\myformula #1{\xinttheexpr (#1)^3\relax}|\;,} for example.)
  One will have to do |\myformula {\xinttheexpr 28^7-35^12\relax}|, or redefine 
  |\myformula| to have more parameters.
\end{framed}

% The formula may of course contain besides the infix operators and macro
% parameters some arbitrary decimal numbers, fractions (within braces) and also
% macros. If these macros do not involve the parameters, nothing special needs to
% be done, they will be expanded once during the construction of the formula. But
% if the parameters are to be used within the macros themselves, then the macro
% should be code with an underscore |_| rather than a backslash |\|.

\dverb|&
&\xintNewExpr\myformA[4]{ #1 + #2 * #3^#4 }
&\xintNewExpr\myformB[3]{ (#1 + 1.75)^#2 + #3*2.7 }
&\xintNewExpr\myformC[3]{ #1*#1+#2*#2+#3*#3-(#1*#2+#2*#3+#3*#1) }
&\xintNewExpr\myformD[2]{ (1+1.5*#1)^#2 - (1+1.5*#2)^#1 }
&\xintNewExpr\myformE[2]{ -----((((((#1*10-5*#2)))))) }
&\xintNewExpr\myformF[4]{ -#1^-#2*-#3-#4 }
&\xintNewExpr\myformG[4]{ -#1*-#2^-#3-#4 }
\xintNewExpr\DET[9]{ #1*#5*#9+#2*#6*#7+#3*#4*#8-#1*#6*#8-#2*#4*#9-#3*#5*#7 }
|

% \xintNewExpr\myformA[4]{ #1 + #2 * #3^#4 }
% \xintNewExpr\myformB[3]{ (#1 + 1.75)^#2 + #3*2.7 }
% \xintNewExpr\myformC[3]{ #1*#1+#2*#2+#3*#3-(#1*#2+#2*#3+#3*#1) }
% \xintNewExpr\myformD[2]{ (1+1.5*#1)^#2 - (1+1.5*#2)^#1 }
% \xintNewExpr\myformE[2]{ -----((((((#1*10-5*#2)))))) }
% \xintNewExpr\myformF[4]{ -#1^-#2*-#3-#4 }
% \xintNewExpr\myformG[4]{ -#1*-#2^-#3-#4 }
\xintNewExpr\DET[9]{ #1*#5*#9+#2*#6*#7+#3*#4*#8-#1*#6*#8-#2*#4*#9-#3*#5*#7 }

\ttfamily
% |\meaning\myformA:|\printnumber{\meaning\myformA}\endgraf
% |\meaning\myformB:|\printnumber{\meaning\myformB}\endgraf
% |\meaning\myformC:|\printnumber{\meaning\myformC}\endgraf
% |\meaning\myformD:|\printnumber{\meaning\myformD}\endgraf
% |\meaning\myformE:|\printnumber{\meaning\myformE}\endgraf
% |\meaning\myformF:|\printnumber{\meaning\myformF}\endgraf
% |\meaning\myformG:|\printnumber{\meaning\myformG}\endgraf
|\meaning\DET:|\printnumber{\meaning\DET}\endgraf


\centeredline{|\xintNum{\DET {1}{1}{1}{10}{-10}{5}{11}{-9}{6}}|%
       \digitstt{=\xintNum{\DET {1}{1}{1}{10}{-10}{5}{11}{-9}{6}}}}%
\centeredline{|\xintNum{\DET {1}{2}{3}{10}{0}{-10}{21}{2}{-17}}|%
       \digitstt{=\xintNum{\DET {1}{2}{3}{10}{0}{-10}{21}{2}{-17}}}}


\rmfamily


\emph{Remark:} |\meaning| has been used within the argument to a |\printnumber|
command, to avoid going into the right margin, but this zaps all spaces
originally in the output from |\meaning|. Here is as an illustration the raw
output of 
|\meaning| on the previous example:

\ttfamily
\meaning\DET
\rmfamily

This is why |\printnumber| was used, to have breaks across lines.

\subsubsection {Use of conditional operators}

  The |1.09a| conditional operators |?| and |:| can not be parsed by
  |\xintNewExpr| when they contain macro parameters within their scope, and not
  only numerical data. However using the functions |if| and, respectively
  |ifsgn|, the parsing should succeed. Moreover the created macro will \emph{not
    evaluate the branches to be skipped}, thus behaving exactly like |?| and |:|
  would have in the |\xintexpr|.

\xintNewExpr\Formula [3]{ if((#1>#2) & (#2>#3), 
                          sqrt(#1-#2)*sqrt(#2-#3),  #1^2+#3/#2) }

\centeredline{|\xintNewExpr\Formula [3]|}
\centeredline{|{ if((#1>#2) & (#2>#3),
    sqrt(#1-#2)*sqrt(#2-#3),  #1^2+#3/#2) }|}

\ttfamily
\noindent|\meaning\Formula:|\printnumber{\meaning\Formula}\endgraf 

\rmfamily
This formula (with |\xintifNotZero|) will gobble the false branch. 

Remark: this
|\XINTinFloatSqrt| macro is a non-user package macro used internally within
|\xintexpr|-essions, it produces the result in |A[n]| form rather
than in scientific notation, and for reasons of the inner workings of
|\xintexpr|-essions, this is necessary; of course a hand-made macro  would
have used instead the equivalent |\xintFloatSqrt|.

Another example

\xintNewExpr\myformula[3]{ ifsgn(#1,#2/#3,#2-#3,#2*#3) }
\centeredline{|\xintNewExpr\myformula [3]|}
\centeredline{|{ ifsgn(#1,#2/#3,#2-#3,#2*#3) }|}

\ttfamily
\noindent\printnumber{\meaning\myformula}\endgraf 

\rmfamily
Again,  this macro gobbles the false branches, as would have the operator |:|
inside an |\xintexpr|-ession.



\subsubsection{Use of macros}


For macros\MyMarginNote{Changed in |1.09a|!} to be inserted within such a created \xintname-formula command, there
are two cases:
\begin{itemize}
\item the macro does not involve the numbered parameters in its arguments: it
  may then be left as is, and will be evaluated once during the construction of
  the formula,
\item it does involve at least one of the parameters as argument. Then:
  \begin{enumerate}
  \item the whole thing (macro + argument) should be braced (not necessary if it
    is already included into a braced group),
  \item the macro should be coded with an underscore |_| in place of the
    backslash |\|.
  \item the parameters should be coded with a dollar sign |$1|, |$2|, etc... 
  \end{enumerate}
\end{itemize}

Here is a silly example illustrating the general principle (the macros here have
equivalent functional forms which are more convenient; but some of the more
obscure package macros of \xintname dealing with integers do not have functions
pre-defined to be in correspondance with them):

\dverb|&
\xintNewExpr\myformI[2]{ {_xintRound{$1}{$2}} - {_xintTrunc{$1}{$2}} }
|

\xintNewExpr\myformI[2]{ {_xintRound{$1}{$2}} - {_xintTrunc{$1}{$2}} }
\ttfamily
\noindent|\meaning\myformI:|\printnumber{\meaning\myformI}\endgraf

\rmfamily

\subsection{\csbh{xintnumexpr},
  \csbh{xintthenumexpr}}\label{xintnumexpr}\label{xintthenumexpr}

Equivalent to doing |\xintexpr round(...)\relax|. Thus, only the final result is
rounded to an integer. The rounding is towards $+\infty$ for positive numbers
and towards $-\infty$ for negative ones.

\subsection{\csbh{xintfloatexpr},
  \csbh{xintthefloatexpr}}\label{xintfloatexpr}\label{xintthefloatexpr}

\csb{xintfloatexpr}|...\relax| is exactly like |\xintexpr...\relax| but with the
four binary operations and the power function mapped to \csa{xintFloatAdd},
\csa{xintFloatSub}, \csa{xintFloatMul}, \csa{xintFloatDiv} and
\csa{xintFloatPower}. The precision is from the current setting of
|\xintDigits| (it can not be given as an optional parameter).

Currently, the factorial function hasn't yet a float version; so inside 
|\xintthefloatexpr . . . \relax|, |n!| will be computed exactly. Perhaps this
will 
be improved in a future release. 

\xintDigits:= 9;

Note that |1.000000001| and |(1+1e-9)| will not be equivalent for
|D=\xinttheDigits| set to nine or less. Indeed the addition implicit in |1+1e-9|
(and executed when the closing parenthesis is found) will provoke the rounding
to |1|. Whereas |1.000000001|, when found as operand of one of the four
elementary operations is kept with |D+2| digits, and even more for the power
function. \centeredline{|\xintDigits:= 9; \xintthefloatexpr
  (1+1e-9)-1\relax|\digitstt{=\xintthefloatexpr (1+1e-9)-1\relax}}
\centeredline{|\xintDigits:= 9; \xintthefloatexpr
  1.000000001-1\relax|\digitstt{=\xintthefloatexpr 1.000000001-1\relax}}

For the fun of it:\xintDigits:=20; |\xintDigits:=20;|%
\centeredline{|\xintthefloatexpr (1+1e-7)^1e7\relax|%
       \digitstt{=\xintthefloatexpr (1+1e-7)^1e7\relax}}

|\xintDigits:=36;|\xintDigits:=36;
\centeredline{|\xintthefloatexpr
  ((1/13+1/121)*(1/179-1/173))/(1/19-1/18)\relax|}
\centeredline{\digitstt{\xintthefloatexpr
  ((1/13+1/121)*(1/179-1/173))/(1/19-1/18)\relax}}
\centeredline{|\xintFloat{\xinttheexpr
  ((1/13+1/121)*(1/179-1/173))/(1/19-1/18)\relax}|}
\centeredline{\digitstt{\xintFloat
  {\xinttheexpr((1/13+1/121)*(1/179-1/173))/(1/19-1/18)\relax}}}

\xintDigits := 16; 

The latter result is the rounding of the exact result. The previous one has
rounding errors coming from the various roundings done for each
sub-expression. It was a bit funny  to discover that |maple|, configured with
|Digits:=36;| and with decimal dots everywhere to let it input the numbers as
floats, gives exactly the same result with the same rounding errors
as does |\xintthefloatexpr|!

Note that using |\xintthefloatexpr| only pays off compared to using
|\xinttheexpr| and then |\xintFloat| if the computations turn out to involve
hundreds of digits. For elementary calculations with hand written numbers
(not using the scientific notation with exponents differing greatly) it will
generally be more efficient to use |\xinttheexpr|. The situation is quickly
otherwise if one starts using the Power function. Then, |\xintthefloat| is
often useful; and sometimes indispensable to achieve the (approximate)
computation in reasonable time.

We can try some crazy things:
\centeredline{|\xintDigits:=12;\xintthefloatexpr 1.000000000000001^1e15\relax|}
\centeredline{\xintDigits:=12;%
\digitstt{\xintthefloatexpr 1.000000000000001^1e15\relax}}
Note that contrarily to some professional computing sofware which are our
concurrents on this market, the \digitstt{1.000000000000001} wasn't rounded
to |1| despite the setting of \csa{xintDigits}; it would have been if we had
input it as 
|(1+1e-15)|. 

% \xintDigits:=12;
% \pdfresettimer
% \edef\z{\xintthefloatexpr 1.000000000000001^1e15\relax}%
% \edef\temps{\the\pdfelapsedtime}%
% \xintRound {5}{\temps/65536}s\endgraf


\xintDigits := 16; % mais en fait \centeredline crée un groupe.


\subsection{\csbh{xintNewFloatExpr}}\label{xintNewFloatExpr}

This is exactly like \csb{xintNewExpr} except that the created formulas are
set-up to use |\xintthefloatexpr|. The precision used for numbers fetched as
parameters will be the one
locally given by |\xintDigits| at the time of use of the created formulas,
not |\xintNewFloatExpr|. However, the numbers hard-wired in the original
expression will have been evaluated with the then current setting for
|\xintDigits|. 




\xintDigits:= 16;

\subsection{Technicalities and experimental status}

As already mentioned \csa{xintNewExpr}|\myformula[n]| does not check the prior
existence of a macro |\myformula|. And the number of parameters |n| given as
mandatory argument withing square brackets should of course be (at least) equal
to the number of parameters in the expression.

Obviously I should mention that \csa{xintNewExpr} itself can not be used in an
expansion-only context, as it creates a macro.

The format of the output of |\xintexpr|\meta{stuff}|\relax| is a |!| (with
catcode 11) followed by |\XINT_expr_usethe| which prints an error message in
the document and in the log file if it is executed, then a token doing the
actual printing and finally a token |\.A/B[n]|. Using |\xinttheexpr| means
zapping the first two things, the third one will then recover |A/B[n]| from the
undefined control sequence |\.A/B[n]|.

I decided to put all intermediate results (from each evaluation of an infix
operators, or of a parenthesized subpart of the expression, or from application
of the minus as prefix, or of the exclamation sign as postfix, or any
encountered braced material) inside |\csname...\endcsname|, as this can be done
expandably and encapsulates an arbitrarily long fraction in a single token (left
with undefined meaning), thus providing tremendous relief to the programmer in
his/her expansion control.

\begin{framed}
  This implementation and user interface are still to be considered
  \emph{experimental}.
\end{framed}

Syntax errors in the input like using a one-argument function such as |reduce|
with two will generate low-level \TeX{} processing unrecoverable errors, with
cryptic accompanying message. 

Some other problems will give rise to `error messages' macros giving some
indication on the location and nature of the problem. Mainly, an attempt has
been made to handle gracefully missing or extraneous parentheses.

When the scanner is looking for a number and finds something else not otherwise
treated, it assumes it is the start of the function name and will expand forward
in the hope of hitting an opening parenthesis; if none is found at least it
should stop when encountering the |\relax| marking the end of the expressions.

Note that |\relax| is absolutely mandatory (contrarily to a |\numexpr|).


\subsection{Acknowledgements}

I was greatly helped in my preparatory thinking, prior to producing such an
expandable parser, by the commented source of the
\href{http://www.ctan.org/tex-archive/macros/latex/contrib/l3kernel}{l3fp}
package, specifically the |l3fp-parse.dtx| file. Also the source of the |calc|
package was instructive, despite the fact that here for |\xintexpr| the
principles are necessarily different due to the aim of achieving expandability.

% I apologize for not including
% comments currently in my own code, the reason being that this a time-consuming
% task which should wait until the code has a rather certain more-or-less final
% form.

\section{Commands of the \xintbinhexname package}\label{sec:combinhex} 

\SetInnerTocdepthTo {1}

This package was first included in the |1.08| release of \xintname. It
provides expandable conversions of arbitrarily long numbers
to and from binary and hexadecimal.

The argument is first fully expanded. It then may start with an optional minus
sign (unique, of category code other), followed with optional leading zeros
(arbitrarily many, category code other) and then ``digits'' (hexadecimal
letters may be of category code letter or other, and must be
uppercased). The optional (unique) minus sign (plus sign is not allowed) is
kept in the output. Leading zeros are allowed, and stripped. The
hexadecimal letters on output are of category code letter, and
uppercased.

% \clearpage

\localtableofcontents



\subsection{\csbh{xintDecToHex}}\label{xintDecToHex}

Converts from decimal to hexadecimal.

\texttt{\string\xintDecToHex \string{\printnumber{2718281828459045235360287471352662497757247093699959574966967627724076630353547594571382178525166427427466391932003}\string}}\endgraf\noindent\digitstt{->\printnumber{\xintDecToHex{2718281828459045235360287471352662497757247093699959574966967627724076630353547594571382178525166427427466391932003}}} 

\subsection{\csbh{xintDecToBin}}\label{xintDecToBin}

Converts from decimal to binary.

\texttt{\string\xintDecToBin \string{\printnumber{2718281828459045235360287471352662497757247093699959574966967627724076630353547594571382178525166427427466391932003}\string}}\endgraf\noindent\digitstt{->\printnumber{\xintDecToBin{2718281828459045235360287471352662497757247093699959574966967627724076630353547594571382178525166427427466391932003}}} 

\subsection{\csbh{xintHexToDec}}\label{xintHexToDec}

Converts from hexadecimal to decimal.

\texttt{\string\xintHexToDec
  \string{\printnumber{11A9397C66949A97051F7D0A817914E3E0B17C41B11C48BAEF2B5760BB38D272F46DCE46C6032936BF37DAC918814C63}\string}}\endgraf\noindent
\digitstt{->\printnumber{\xintHexToDec{11A9397C66949A97051F7D0A817914E3E0B17C41B11C48BAEF2B5760BB38D272F46DCE46C6032936BF37DAC918814C63}}}
 
\subsection{\csbh{xintBinToDec}}\label{xintBinToDec}

Converts from binary to decimal.

\texttt{\string\xintBinToDec
  \string{\printnumber{100011010100100111001011111000110011010010100100110101001011100000101000111110111110100001010100000010111100100010100111000111110000010110001011111000100000110110001000111000100100010111010111011110010101101010111011000001011101100111000110100100111001011110100011011011100111001000110110001100000001100101001001101101011111100110111110110101100100100011000100000010100110001100011}\string}}\endgraf\noindent
\digitstt{->\printnumber{\xintBinToDec{100011010100100111001011111000110011010010100100110101001011100000101000111110111110100001010100000010111100100010100111000111110000010110001011111000100000110110001000111000100100010111010111011110010101101010111011000001011101100111000110100100111001011110100011011011100111001000110110001100000001100101001001101101011111100110111110110101100100100011000100000010100110001100011}}}

\subsection{\csbh{xintBinToHex}}\label{xintBinToHex}

Converts from binary to hexadecimal.

\texttt{\string\xintBinToHex
  \string{\printnumber{100011010100100111001011111000110011010010100100110101001011100000101000111110111110100001010100000010111100100010100111000111110000010110001011111000100000110110001000111000100100010111010111011110010101101010111011000001011101100111000110100100111001011110100011011011100111001000110110001100000001100101001001101101011111100110111110110101100100100011000100000010100110001100011}\string}}\endgraf\noindent
\digitstt{->\printnumber{\xintBinToHex{100011010100100111001011111000110011010010100100110101001011100000101000111110111110100001010100000010111100100010100111000111110000010110001011111000100000110110001000111000100100010111010111011110010101101010111011000001011101100111000110100100111001011110100011011011100111001000110110001100000001100101001001101101011111100110111110110101100100100011000100000010100110001100011}}}

\subsection{\csbh{xintHexToBin}}\label{xintHexToBin}

Converts from hexadecimal to binary.

\texttt{\string\xintHexToBin
  \string{\printnumber{11A9397C66949A97051F7D0A817914E3E0B17C41B11C48BAEF2B5760BB38D272F46DCE46C6032936BF37DAC918814C63}\string}}\endgraf\noindent
\digitstt{->\printnumber{\xintHexToBin{11A9397C66949A97051F7D0A817914E3E0B17C41B11C48BAEF2B5760BB38D272F46DCE46C6032936BF37DAC918814C63}}}


\subsection{\csbh{xintCHexToBin}}\label{xintCHexToBin}

Also converts from hexadecimal to binary. Faster on inputs with at least
one hundred hexadecimal digits.

\texttt{\string\xintCHexToBin
  \string{\printnumber{11A9397C66949A97051F7D0A817914E3E0B17C41B11C48BAEF2B5760BB38D272F46DCE46C6032936BF37DAC918814C63}\string}}\endgraf\noindent
\digitstt{->\printnumber{\xintCHexToBin{11A9397C66949A97051F7D0A817914E3E0B17C41B11C48BAEF2B5760BB38D272F46DCE46C6032936BF37DAC918814C63}}}



\section{Commands of the \xintgcdname package}



This package was included in the original release |1.0| of the \xintname bundle.

Since release |1.09a| the macros filter their inputs through the \csb{xintNum}
macro, so one can use count registers, or fractions as long as they reduce to
integers. 


\localtableofcontents

\subsection{\csbh{xintGCD}}\label{xintGCD}

\csa{xintGCD\n\m} computes the greatest common divisor. It is
positive, except when both |N| and |M| vanish, in which case the macro
returns zero.
\centeredline{\csa{xintGCD}|{10000}{1113}|\digitstt{=\xintGCD{10000}{1113}}}
\centeredline{|\xintGCD{123456789012345}{9876543210321}=|\digitstt
              {\xintGCD{123456789012345}{9876543210321}}}

\subsection{\csbh{xintGCDof}}\label{xintGCDof}
{\small New with release |1.09a|.\par}

\subsection{\csbh{xintLCM}}\label{xintLCM}
{\small New with release |1.09a|.\par}

\subsection{\csbh{xintLCMof}}\label{xintLCMof}
{\small New with release |1.09a|.\par}

\subsection{\csbh{xintBezout}}\label{xintBezout}

\xintAssign{{\xintBezout {10000}{1113}}}\to\X
\xintAssign {\xintBezout {10000}{1113}}\to\A\B\U\V\D

\csa{xintBezout\n\m} returns five numbers |A|, |B|, |U|, |V|, |D| within
braces. |A| is the first (expanded, as usual) input number, |B| the
second, |D| is the GCD, and \digitstt{UA - VB = D}. 
\centeredline{|\xintAssign {{\xintBezout {10000}{1113}}}\to\X|}
\centeredline{|\meaning\X: |\digitstt{\meaning\X }.}
\noindent{|\xintAssign {\xintBezout {10000}{1113}}\to\A\B\U\V\D|}\\
|\A: |\digitstt{\A },
|\B: |\digitstt{\B },
|\U: |\digitstt{\U },
|\V: |\digitstt{\V },
|\D: |\digitstt{\D }.\\
\xintAssign {\xintBezout {123456789012345}{9876543210321}}\to\A\B\U\V\D
\noindent{|\xintAssign {\xintBezout {123456789012345}{9876543210321}}\to\A\B\U\V\D
|}\\
|\A: |\digitstt{\A },
|\B: |\digitstt{\B },
|\U: |\digitstt{\U },
|\V: |\digitstt{\V },
|\D: |\digitstt{\D }.


\subsection{\csbh{xintEuclideAlgorithm}}\label{xintEuclideAlgorithm}

\xintAssign {{\xintEuclideAlgorithm {10000}{1113}}}\to\X

\def\restorebracecatcodes
   {\catcode`\{=1 \catcode`\}=2 }

\def\allowlistsplit 
   {\catcode`\{=12 \catcode`\}=12 \allowlistsplita }

\def\allowlistsplitx {\futurelet\listnext\allowlistsplitxx }

\def\allowlistsplitxx {\ifx\listnext\relax \restorebracecatcodes
                        \else \expandafter\allowlistsplitxxx \fi }
\begingroup
\catcode`\[=1
\catcode`\]=2
\catcode`\{=12
\catcode`\}=12
\gdef\allowlistsplita #1{[#1\allowlistsplitx {]
\gdef\allowlistsplitxxx {#1}%
     [{#1}\hskip 0pt plus 1pt \allowlistsplitx ]
\endgroup

\csa{xintEuclideAlgorithm\n\m} applies the Euclide algorithm and
keeps a copy of all quotients and remainders. 
\centeredline{|\xintAssign {{\xintEuclideAlgorithm {10000}{1113}}}\to\X|}

|\meaning\X: |\digitstt{\expandafter\allowlistsplit
               \meaning\X\relax .}

The first token is the number of steps, the second is |N|, the
third is the GCD, the fourth is |M| then the first quotient and
remainder, the second quotient and remainder, \dots until the
final quotient and last (zero) remainder.

\subsection{\csbh{xintBezoutAlgorithm}}\label{xintBezoutAlgorithm}

\catcode`\& 4

\xintAssign {{\xintBezoutAlgorithm {10000}{1113}}}\to\X

\csa{xintBezoutAlgorithm\n\m} applies the Euclide algorithm and
keeps a copy of all quotients and remainders. Furthermore it
computes the entries of the successive products of the 2 by 2 matrices 
$\left(\vcenter{\halign {\,#&\,#\cr q & 1 \cr 1 & 0 \cr}}\right)$
formed from the quotients arising in the algorithm.
\centeredline{|\xintAssign {{\xintEuclideAlgorithm {10000}{1113}}}\to\X|}

|\meaning\X: |\digitstt{\expandafter\allowlistsplit\meaning\X \relax .}

The first token is the number of steps, the second is |N|, then
|0|, |1|, the GCD, |M|, |1|, |0|, the first quotient, the first
remainder, the top left entry of the first matrix, the bottom left
entry, and then these four things at each step until the end.

\catcode`\& 13

\subsection{\csbh{xintTypesetEuclideAlgorithm}\texorpdfstring{\allowbreak\null\hspace*{.25cm}}{}}%
\label{xintTypesetEuclideAlgorithm}

This macro is just an example of how to organize the data returned
by \csa{xintEuclideAlgorithm}. Copy the source code to a new macro
and modify it to what is needed.
\centeredline{|\xintTypesetEuclideAlgorithm
  {123456789012345}{9876543210321}|} \xintTypesetEuclideAlgorithm
{123456789012345}{9876543210321}


\subsection{\csbh{xintTypesetBezoutAlgorithm}}%
\label{xintTypesetBezoutAlgorithm}

This macro is just an example of how to organize the data returned
by \csa{xintBezoutAlgorithm}. Copy the source code to a new macro
and modify it to what is needed.
\centeredline{|\xintTypesetBezoutAlgorithm {10000}{1113}|}
\xintTypesetBezoutAlgorithm {10000}{1113}


\section{Commands of the \xintseriesname package}\label{sec:series}

Some arguments to the package commands are macros which are expanded only later,
when given their parameters. The arguments serving as indices are systematically
given to a |\numexpr| expressions (new with |1.06|!) , hence fully expanded,
they may be count registers, etc...

This package was
first released with version |1.03| of the \xintname bundle.

% \clearpage

\localtableofcontents

\subsection{\csbh{xintSeries}}\label{xintSeries}

\def\coeff #1{\xintiMON{#1}/#1.5} % (-1)^n/(n+1/2)
\edef\w {\xintSeries {0}{50}{\coeff}}
\edef\z {\xintJrr {\w}[0]}

\csa{xintSeries}|{A}{B}{\coeff}| computes
$\sum_{\text{|n=A|}}^{\text{|n=B|}}|\coeff{n}|$. The initial and final indices
must obey the |\numexpr| constraint of expanding to numbers at most |2^31-1|.
The |\coeff| macro must be a
one-parameter fully expandable command, taking on input an explicit number |n|
and producing some fraction |\coeff{n}|; it is expanded at the time it is
needed. 
\dverb|& 
\def\coeff #1{\xintiMON{#1}/#1.5} % (-1)^n/(n+1/2)
\edef\w {\xintSeries {0}{50}{\coeff}} % we want to re-use it
\edef\z {\xintJrr {\w}[0]} % the [0] for a microsecond gain.
% \xintJrr preferred to \xintIrr: a big common factor is suspected.
% But numbers much bigger would be needed to show the greater efficiency.
\[ \sum_{n=0}^{n=50} \frac{(-1)^n}{n+\frac12} = \xintFrac\z \]
|
\[ \sum_{n=0}^{n=50} \frac{(-1)^n}{n+\frac12} = \xintFrac\z \] For info,
before action by |\xintJrr| the inner representation of the result has a
denominator of |\xintLen {\xintDenominator\w}=|\xintLen
{\xintDenominator\w} digits. This troubled me as &101!!& has only 81
digits: |\xintLen {\xintQuo {\xintFac {101}}{\xintiMul {\xintiPow
      {2}{50}}{\xintFac{50}}}}|\digitstt{=\xintLen {\xintQuo {\xintFac
      {101}}{\xintiMul {\xintiPow {2}{50}}{\xintFac{50}}}}}. The
explanation lies in the too clever to be efficient |#1.5| trick. It
leads to a silly extra &5^{51}& (which has \xintLen {\xintPow {5}{51}}
digits) in the denominator. See the explanations in the next section.

\begin{framed}
  Note: as soon as the coefficients look like factorials, it is more
  efficient to use the \csb{xintRationalSeries} macro whose evaluation
  will avoid a denominator build-up; indeed the raw operations of
  addition and subtraction of fractions blindly multiply out
  denominators. So the raw evaluation of $\sum_{n=0}^{|N|}1/n!$ with
  \csa{xintSeries} will have a denominator equal to $\prod_{n=0}^{|N|}
  n!$. Needless to say this makes it more difficult to compute the exact
  value of this sum with |N=50|, for example, whereas with
  \csb{xintRationalSeries} the denominator does not
  get bigger than $50!$.

\footnotesize
  For info: by the way $\prod_{n=0}^{50} n!$ is easily computed by \xintname
  and is a number with 1394 digits. And $\prod_{n=0}^{100} n!$ is also
  computable by \xintname (24 seconds on my laptop for the brute force
  iterated multiplication of all factorials, a
  specialized routine would do it faster) and has 6941 digits (this
  means more than two pages if printed...). Whereas $100!$ only has
  158 digits.
\end{framed}

% \newcount\cntb
% \cnta 2
% \loop
% \advance\cntb by \xintLen{\xintFac{\the\cnta}}%
% \ifnum\cnta < 50
% \advance\cnta 1
% \repeat
% \the\cntb

% \cnta 2
% \def\z{1}
% \pdfresettimer
% \loop
% \edef\z {\xintiMul\z{\xintFac{\the\cnta}}}%
% \ifnum\cnta < 100
% \advance\cnta 1
% \repeat
% \edef\temps{\the\pdfelapsedtime}%

% \temps: \xintQuo\temps{\xintiMul{60}{65536}} minutes, 
% \xintQuo{\xintRem\temps{\xintiMul{60}{65536}}}{65536} secondes et 
% \xintiTrunc {2}{\xintRem\temps{65536}/65536} centièmes de secondes
% 1573518: 0 minutes, 24 secondes et 0 centièmes de secondes
% nota bene, marrant c'était 0,99 centièmes en fait.

% \xintLen\z

% \printnumber\z

\setlength{\columnsep}{0pt}
\dverb|&
\def\coeffleibnitz #1{\the\numexpr\ifodd #1 1\else-1\fi\relax/#1[0]}
\cnta 1
\loop  % in this loop we recompute from scratch each partial sum! 
% we can afford that, as \xintSeries is fast enough.
\noindent\hbox to 2em{\hfil\texttt{\the\cnta.} }%  
         \xintTrunc {12}
                    {\xintSeries {1}{\cnta}{\coeffleibnitz}}\dots
\endgraf
\ifnum\cnta < 30 \advance\cnta 1 \repeat
|
\begin{multicols}{3}
  \def\coeffleibnitz #1{\the\numexpr\ifodd #1 1\else-1\fi\relax/#1[0]} \cnta 1
  \loop
  \noindent\hbox to 2em{\hfil\digitstt{\the\cnta.} }% 
  \xintTrunc {12}{\xintSeries {1}{\cnta}{\coeffleibnitz}}\dots
    \endgraf
    \ifnum\cnta < 30 \advance\cnta 1 \repeat
\end{multicols}

\subsection{\csbh{xintiSeries}}\label{xintiSeries}

\def\coeff #1{\xintiTrunc {40}
   {\the\numexpr\ifodd #1 -2\else2\fi\relax/\the\numexpr 2*#1+1\relax [0]}}% 

 \csa{xintiSeries}|{A}{B}{\coeff}| computes
 $\sum_{\text{|n=A|}}^{\text{|n=B|}}|\coeff{n}|$ where now |\coeff{n}|
 \emph{must} expand to a (possibly long) integer, as is acceptable on input by
 the 
 integer-only \csa{xintiAdd}.
\dverb|&
\def\coeff #1{\xintiTrunc {40}{\xintMON{#1}/#1.5}}%
% better:
\def\coeff #1{\xintiTrunc {40}
   {\the\numexpr 2*\xintiMON{#1}\relax/\the\numexpr 2*#1+1\relax [0]}}% 
% better still:
\def\coeff #1{\xintiTrunc {40}
 {\the\numexpr\ifodd #1 -2\else2\fi\relax/\the\numexpr 2*#1+1\relax [0]}}% 
% (-1)^n/(n+1/2) times 10^40, truncated to an integer.
\[ \sum_{n=0}^{n=50} \frac{(-1)^n}{n+\frac12} \approx
        \xintTrunc {40}{\xintiSeries {0}{50}{\coeff}[-40]}\dots\]
|
The |#1.5| trick to define the |\coeff| macro was neat, but |1/3.5|, for
example, turns internally into |10/35| whereas it would be more efficient to
have |2/7|. The second way of coding the wanted coefficient avoids a superfluous
factor of five and leads to a faster evaluation. The third way is faster, after
all there is no need to use \csb{xintMON} (or rather \csb{xintiMON} which has
less parsing overhead) on integers
obeying the \TeX{} bound. The denominator having no sign, we have added the
|[0]| as this speeds up (infinitesimally) the parsing.
\[ \sum_{n=0}^{n=50} \frac{(-1)^n}{n+\frac12} \approx \xintTrunc
{40}{\xintiSeries {0}{50}{\coeff}[-40]}\] We should have cut out at
least the last two digits: truncating errors originating with the first
coefficients of the sum will never go away, and each truncation
introduces an uncertainty in the last digit, so as we have 40 terms, we
should trash the last two digits, or at least round at 38 digits. It is
interesting to compare with the computation where rounding rather than
truncation is used, and with the decimal
expansion of the exactly computed partial sum of the series:
\dverb|&
\def\coeff #1{\xintiRound {40} % rounding at 40
  {\the\numexpr\ifodd #1 -2\else2\fi\relax/\the\numexpr 2*#1+1\relax [0]}}% 
% (-1)^n/(n+1/2) times 10^40, rounded to an integer.
\[ \sum_{n=0}^{n=50} \frac{(-1)^n}{n+\frac12} \approx
        \xintTrunc {40}{\xintiSeries {0}{50}{\coeff}[-40]}\]
\def\exactcoeff #1%
  {\the\numexpr\ifodd #1 -2\else2\fi\relax/\the\numexpr 2*#1+1\relax [0]}%
\[ \sum_{n=0}^{n=50} \frac{(-1)^n}{n+\frac12} 
   = \xintTrunc {50}{\xintSeries {0}{50}{\exactcoeff}}\dots\]
|
\def\coeff #1{\xintiRound {40}
   {\the\numexpr\ifodd #1 -2\else2\fi\relax/\the\numexpr 2*#1+1\relax [0]}}% 
% (-1)^n/(n+1/2) times 10^40, rounded to an integer.
\[ \sum_{n=0}^{n=50} \frac{(-1)^n}{n+\frac12} \approx
        \xintTrunc {40}{\xintiSeries {0}{50}{\coeff}[-40]}\]
\def\exactcoeff #1%
  {\the\numexpr\ifodd #1 -2\else2\fi\relax/\the\numexpr 2*#1+1\relax [0]}%
\[ \sum_{n=0}^{n=50} \frac{(-1)^n}{n+\frac12} 
   = \xintTrunc {50}{\xintSeries {0}{50}{\exactcoeff}}\dots\]
This shows indeed that our sum of truncated terms
estimated wrongly the 39th and 40th digits of the exact result\footnote{as
  the series 
  is alternating, we can roughly expect an error of $\sqrt{40}$ and the
  last two digits are off by 4 units, which is not contradictory to our
  expectations.} and that the sum of rounded terms fared a bit better. 

\subsection{\csbh{xintRationalSeries}}\label{xintRationalSeries}

{\small \hspace*{\parindent}New with release |1.04|.\par}

\noindent \csa{xintRationalSeries}|{A}{B}{f}{\ratio}| evaluates
$\sum_{\text{|n=A|}}^{\text{|n=B|}}|F(n)|$, where |F(n)| is specified indirectly
via the data of |f=F(A)| and the one-parameter macro |\ratio| which must be such
that |\macro{n}| expands to |F(n)/F(n-1)|. The name indicates that
\csa{xintRationalSeries} was designed to be useful in the cases where
|F(n)/F(n-1)| is a rational function of |n| but it may be anything expanding to
a fraction. The macro |\ratio| must be an expandable-only compatible command and
expand to its value after iterated full expansion of its first token. |A| and
|B| are fed to a |\numexpr| hence may be count registers or arithmetic
expressions built with such; they must obey the \TeX{} bound. The initial term
|f| may be a macro |\f|, it will be expanded to its value representing |F(A)|.

\dverb|& 
\def\ratio #1{2/#1[0]}% 2/n, to compute exp(2)
\cnta 0 % previously declared count
\loop \edef\z {\xintRationalSeries {0}{\cnta}{1}{\ratio }}%
\noindent$\sum_{n=0}^{\the\cnta} \frac{2^n}{n!}= 
           \xintTrunc{12}\z\dots=
           \xintFrac\z=\xintFrac{\xintIrr\z}$\vtop to 5pt{}\endgraf
\ifnum\cnta<20 \advance\cnta 1 \repeat
|
\def\ratio #1{2/#1[0]}% 2/n, comes from the series of exp(2)
\cnta 0
\loop
\edef\z {\xintRationalSeries {0}{\cnta}{1}{\ratio }}%
\noindent$\sum_{n=0}^{\the\cnta} \frac{2^n}{n!}= 
           \xintTrunc{12}\z\dots=
           \xintFrac\z=\xintFrac{\xintIrr\z}$\vtop to 5pt{}\endgraf
\ifnum\cnta<20 \advance\cnta 1 \repeat

\medskip
Such computations would become quickly completely inaccessible via the
\csb{xintSeries} macros, as the factorials in the denominators would get
all multiplied together: the raw addition and subtraction on fractions
just blindly multiplies denominators! Whereas \csa{xintRationalSeries}
evaluate the partial sums via a less silly iterative scheme. 
\dverb|&
\def\ratio #1{-1/#1[0]}% -1/n, comes from the series of exp(-1)
\cnta 0 % previously declared count
\loop   
\edef\z {\xintRationalSeries {0}{\cnta}{1}{\ratio }}% 
\noindent$\sum_{n=0}^{\the\cnta} \frac{(-1)^n}{n!}= 
           \xintTrunc{20}\z\dots=\xintFrac{\z}=\xintFrac{\xintIrr\z}$
         \vtop to 5pt{}\endgraf
\ifnum\cnta<20 \advance\cnta 1 \repeat
|
\def\ratio #1{-1/#1[0]}% -1/n, comes from the series of exp(-1)
\cnta 0 % previously declared count

\loop   
\edef\z {\xintRationalSeries {0}{\cnta}{1}{\ratio }}% 
\noindent$\sum_{n=0}^{\the\cnta} \frac{(-1)^n}{n!}= 
           \xintTrunc{20}\z\dots=\xintFrac{\z}=\xintFrac{\xintIrr\z}$
         \vtop to 5pt{}\endgraf
\ifnum\cnta<20 \advance\cnta 1 \repeat


 \def\ratioexp #1#2{\xintDiv{#1}{#2}}% #1/#2

\medskip We can incorporate an indeterminate if we define |\ratio| to be
a macro with two parameters: |\def\ratioexp
  #1#2{\xintDiv{#1}{#2}}|\texttt{\%}| x/n: x=#1, n=#2|.
Then, if |\x| expands to some fraction |x|, the
command \centeredline{|\xintRationalSeries {0}{b}{1}{\ratioexp{\x}}|}
will compute $\sum_{n=0}^{n=b} x^n/n!$:\par
\dverb|&
\cnta 0
\def\ratioexp #1#2{\xintDiv{#1}{#2}}% #1/#2
\loop
\noindent
$\sum_{n=0}^{\the\cnta} (.57)^n/n! = \xintTrunc {50}
     {\xintRationalSeries {0}{\cnta}{1}{\ratioexp{.57}}}\dots$
     \vtop to 5pt {}\endgraf
\ifnum\cnta<50 \advance\cnta 10 \repeat
|

\cnta 0
\loop
\noindent
$\sum_{n=0}^{\the\cnta} (.57)^n/n! = \xintTrunc {50}
     {\xintRationalSeries {0}{\cnta}{1}{\ratioexp{.57}}}\dots$
     \vtop to 5pt {}\endgraf
\ifnum\cnta<50 \advance\cnta 10 \repeat
Observe that in this last example the |x| was directly inserted; if it
had been a more complicated explicit fraction it would have been
worthwile to use |\ratioexp\x| with |\x| defined to expand to its value.
In the further situation where this fraction |x| is not explicit but
itself defined via a complicated, and time-costly, formula, it should be
noted that \csa{xintRationalSeries} will do again the evaluation of |\x|
for each term of the partial sum. The easiest is thus when |x| can be
defined as an |\edef|. If however, you are in an expandable-only context
and cannot store in a macro like |\x| the value to be used, a variant of
\csa{xintRationalSeries} is needed which will first evaluate this |\x| and then
use this result without recomputing it. This is \csb{xintRationalSeriesX},
documented next.

Here is a slightly more complicated evaluation:
\dverb|&
\cnta 1
\loop \edef\z {\xintRationalSeries 
                   {\cnta}
                   {2*\cnta-1} 
                   {\xintiPow {\the\cnta}{\cnta}/\xintFac{\cnta}}
                   {\ratioexp{\the\cnta}}}%
\edef\w {\xintRationalSeries {0}{2*\cnta-1}{1}{\ratioexp{\the\cnta}}}%
\noindent
$\sum_{n=\the\cnta}^{\the\numexpr 2*\cnta-1\relax} \frac{\the\cnta^n}{n!}/%
          \sum_{n=0}^{\the\numexpr 2*\cnta-1\relax} \frac{\the\cnta^n}{n!} =
          \xintTrunc{8}{\xintDiv\z\w}\dots$ \vtop to 5pt{}\endgraf
\ifnum\cnta<20 \advance\cnta 1 \repeat
|
\cnta 1
\begin{multicols}{2}
\loop \edef\z {\xintRationalSeries 
                   {\cnta}
                   {2*\cnta-1} 
                   {\xintiPow {\the\cnta}{\cnta}/\xintFac{\cnta}}
                   {\ratioexp{\the\cnta}}}%
\edef\w {\xintRationalSeries {0}{2*\cnta-1}{1}{\ratioexp{\the\cnta}}}%
\noindent$\sum_{n=\the\cnta}^{\the\numexpr 2*\cnta-1\relax} \frac{\the\cnta^n}{n!}/%
          \sum_{n=0}^{\the\numexpr 2*\cnta-1\relax} \frac{\the\cnta^n}{n!} =
          \xintTrunc{8}{\xintDiv\z\w}\dots$ \vtop to 5pt{}\endgraf
\ifnum\cnta<20 \advance\cnta 1 \repeat
\end{multicols}

\subsection{\csbh{xintRationalSeriesX}}\label{xintRationalSeriesX}

{\small \hspace*{\parindent}New with release |1.04|.\par}

\noindent\csa{xintRationalSeriesX}|{A}{B}{\first}{\ratio}{\g}| is a parametrized
version of \csa{xintRationalSeries} where |\first| is turned into a one
parameter macro with |\first{\g}| giving |F(A,\g)| and |\ratio| is a two
parameters macro such that |\ratio{n}{\g}| gives |F(n,\g)/F(n-1,\g)|. The
parameter |\g| is evaluated only once at the beginning of the computation, and
can thus itself be the yet unevaluated result of a previous computation.

Let |\ratio| be such a two-parameters macro; note the subtle differences
between\centeredline{|\xintRationalSeries {A}{B}{\first}{\ratio{\g}}|}
\centeredline{and |\xintRationalSeriesX {A}{B}{\first}{\ratio}{\g}|.} First the
location of braces differ... then, in the former case |\first| is a
\emph{no-parameter} macro expanding to a fractional number, and in the latter,
it is a 
\emph{one-parameter} macro which will use |\g|. Furthermore the |X| variant
will expand |\g| at the very beginning whereas the former non-|X| former variant
will evaluate it each time it needs it (which is bad if this
evaluation is time-costly, but good if |\g| is a big explicit fraction
encapsulated in a macro).


The example will use the macro \csb{xintPowerSeries} which computes
efficiently exact partial sums of power series, and is discussed in the
next section.
\dverb|&
\def\firstterm #1{1[0]}% first term of the exponential series
% although it is the constant 1, here it must be defined as a
% one-parameter macro. Next comes the ratio function for exp:
\def\ratioexp  #1#2{\xintDiv {#1}{#2}}% x/n
% These are the (-1)^{n-1}/n of the log(1+h) series:
\def\coefflog #1{\the\numexpr\ifodd #1 1\else-1\fi\relax/#1[0]}% 
% Let L(h) be the first 10 terms of the log(1+h) series and
% let E(t) be the first 10 terms of the exp(t) series.
% The following computes E(L(a/10)) for a=1,...,12.
\cnta 0
\loop
\noindent\xintTrunc {18}{%
     \xintRationalSeriesX {0}{9}{\firstterm}{\ratioexp}
         {\xintPowerSeries{1}{10}{\coefflog}{\the\cnta[-1]}}}\dots 
\endgraf
\ifnum\cnta < 12 \advance \cnta 1 \repeat
|

\def\firstterm #1{1[0]}% first term of the exponential series
% although it is the constant 1, here it must be defined as a
% one-parameter macro. Next comes the ratio function for exp:
\def\ratioexp  #1#2{\xintDiv {#1}{#2}}% x/n
% These are the (-1)^{n-1}/n of the log(1+h) series
\def\coefflog #1{\the\numexpr\ifodd #1 1\else-1\fi\relax/#1[0]}% 
% Let L(h) be the first 10 terms of the log(1+h) series and
% let E(t) be the first 10 terms of the exp(t) series.
% The following computes E(L(a/12)) for a=1,..., 12.
\begin{multicols}{3}\raggedcolumns
  \cnta 1
  \loop
  \noindent\xintTrunc {18}{%
            \xintRationalSeriesX {0}{9}{\firstterm}{\ratioexp}
    {\xintPowerSeries{1}{10}{\coefflog}{\the\cnta[-1]}}}\dots
  \endgraf
  \ifnum\cnta < 12 \advance \cnta 1 \repeat
\end{multicols}
  % to see how they look like...
  % \loop
  % \noindent\printnumber{%
  %   \xintRationalSeriesX {0}{9}{\firstterm}{\ratioexp}
  %   {\xintPowerSeries{1}{10}{\coefflog}{\the\cnta[-2]}}}\dots
  % \endgraf
  % \ifnum\cnta < 60 \advance \cnta 1 \repeat

These completely exact operations rapidly create numbers with many digits. Let
us print in full the raw fractions created by the operation illustrated above:

\edef\z{\xintRationalSeriesX {0}{9}{\firstterm}
{\ratioexp}{\xintPowerSeries{1}{10}{\coefflog}{1[-1]}}}

|E(L(1[-1]))=|\digitstt{\printnumber{\z}} (length of numerator:
\xintLen {\xintNumerator \z})

\edef\z{\xintRationalSeriesX {0}{9}{\firstterm}
{\ratioexp}{\xintPowerSeries{1}{10}{\coefflog}{12[-2]}}}

|E(L(12[-2]))=|\digitstt{\printnumber{\z}} (length of numerator:
\xintLen {\xintNumerator \z})

\edef\z{\xintRationalSeriesX {0}{9}{\firstterm}
{\ratioexp}{\xintPowerSeries{1}{10}{\coefflog}{123[-3]}}}

|E(L(123[-3]))=|\digitstt{\printnumber{\z}} (length of numerator:
\xintLen {\xintNumerator \z})


We see that the denominators here remain the same, as our input only had various
powers of ten as denominators, and \xintfracname efficiently assemble (some
only, as we can see) powers of ten. Notice that 1 more digit in an input
denominator seems to mean 90 more in the raw output. We can check that with some
other test cases:


\edef\z{\xintRationalSeriesX {0}{9}{\firstterm}
{\ratioexp}{\xintPowerSeries{1}{10}{\coefflog}{1/7}}}

|E(L(1/7))=|\digitstt{\printnumber{\z}} (length of numerator:
\xintLen {\xintNumerator \z}; length of denominator:
\xintLen {\xintDenominator \z})

\edef\z{\xintRationalSeriesX {0}{9}{\firstterm}
{\ratioexp}{\xintPowerSeries{1}{10}{\coefflog}{1/71}}}

|E(L(1/71))=|\digitstt{\printnumber{\z}} (length of numerator:
\xintLen {\xintNumerator \z}; length of denominator:
\xintLen {\xintDenominator \z})


\edef\z{\xintRationalSeriesX {0}{9}{\firstterm}
{\ratioexp}{\xintPowerSeries{1}{10}{\coefflog}{1/712}}}

|E(L(1/712))=|\digitstt{\printnumber{\z}} (length of numerator:
\xintLen {\xintNumerator \z}; length of denominator:
\xintLen {\xintDenominator \z})

% \pdfresettimer
% \edef\w{\xintDenominator{\xintIrr{\z}}}
% \the\pdfelapsedtime

For info the last fraction put into irreducible form still has 288 digits in its
denominator.\footnote{putting this fraction in irreducible form takes more time
  than is typical of the other computations in this document; so exceptionally I
  have hard-coded the 288 in the document source.} Thus
decimal numbers such as |0.123| (equivalently 
|123[-3]|) give less computing intensive tasks than fractions such as |1/712|:
in the case of decimal numbers the (raw) denominators originate in the
coefficients of the series themselves, powers of ten of the input within
brackets being treated separately. And even then the
numerators will grow with the size of the input in a sort of linear way, the
coefficient being given by the order of series: here 10 from the log and 9 from
the exp, so 90. One more digit in the input means 90 more digits in the
numerator of the output: obviously we can not go on composing such partial sums
of series and hope that \xintname will joyfully do all at the speed of light!
Briefly said, imagine that the rules of the game make the programmer like a
security guard at an airport scanning machine: a never-ending flux of passengers
keep on arriving and all you can do is re-shuffle the first nine of them,
organize marriages among some, execute some, move children farther back among
the first nine only. If a passenger comes along with many hand luggages, this
will slow down the process even if you move him to ninth position, because
sooner or later you will have to digest him, and the children will be big too.
There is no way to move some guy out of the file and to a discrete interrogatory
room for separate treatment or to give him/her some badge saying ``I left my
stuff in storage box 357''.

Hence, truncating the output (or better, rounding) is the only way to go if one
needs a general calculus of special functions. This is why the package
\xintseriesname provides, besides \csb{xintSeries}, \csb{xintRationalSeries}, or
\csb{xintPowerSeries} which compute \emph{exact} sums, also has
\csb{xintFxPtPowerSeries} for fixed-point computations.

Update: release |1.08a| of \xintseriesname now includes a tentative naive 
\csb{xintFloatPowerSeries}.

\subsection{\csbh{xintPowerSeries}}\label{xintPowerSeries}

\csa{xintPowerSeries}|{A}{B}{\coeff}{f}| evaluates the sum 
$\sum_{\text{|n=A|}}^{\text{|n=B|}}|\coeff{n}|\cdot |f|^{\text{|n|}}$. The
initial and final indices are given to a |\numexpr| expression. The |\coeff|
macro (which, as argument to \csa{xintPowerSeries} is expanded only at the time
|\coeff{n}| is needed) should be defined as a one-parameter expandable command,
its input will be an explicit number.

The |f| can be either a fraction directly input or a macro |\f| expanding to
such a fraction. It is actually more efficient to encapsulate an explicit
fraction |f| in such a macro, if it has big numerators and denominators (`big'
means hundreds of digits) as it will then take less space in the processing
until being (repeatedly) used.

This macro computes the \emph{exact} result (one can use it also for polynomial
evaluation). Starting with release |1.04| a Horner scheme for polynomial
evaluation is used, which has the advantage to avoid a denominator build-up
which was plaguing the |1.03| version. \footnote{with powers |f\string^k|, from
  |k=0| to |N|, a denominator |d| of |f| became
  |d\string^\string{1+2+\dots+N\string}|, which is bad. With the |1.04| method,
  the part of the denominator originating from |f| does not accumulate to more
  than |d\string^N|. }

\begin{framed}
  Note: as soon as the coefficients look like factorials, it is more efficient
  to use the \csb{xintRationalSeries} macro whose evaluation, also based on a
  similar Horner scheme, will avoid a denominator build-up originating in the
  coefficients themselves.
\end{framed}

\dverb|&
\def\geom #1{1[0]} % the geometric series
\def\f {5/17[0]}   
\[ \sum_{n=0}^{n=20} \Bigl(\frac 5{17}\Bigr)^n 
 =\xintFrac{\xintIrr{\xintPowerSeries {0}{20}{\geom}{\f}}}
 =\xintFrac{\xinttheexpr (17^21-5^21)/12/17^20\relax}\]
|
\def\geom #1{1[0]} % the geometric series
\def\f {5/17[0]}   %  
\[ \sum_{n=0}^{n=20} \Bigl(\frac 5{17}\Bigr)^n 
 =\xintFrac{\xintIrr{\xintPowerSeries {0}{20}{\geom}{\f}}}
 =\xintFrac{\xinttheexpr (17^21-5^21)/12/17^20\relax}\]

\dverb|&
\def\coefflog #1{1/#1[0]}% 1/n
\def\f {1/2[0]}%
\[ \log 2 \approx \sum_{n=1}^{20} \frac1{n\cdot 2^n} 
    = \xintFrac {\xintIrr {\xintPowerSeries {1}{20}{\coefflog}{\f}}}\]
\[ \log 2 \approx \sum_{n=1}^{50} \frac1{n\cdot 2^n} 
    = \xintFrac {\xintIrr {\xintPowerSeries {1}{50}{\coefflog}{\f}}}\]
|
\def\coefflog #1{1/#1[0]} % 1/n
\def\f {1/2[0]}%
\[ \log 2 \approx \sum_{n=1}^{20} \frac1{n\cdot 2^n} 
         = \xintFrac {\xintIrr {\xintPowerSeries
             {1}{20}{\coefflog}{\f}}}\]
\[ \log 2 \approx \sum_{n=1}^{50} \frac1{n\cdot 2^n} 
    = \xintFrac {\xintIrr {\xintPowerSeries {1}{50}{\coefflog}{\f}}}\]
\dverb|&
\cnta 1 % previously declared count
\loop   % in this loop we recompute from scratch each partial sum! 
% we can afford that, as \xintPowerSeries is fast enough.
\noindent\hbox to 2em{\hfil\texttt{\the\cnta.} }% 
         \xintTrunc {12}
             {\xintPowerSeries {1}{\cnta}{\coefflog}{\f}}\dots
\endgraf
\ifnum \cnta < 30 \advance\cnta 1 \repeat
|
\setlength{\columnsep}{0pt}
\begin{multicols}{3}
      \cnta 1 % previously declared count
      \loop % in this loop we recompute from scratch each partial sum!
% we can afford that, as \xintPowerSeries is fast enough.
\noindent\hbox to 2em{\hfil\texttt{\the\cnta.} }% 
         \xintTrunc {12}{\xintPowerSeries {1}{\cnta}{\coefflog}{\f}}\dots
\endgraf
\ifnum \cnta < 30 \advance\cnta 1 \repeat
\end{multicols}
\dverb|&
%\def\coeffarctg #1{1/\the\numexpr\xintMON{#1}*(2*#1+1)\relax }% 
\def\coeffarctg  #1{1/\the\numexpr\ifodd #1 -2*#1-1\else2*#1+1\fi\relax }% 
% the above gives (-1)^n/(2n+1). The sign being in the denominator, 
%             **** no [0] should be added ****, 
% else nothing is guaranteed to work (even if it could by sheer luck)
% NOTE in passing this aspect of \numexpr: 
%         ****  \numexpr -(1)\relax does not work!!! ****
\def\f {1/25[0]}% 1/5^2
\[\mathrm{Arctg}(\frac15)\approx
            \frac15\sum_{n=0}^{15} \frac{(-1)^n}{(2n+1)25^n} 
= \xintFrac{\xintIrr {\xintDiv 
            {\xintPowerSeries {0}{15}{\coeffarctg}{\f}}{5}}}\]
|
\def\coeffarctg #1{1/\the\numexpr\ifodd #1 -2*#1-1\else2*#1+1\fi\relax }% 
\def\f {1/25[0]}% 1/5^2
\[\mathrm{Arctg}(\frac15)\approx
            \frac15\sum_{n=0}^{15} \frac{(-1)^n}{(2n+1)25^n} 
= \xintFrac{\xintIrr {\xintDiv 
            {\xintPowerSeries {0}{15}{\coeffarctg}{\f}}{5}}}\]

\subsection{\csbh{xintPowerSeriesX}}\label{xintPowerSeriesX}

{\small\hspace*{\parindent}New with release |1.04|.\par}

\noindent This is the same as \csb{xintPowerSeries} apart from the fact that the
last 
parameter |f| is expanded once and for all before being then used repeatedly. If
the |f| parameter is to be an explicit big fraction with many (dozens) digits,
rather than using it directly it is slightly better to have some macro 
|\g| defined to expand to the explicit fraction and then use
\csb{xintPowerSeries} with |\g|; 
but if |f| has not yet been evaluated and will be the output of a complicated
expansion of some |\f|, and if, due to an expanding only context, doing
|\edef\g{\f}| is no option, then \csa{xintPowerSeriesX} should be used with |\f|
as last parameter. 
\dverb|& 
\def\ratioexp #1#2{\xintDiv {#1}{#2}}% x/n
% These are the (-1)^{n-1}/n of the log(1+h) series:
\def\coefflog #1{\the\numexpr\ifodd #1 1\else-1\fi\relax/#1[0]}% 
% Let L(h) be the first 10 terms of the log(1+h) series and
% let E(t) be the first 10 terms of the exp(t) series.
% The following computes L(E(a/10)-1) for a=1,..., 12.
\cnta 1
\loop
\noindent\xintTrunc {18}{%
   \xintPowerSeriesX {1}{10}{\coefflog}
  {\xintSub
      {\xintRationalSeries {0}{9}{1[0]}{\ratioexp{\the\cnta[-1]}}}
      {1}}}\dots
\endgraf
\ifnum\cnta < 12 \advance \cnta 1 \repeat
|
\cnta 0
\def\ratioexp  #1#2{\xintDiv {#1}{#2}}% x/n
% These are the (-1)^{n-1}/n of the log(1+h) series
\def\coefflog #1{\the\numexpr\ifodd #1 1\else-1\fi\relax/#1[0]}% 
% Let L(h) be the first 10 terms of the log(1+h) series and
% let E(t) be the first 10 terms of the exp(t) series.
% The following computes L(E(a/10)-1) for a=1,..., 12.
\begin{multicols}{3}\raggedcolumns
\cnta 1
  \loop
  \noindent\xintTrunc {18}{%
     \xintPowerSeriesX {1}{10}{\coefflog}
    {\xintSub
        {\xintRationalSeries {0}{9}{1[0]}{\ratioexp{\the\cnta[-1]}}}
        {1}}}\dots
  \endgraf
  \ifnum\cnta < 12 \advance \cnta 1 \repeat
\end{multicols}


\subsection{\csbh{xintFxPtPowerSeries}}\label{xintFxPtPowerSeries}

\csa{xintFxPtPowerSeries}|{A}{B}{\coeff}{f}{D}| computes
$\sum_{\text{|n=A|}}^{\text{|n=B|}}|\coeff{n}|\cdot |f|^{\,\text{|n|}}$ with each
    term of the series truncated to |D| digits after the decimal point. As
    usual, |A| and |B| are completely expanded through their inclusion in a
    |\numexpr| expression. Regarding |D| it will be similarly be expanded each
    time it is used inside an \csa{xintTrunc}. The one-parameter macro |\coeff|
    is similarly  expanded at the time it is used inside the
    computations. Idem for |f|. If |f| itself is some complicated macro it is
    thus better to use the variant \csb{xintFxPtPowerSeriesX} which expands it
    first and then uses the result of that expansion.

The current (|1.04|) implementation is: the first power |f^A| is
computed exactly, then \emph{truncated}. Then each successive power is
obtained from the previous one by multiplication by the exact value of
|f|, and truncated. And |\coeff{n}|\raisebox{.5ex}{|.|}|f^n| is obtained
from that by multiplying by |\coeff{n}| (untruncated) and then
truncating. Finally the sum is computed exactly. Apart from that
\csa{xintFxPtPowerSeries} (where |FxPt| means `fixed-point') is like
\csa{xintPowerSeries}.

There should be a variant for things of the type $\sum c_n \frac {f^n}{n!}$ to
avoid having to compute the factorial from scratch at each coefficient, the same
way \csa{xintFxPtPowerSeries} does not compute |f^n| from scratch at each |n|.
Perhaps in the next package release.

\def\coeffexp #1{1/\xintFac {#1}[0]}% [0] for faster parsing
\def\f {-1/2[0]}%
\newcount\cnta 

\setlength{\multicolsep}{0pt}

\begin{multicols}{3}[%
\centeredline{$e^{-\frac12}\approx{}$}]%
\cnta 0 
\noindent\loop
$\xintFxPtPowerSeries {0}{\cnta}{\coeffexp}{\f}{20}$\\
\ifnum\cnta<19
\advance\cnta 1
\repeat\par
\end{multicols}
\dverb|&
\def\coeffexp #1{1/\xintFac {#1}[0]}% 1/n!
\def\f {-1/2[0]}% [0] for faster input parsing
\cnta 0 % previously declared \count register
\noindent\loop
$\xintFxPtPowerSeries {0}{\cnta}{\coeffexp}{\f}{20}$\\ 
\ifnum\cnta<19 \advance\cnta 1 \repeat\par
% One should **not** trust the final digits, as the potential truncation
% errors of up to 10^{-20} per term accumulate and never disappear! (the
% effect is attenuated by the alternating signs in the series). We  can
% confirm that the last two digits (of our evaluation of the nineteenth
% partial sum) are wrong via the evaluation with more digits:   
|
\centeredline{|\xintFxPtPowerSeries {0}{19}{\coeffexp}{\f}{25}=|
\digitstt{\xintFxPtPowerSeries {0}{19}{\coeffexp}{\f}{25}}}

\texttt{\hyphenchar\font45 }

\edef\z{\xintIrr {\xintPowerSeries {0}{19}{\coeffexp}{\f}}}

It is no difficulty for \xintfracname to compute exactly, with the help
of \csa{xintPowerSeries}, the nineteenth partial sum, and to then give
(the start of) its exact decimal expansion:
\centeredline{|\xintPowerSeries {0}{19}{\coeffexp}{\f}| ${}=
  \displaystyle\xintFrac{\z}$%
  \vphantom{\vrule height 20pt depth 12pt}}%
\centeredline{${}=\xintTrunc {30}{\z}\dots$} Thus, one should always
estimate a priori how many ending digits are not reliable: if there are
|N| terms and |N| has |k| digits, then digits up to but excluding the
last |k| may usually be trusted. If we are optimistic and the series is
alternating we may even replace |N| with $\sqrt{|N|}$ to get the number |k|
of digits possibly of dubious significance.


\subsection{\csbh{xintFxPtPowerSeriesX}}\label{xintFxPtPowerSeriesX}

{\small\hspace*{\parindent}New with release |1.04|.\par}

\noindent\csa{xintFxPtPowerSeriesX}|{A}{B}{\coeff}{\f}{D}| computes, exactly as
\csa{xintFxPtPowerSeries}, the sum of
|\coeff{n}|\raisebox{.5ex}{|.|}|\f^n| from |n=A| to |n=B| with each term
of the series being \emph{truncated} to |D| digits after the decimal
point. The sole difference is that |\f| is first expanded and it
is the result of this which is used in the computations.

% Let us illustrate this on the computation of |(1+y)^{5/3}| where
% |1+y=(1+x)^{3/5}| and each of the two binomial series is evaluated with ten
% terms, the results being computed with |8| digits after the decimal point, and
% &|f|<1/10&. 


Let us illustrate this on the numerical exploration of the identity
\centeredline{|log(1+x) = -log(1/(1+x))|}%
Let |L(h)=log(1+h)|, and |D(h)=L(h)+L(-h/(1+h))|. Theoretically thus,
|D(h)=0| but we shall evaluate |L(h)| and |-h/(1+h)| keeping only 10
terms of their respective series. We will assume &|h|<0.5&. With only
ten terms kept in the power series we do not have quite 3 digits
precision as &2^10=1024&. So it wouldn't make sense to evaluate things
more precisely than, say circa 5 digits after the decimal points.
\dverb|&
\cnta 0
\def\coefflog #1{\the\numexpr\ifodd#1 1\else-1\fi\relax/#1[0]}% (-1)^{n-1}/n
\def\coeffalt #1{\the\numexpr\ifodd#1 -1\else1\fi\relax [0]}%   (-1)^n
\loop
\noindent \hbox to 2.5cm {\hss\texttt{D(\the\cnta/100): }}%
\xintAdd {\xintFxPtPowerSeriesX {1}{10}{\coefflog}{\the\cnta [-2]}{5}}
         {\xintFxPtPowerSeriesX {1}{10}{\coefflog} 
             {\xintFxPtPowerSeriesX {1}{10}{\coeffalt}{\the\cnta [-2]}{5}} 
          {5}}\endgraf 
\ifnum\cnta < 49 \advance\cnta 7 \repeat
|

\cnta 0
\def\coefflog #1{\the\numexpr\ifodd#1 1\else-1\fi\relax/#1[0]}% (-1)^{n-1}/n
\def\coeffalt #1{\the\numexpr\ifodd#1 -1\else1\fi\relax [0]}%   (-1)^n


\begin{multicols}2
\loop
\noindent \hbox to 2.5cm {\hss\texttt{D(\the\cnta/100): }}%
\digitstt{\xintAdd {\xintFxPtPowerSeriesX {1}{10}{\coefflog}{\the\cnta [-2]}{5}}
         {\xintFxPtPowerSeriesX {1}{10}{\coefflog} 
             {\xintFxPtPowerSeriesX {1}{10}{\coeffalt}{\the\cnta [-2]}{5}} 
          {5}}}\endgraf 
\ifnum\cnta < 49 \advance\cnta 7 \repeat
\end{multicols}

Let's say we evaluate functions on |[-1/2,+1/2]| with values more or less also
in |[-1/2,+1/2]| and we want to keep 4 digits of precision. So, roughly we need
at least 14 terms in series like the geometric or log series. Let's make this
15. Then it doesn't make sense to compute intermediate summands with more than 6
digits precision. So we compute with 6 digits
precision but return only 4 digits (rounded) after the decimal point.
This result with 4 post-decimal points precision is then used as input
to the next evaluation.
\dverb|&
\loop
\noindent \hbox to 2.5cm {\hss\texttt{D(\the\cnta/100): }}%
\xintRound{4}
 {\xintAdd {\xintFxPtPowerSeriesX {1}{15}{\coefflog}{\the\cnta [-2]}{6}}
           {\xintFxPtPowerSeriesX {1}{15}{\coefflog} 
                  {\xintRound {4}{\xintFxPtPowerSeriesX {1}{15}{\coeffalt}
                                 {\the\cnta [-2]}{6}}} 
            {6}}%
 }\endgraf 
\ifnum\cnta < 49 \advance\cnta 7 \repeat
|

\begin{multicols}2
\loop
\noindent \hbox to 2.5cm {\hss\texttt{D(\the\cnta/100): }}%
\digitstt{\xintRound{4}
 {\xintAdd {\xintFxPtPowerSeriesX {1}{15}{\coefflog}{\the\cnta [-2]}{6}}
           {\xintFxPtPowerSeriesX {1}{15}{\coefflog} 
                  {\xintRound {4}{\xintFxPtPowerSeriesX {1}{15}{\coeffalt}
                                 {\the\cnta [-2]}{6}}} 
            {6}}%
 }}\endgraf 
\ifnum\cnta < 49 \advance\cnta 7 \repeat
\end{multicols}


Not bad... I have cheated a bit: the `four-digits precise' numeric
evaluations were left unrounded in the final addition. However the inner
rounding to four digits worked fine and made the next step faster than
it would have been with longer inputs. The morale is that one should not
use the raw results of \csa{xintFxPtPowerSeriesX} with the |D| digits
with which it was computed, as the last are to be considered garbage.
Rather, one should keep from the output only some smaller number of
digits. This will make further computations faster and not less precise.
I guess there should be some command to do this final truncating, or
better, rounding, at a given number |D'<D| of digits. Maybe for the next
release.


\subsection{\csbh{xintFloatPowerSeries}}\label{xintFloatPowerSeries}

{\small\hspace*{\parindent}New with |1.08a|.\par}

\noindent\csa{xintFloatPowerSeries}|[P]{A}{B}{\coeff}{f}| computes 
$\sum_{\text{|n=A|}}^{\text{|n=B|}}|\coeff{n}|\cdot |f|^{\,\text{|n|}}$
with a floating point
precision given by the optional parameter |P| or by the current setting of
|\xintDigits|.

In the current, preliminary, version, no attempt has been made to try to
guarantee to the final result the precision |P|. Rather, |P| is used for all
intermediate floating point evaluations. So
rounding errors will make some of the last printed digits invalid. The
operations done are first the evaluation of |f^A| using \csa{xintFloatPow}, then
each successive power is obtained from this first one by multiplication by |f|
using \csa{xintFloatMul}, then again with \csa{xintFloatMul} this is multiplied
with |\coeff{n}|, and the sum is done adding one term at a time with
\csa{xintFloatAdd}. To sum up, this is just the naive transformation of
\csa{xintFxPtPowerSeries} from fixed point to floating point.

\def\coefflog #1{\the\numexpr\ifodd#1 1\else-1\fi\relax/#1[0]}%

\dverb+&
\def\coefflog #1{\the\numexpr\ifodd#1 1\else-1\fi\relax/#1[0]}%
\xintFloatPowerSeries [8]{1}{30}{\coefflog}{-1/2[0]}+
\centeredline{\digitstt{\xintFloatPowerSeries [8]{1}{30}{\coefflog}{-1/2[0]}}}

\subsection{\csbh{xintFloatPowerSeriesX}}\label{xintFloatPowerSeriesX}

{\small\hspace*{\parindent}New with |1.08a|.\par}

\noindent\csa{xintFloatPowerSeriesX}|[P]{A}{B}{\coeff}{f}| is like 
\csa{xintFloatPowerSeries} with the difference that |f| is
expanded once and for all at the start of the computation, thus allowing
efficient chaining of such series evaluations.
\def\coefflog #1{\the\numexpr\ifodd#1 1\else-1\fi\relax/#1[0]}%

\dverb+&
\def\coeffexp #1{1/\xintFac {#1}[0]}% 1/n! (exact, not float)
\def\coefflog #1{\the\numexpr\ifodd#1 1\else-1\fi\relax/#1[0]}%
\xintFloatPowerSeriesX [8]{0}{30}{\coeffexp}
    {\xintFloatPowerSeries [8]{1}{30}{\coefflog}{-1/2[0]}}+
\centeredline{\digitstt{\xintFloatPowerSeriesX [8]{0}{30}{\coeffexp}
    {\xintFloatPowerSeries [8]{1}{30}{\coefflog}{-1/2[0]}}}}
 

\subsection{Computing \texorpdfstring{$\log 2$}{log(2)} and \texorpdfstring{$\pi$}{pi}}\label{ssec:Machin}

In this final section, the use of \csb{xintFxPtPowerSeries} (and
\csb{xintPowerSeries}) will be
illustrated on the (expandable... why make things simple when it is so easy to
make them difficult!) computations of the first digits of the decimal expansion
of the familiar constants $\log 2$ and $\pi$.

Let us start with $\log 2$. We will get it from this formula (which is
left as an exercise): \centeredline{\digitstt{log(2)=-2\,log(1-13/256)-%
  5\,log(1-1/9)}}%
The number of terms to be kept in the log series, for a desired
precision of |10^{-D}| was roughly estimated without much theoretical
analysis. Computing exactly the partial sums with \csa{xintPowerSeries}
and then printing the truncated values, from |D=0| up to |D=100| showed
that it worked in terms of quality of the approximation. Because of
possible strings of zeros or nines in the exact decimal expansion (in
the present case of $\log 2$, strings of zeros around the fourtieth and
the sixtieth decimals), this
does not mean though that all digits printed were always exact. In
the end one always end up having to compute at some higher level of
desired precision to validate the earlier result.

Then we tried with \csa{xintFxPtPowerSeries}: this is worthwile only for
|D|'s at least 50, as the exact evaluations are faster (with these
short-length |f|'s) for a lower
number of digits. And as expected the degradation in the quality of
approximation was in this range of the order of two or three digits.
This meant roughly that the 3+1=4 ending digits were wrong. Again, we ended
up having to compute with five more digits and compare with the earlier
value to validate it. We use truncation rather than rounding because our
goal is not to obtain the correct rounded decimal expansion but the
correct exact truncated one.

% 693147180559945309417232121458176568075500134360255254120680009493

\dverb|&
\def\coefflog #1{1/#1[0]}% 1/n
\def\xa {13/256[0]}%  we will compute log(1-13/256)
\def\xb {1/9[0]}%     we will compute log(1-1/9)
\def\LogTwo #1%
%  get log(2)=-2log(1-13/256)- 5log(1-1/9) 
{% we want to use \printnumber, hence need something expanding in two steps
 % only, so we use here the \romannumeral0 method
  \romannumeral0\expandafter\LogTwoDoIt \expandafter
    % Nb Terms for 1/9:
  {\the\numexpr #1*150/143\expandafter}\expandafter
    % Nb Terms for 13/256:
  {\the\numexpr #1*100/129\expandafter}\expandafter
    % We print #1 digits, but we know the ending ones are garbage
  {\the\numexpr #1\relax}% allows #1 to be a count register
}%
\def\LogTwoDoIt #1#2#3% 
%  #1=nb of terms for 1/9, #2=nb of terms for 13/256, 
{% #3=nb of digits for computations, also used for printing
 \xinttrunc {#3} % lowercase form to stop the \romannumeral0 expansion!
 {\xintAdd
  {\xintMul {2}{\xintFxPtPowerSeries {1}{#2}{\coefflog}{\xa}{#3}}}
  {\xintMul {5}{\xintFxPtPowerSeries {1}{#1}{\coefflog}{\xb}{#3}}}%
 }%
}%
\noindent $\log 2 \approx \LogTwo {60}\dots$\endgraf
\noindent\phantom{$\log 2$}${}\approx{}$\printnumber{\LogTwo {65}}\dots\endgraf
\noindent\phantom{$\log 2$}${}\approx{}$\printnumber{\LogTwo {70}}\dots\endgraf
|
\def\coefflog #1{1/#1[0]}% 1/n
\def\xa {13/256[0]}% we will compute log(1-13/256)
\def\xb {1/9[0]}%    we will compute log(1-1/9)
\def\LogTwo #1% get log(2)=-2log(1-13/256)- 5log(1-1/9) with #1 digits precision
{% this #1 may be a count register, if desired
    \romannumeral0\expandafter\LogTwoDoIt \expandafter
    {\the\numexpr #1*150/143\expandafter}\expandafter % Nb Terms for 1/9
    {\the\numexpr #1*100/129\expandafter}\expandafter % Nb Terms for 13/256
    {\the\numexpr #1\relax }%
}% 
\def\LogTwoDoIt #1#2#3% #1=nb of terms for 1/9, #2=nb of terms for 13/256, 
{%                     #3=nb of digits for computations
  \xinttrunc {#3}
    {\xintAdd
      {\xintMul {2}{\xintFxPtPowerSeries {1}{#2}{\coefflog}{\xa}{#3}}}
      {\xintMul {5}{\xintFxPtPowerSeries {1}{#1}{\coefflog}{\xb}{#3}}}%
    }%
}%

\noindent $\log 2 \approx {}$\digitstt{\LogTwo {60}\dots}\endgraf
\noindent\phantom{$\log 2$}${}\approx{}$\digitstt{\printnumber{\LogTwo
    {65}}\dots}\endgraf 
\noindent\phantom{$\log 2$}${}\approx{}$\digitstt{\printnumber{\LogTwo
    {70}}\dots}\endgraf 

Here is the code doing an exact evaluation of the partial sums. We have
added a |+1| to the number of digits for estimating the number of terms
to keep from the log series: we experimented that this gets exactly the
first |D| digits, for all values from |D=0| to |D=100|, except in one
case (|D=40|) where the last digit is wrong. For values of |D|
higher than |100| it is more efficient to use the code using
\csa{xintFxPtPowerSeries}. 
\dverb|&
\def\LogTwo #1% get log(2)=-2log(1-13/256)- 5log(1-1/9)
{% 
    \romannumeral0\expandafter\LogTwoDoIt \expandafter
    {\the\numexpr (#1+1)*150/143\expandafter}\expandafter
    {\the\numexpr (#1+1)*100/129\expandafter}\expandafter
    {\the\numexpr #1\relax}%
}% 
\def\LogTwoDoIt #1#2#3%
{%   #3=nb of digits for truncating an EXACT partial sum
  \xinttrunc {#3}
    {\xintAdd
      {\xintMul {2}{\xintPowerSeries {1}{#2}{\coefflog}{\xa}}}
      {\xintMul {5}{\xintPowerSeries {1}{#1}{\coefflog}{\xb}}}%
    }%
}%
|

Let us turn now to Pi, computed with the Machin formula. Again the numbers of
terms to keep in the two |arctg| series were roughly estimated, and some
experimentations showed that removing the last three digits was enough (at least
for |D=0-100| range). And the algorithm does print the correct digits when used
with |D=1000| (to be convinced of that one needs to run it for |D=1000| and
again, say for |D=1010|.) A theoretical analysis could help confirm that this
algorithm always gets better than |10^{-D}| precision, but again, strings of
zeros or nines encountered in the decimal expansion may falsify the ending
digits, nines may be zeros (and the last non-nine one should be increased) and
zeros may be nine (and the last non-zero one should be decreased). 
\dverb|&
% pi = 16 Arctg(1/5) - 4 Arctg(1/239) (John Machin's formula)
\def\coeffarctg #1{\the\numexpr\ifodd#1 -1\else1\fi\relax/% 
                                       \the\numexpr 2*#1+1\relax [0]}% 
% the above computes (-1)^n/(2n+1).
% Alternatives: 
% \def\coeffarctg #1{1/\the\numexpr\xintiMON{#1}*(2*#1+1)\relax }%
% The [0] can *not* be used above, as the denominator is signed.
% \def\coeffarctg #1{\xintiMON{#1}/\the\numexpr 2*#1+1\relax [0]}%
\def\xa {1/25[0]}%      1/5^2, the [0] for faster parsing
\def\xb {1/57121[0]}% 1/239^2, the [0] for faster parsing
\def\Machin #1{% \Machin {\mycount} is allowed
    \romannumeral0\expandafter\MachinA \expandafter
     % number of terms for arctg(1/5):
    {\the\numexpr (#1+3)*5/7\expandafter}\expandafter 
     % number of terms for arctg(1/239):  
    {\the\numexpr (#1+3)*10/45\expandafter}\expandafter
     % do the computations with 3 additional digits:
    {\the\numexpr #1+3\expandafter}\expandafter
     % allow #1 to be a count register:
    {\the\numexpr #1\relax }}%
\def\MachinA #1#2#3#4% 
% #4: digits to keep after decimal point for final printing
% #3=#4+3: digits for evaluation of the necessary number of terms
% to be kept in the arctangent series, also used to truncate each
% individual summand.
{\xinttrunc {#4} % must be lowercase to stop \romannumeral0! 
 {\xintSub  
  {\xintMul {16/5}{\xintFxPtPowerSeries {0}{#1}{\coeffarctg}{\xa}{#3}}}
  {\xintMul {4/239}{\xintFxPtPowerSeries {0}{#2}{\coeffarctg}{\xb}{#3}}}%
 }}%
\[ \pi = \Machin {60}\dots \]
|
\def\coeffarctg #1{\the\numexpr\ifodd#1 -1\else1\fi\relax/% 
                                       \the\numexpr 2*#1+1\relax [0]}% 
%\def\coeffarctg #1{\romannumeral0\xintmon{#1}/\the\numexpr 2*#1+1\relax }% 
\def\xa {1/25[0]}%      1/5^2, the [0] for faster parsing
\def\xb {1/57121[0]}% 1/239^2, the [0] for faster parsing
\def\Machin #1{% #1 may be a count register, \Machin {\mycount} is allowed
    \romannumeral0\expandafter\MachinA \expandafter
     % number of terms for arctg(1/5):
    {\the\numexpr (#1+3)*5/7\expandafter}\expandafter 
     % number of terms for arctg(1/239):  
    {\the\numexpr (#1+3)*10/45\expandafter}\expandafter
     % do the computations with 3 additional digits:
    {\the\numexpr #1+3\expandafter}\expandafter
     % allow #1 to be a count register:
    {\the\numexpr #1\relax }}%
\def\MachinA #1#2#3#4% 
{\xinttrunc {#4} 
 {\xintSub  
  {\xintMul {16/5}{\xintFxPtPowerSeries {0}{#1}{\coeffarctg}{\xa}{#3}}}
  {\xintMul{4/239}{\xintFxPtPowerSeries {0}{#2}{\coeffarctg}{\xb}{#3}}}%
 }}%
\begin{framed}
  \[ \pi = \Machin {60}\dots \]
\end{framed}
Here is a variant|\MachinBis|,
which evaluates the partial sums \emph{exactly} using
\csa{xintPowerSeries}, before their final truncation. No need for a
``|+3|'' then.
\dverb|&
\def\MachinBis #1{% #1 may be a count register,
% the final result will be truncated to #1 digits post decimal point
    \romannumeral0\expandafter\MachinBisA \expandafter
     % number of terms for arctg(1/5):
    {\the\numexpr #1*5/7\expandafter}\expandafter 
     % number of terms for arctg(1/239):  
    {\the\numexpr #1*10/45\expandafter}\expandafter
      % allow #1 to be a count register:
    {\the\numexpr #1\relax }}%
\def\MachinBisA #1#2#3% 
{\xinttrunc {#3} %
 {\xintSub  
   {\xintMul {16/5}{\xintPowerSeries {0}{#1}{\coeffarctg}{\xa}}}
   {\xintMul{4/239}{\xintPowerSeries {0}{#2}{\coeffarctg}{\xb}}}%
}}%
|

\def\MachinBis #1{% #1 may be a count register,
% the final result will be truncated to #1 digits post decimal point
    \romannumeral0\expandafter\MachinBisA \expandafter
     % number of terms for arctg(1/5):
    {\the\numexpr #1*5/7\expandafter}\expandafter 
     % number of terms for arctg(1/239):  
    {\the\numexpr #1*10/45\expandafter}\expandafter
      % allow #1 to be a count register:
    {\the\numexpr #1\relax }}%
\def\MachinBisA #1#2#3% 
{\xinttrunc {#3} %
 {\xintSub  
   {\xintMul {16/5}{\xintPowerSeries {0}{#1}{\coeffarctg}{\xa}}}
   {\xintMul{4/239}{\xintPowerSeries {0}{#2}{\coeffarctg}{\xb}}}%
}}%

Let us use this variant for a loop showing the build-up of digits:
\dverb|&
    \cnta 0 % previously declared \count register
    \loop
    \MachinBis{\cnta} \endgraf  % Plain's \loop does not accept \par
    \ifnum\cnta < 30 \advance\cnta 1 \repeat
|
\begin{multicols}{2}
  \cnta 0 % previously declared \count register
  \loop \noindent
        \centeredline{\digitstt{\MachinBis{\cnta}}}%
  \ifnum\cnta < 30
  \advance\cnta 1 \repeat
\end{multicols}


You want more digits and have some time? Copy the |\Machin|
code to a Plain \TeX{} or \LaTeX{} document loading \xintseriesname, and
compile:
\dverb|&
\newwrite\outfile
\immediate\openout\outfile \jobname-out\relax
\immediate\write\outfile {\Machin {1000}}
\immediate\closeout\outfile
|
This will create a file with the correct first 1000 digits of $\pi$
after the decimal point. On my laptop (a 2012 model) this took about 42 
seconds last time I tried (and for 200 digits it is less than 1 second).
As mentioned in the introduction, the file
\href{http://www.ctan.org/pkg/pi}{pi.tex} by \textsc{D.
  Roegel} shows that orders of magnitude faster computations are
possible within \TeX{}, but recall our constraints of complete
expandability and be merciful, please.

% \newwrite\outfile
% \immediate\openout\outfile \jobname-out\relax
% \pdfresettimer
% \immediate\write\outfile {\Machin {1000}}
% \edef\temps{\the\pdfelapsedtime}
% \immediate\closeout\outfile

% \temps: \xintRound {2}{\temps/65536} secondes


\textbf{Why truncating rather than rounding?} One of our main competitors
on the market of scientific computing, a canadian product (not
encumbered with expandability constraints, and having barely ever heard
of \TeX{} ;-), prints numbers rounded in the last digit. Why didn't we
follow suit in the macros \csa{xintFxPtPowerSeries} and
\csa{xintFxPtPowerSeriesX}? To round at |D| digits, and excluding a
rewrite or cloning of the division algorithm which anyhow would add to
it some overhead in its final steps, \xintfracname needs to truncate at
|D+1|, then round. And rounding loses information! So, with more time
spent, we obtain a worst result than the one truncated at |D+1| (one
could imagine that additions and so on, done with only |D| digits, cost
less; true, but this is a negligeable effect per summand compared to the
additional cost for this term of having been truncated at |D+1| then
rounded). Rounding is the way to go when setting up algorithms to
evaluate functions destined to be composed one after the other: exact
algebraic operations with many summands and an |f| variable which is a
fraction are costly and create an even bigger fraction; replacing |f|
with a reasonable rounding, and rounding the result, is necessary to
allow arbitrary chaining.

But, for the
computation of a single constant, we are really interested in the exact
decimal expansion, so we truncate and compute more terms until the
earlier result gets validated. Finally if we do want the rounding we can
always do it on a value computed with |D+1| truncation.

  \clearpage

\section{Commands of the \xintcfracname package} 

This package was first included in release |1.04| of the \xintname bundle. 


\localtableofcontents


\subsection{Package overview}

A \emph{simple} continued fraction has coefficients
|[c0,c1,...,cN]| (usually called partial quotients, but I really
dislike this entrenched terminology), where |c0| is a positive or
negative integer and the others are positive integers. As we will
see it is possible with \xintcfracname to specify the coefficient
function |c:n->cn|. Note that the index then starts at zero as
indicated. With the |amsmath| macro |\cfrac| one can display such a
continued fraction as 
\[ c_0 + \cfrac{1}{c_1+\cfrac1{c_2+\cfrac1{c_3+\cfrac1{\ddots}}}}\]
Here is a concrete example:
\[ \xintFrac {208341/66317}=\xintCFrac {208341/66317}\] But the
difference with |amsmath|'s |\cfrac| is that this was input as
\centeredline{|\[ \xintFrac {208341/66317}=\xintCFrac
  {208341/66317} \]|} The command \csb{xintCFrac} produces in two
expansion steps the whole thing with the many chained |\cfrac|'s and all
necessary braces, ready to be printed, in math mode. This is \LaTeX{}
only and with the |amsmath| package (we shall mention another method for
Plain \TeX{} users of |amstex|).

A \emph{generalized} continued fraction has the same structure but
the numerators are not restricted to be ones, and numbers used in
the continued fraction may be arbitrary, also fractions,
irrationals, indeterminates. The \emph{centered} continued
fraction associated to a rational number is an
example:\centeredline{|\[ \xintFrac {915286/188421}=\xintGCFrac {\xintFtoCC
  {915286/188421}} \]|}
\[ \xintFrac {915286/188421}=\xintGCFrac {\xintFtoCC {915286/188421}}
=\xintCFrac {915286/188421}\] The command \csb{xintGCFrac}, contrarily to
\csb{xintCFrac}, does not compute anything, it just typesets. Here, it is the
command \csb{xintFtoCC} which did the computation of
the centered continued fraction of |f|. Its output has the `inline format'
described in the next paragraph. In the display, we also used \csa{xintCFrac}
(code not shown), for comparison of the two types of continued fractions.

A generalized continued fraction may be input `inline' as:
\centeredline{|a0+b0/a1+b1/a2+b2/...../a(n-1)+b(n-1)/an|}%
Fractions among the coefficients are allowed but they must be enclosed
within braces. Signed integers may be left without braces (but the |+|
signs are mandatory). Or, they may
be macros expanding (in two steps) to some number or fractional number.
\centeredline{|\xintGCFrac {1+-1/57+\xintPow {-3}{7}/\xintQuo {132}{25}}|}
\[ \xintFrac{\xintGCtoF  {1+-1/57+\xintPow {-3}{7}/\xintQuo {132}{25}}}=
   \xintGCFrac {1+-1/57+\xintPow {-3}{7}/\xintQuo {132}{25}}\]
The left hand side was obtained with the following code:
\centeredline{|\xintFrac{\xintGCtoF  {1+-1/57+\xintPow {-3}{7}/\xintQuo
      {132}{25}}}|}
It uses the macro \csb{xintGCtoF} to convert a generalized fraction from the
`inline format' to the fraction it evaluates to.

A simple continued fraction is a special case of a generalized continued
fraction and may be input as such to macros expecting the `inline format', for
example |-7+1/6+1/19+1/1+1/33|. There is a simpler comma separated format:
\centeredline{|\xintFrac{\xintCstoF{-7,6,19,1,33}}=&
               \xintCFrac{\xintCstoF{-7,6,19,1,33}}|}
\[
\xintFrac{\xintCstoF{-7,6,19,1,33}}=\xintCFrac{\xintCstoF{-7,6,19,1,33}}\] This
comma separated format may also be used with fractions among the coefficients:
of course in that case, computing with \csb{xintFtoCs} from the resulting |f|
its real coefficients will give a new comma separated list
with only integers. This list has no spaces: the spaces in the display below
arise from the math mode processing.
\centeredline{|\xintFrac{1084483/398959}=[\xintFtoCs{1084483/398959}]|}
\[\xintFrac{1084483/398959}=[\xintFtoCs{1084483/398959}]\]
If one prefers other separators, one can use \csb{xintFtoCx} whose first
argument will be the separator to be used. 
\centeredline{|\xintFrac{2721/1001}=\xintFtoCx {+1/(}{2721/1001})\cdots)|}
\[\xintFrac{2721/1001}=\xintFtoCx {+1/(}{2721/1001})\cdots)\]
People using Plain \TeX{} and |amstex| can achieve the same effect as
|\xintCFrac| with:
|$$\xintFwOver{2721/1001}=\xintFtoCx {+\cfrac1\\ }{2721/1001}\endcfrac$$|

Using \csa{xintFtoCx} with first argument an empty pair of braces |{}| will
return the list of the coefficients of the continued fraction of |f|, without
separator, and each one enclosed in a pair of group braces. This can then be
manipulated by the non-expandable macro \csb{xintAssignArray} or the expandable
ones \csb{xintApply} and \csb{xintListWithSep}.

As a shortcut to using \csa{xintFtoCx} with separator |1+/|, there is
\csb{xintFtoGC}:
\centeredline{|2721/1001=\xintFtoGC {2721/1001}|}%
\centeredline{\digitstt{2721/1001=\xintFtoGC {2721/1001}}}
Let us compare in that case with the output of \csb{xintFtoCC}:
\centeredline{|2721/1001=\xintFtoCC {2721/1001}|}%
\centeredline{\digitstt{2721/1001=\xintFtoCC {2721/1001}}}

The `|\printnumber|' macro which we use to print long numbers can also
be useful on long continued fractions. 
\centeredline{|\printnumber{\xintFtoCC {35037018906350720204351049/%|}%
\centeredline{|244241737886197404558180}}|}%
\digitstt{\printnumber{\xintFtoCC {35037018906350720204351049/244241737886197404558180}}}.
If we apply \csb{xintGCtoF} to this generalized continued fraction, we
discover that the original fraction was reducible:
\centeredline{|\xintGCtoF
  {143+1/2+...+-1/9}|\digitstt{=\xintGCtoF{143+1/2+1/5+-1/4+-1/4+-1/4+-1/3+1/2+1/2+1/6+-1/22+1/2+1/10+-1/5+-1/11+-1/3+1/4+-1/2+1/2+1/4+-1/2+1/23+1/3+1/8+-1/6+-1/9}}}

\def\mymacro #1{$\xintFrac{#1}=[\xintFtoCs{#1}]$\vtop to 6pt{}}

\begingroup
\catcode`^\active
\def^#1^{\hbox{\fontfamily{lmtt}\selectfont #1}}%
\catcode`\& 4 
When a generalized continued fraction is built with integers, and
numerators are only |1|'s or |-1|'s, the produced fraction is
irreducible. And if we compute it again with the last sub-fraction
omitted we get another irreducible fraction related to the bigger one by
a Bezout identity. Doing this here we get:
\centeredline{|\xintGCtoF {143+1/2+...+-1/6}|\digitstt{=\xintGCtoF{143+1/2+1/5+-1/4+-1/4+-1/4+-1/3+1/2+1/2+1/6+-1/22+1/2+1/10+-1/5+-1/11+-1/3+1/4+-1/2+1/2+1/4+-1/2+1/23+1/3+1/8+-1/6}}}
and indeed:
\[ \begin{vmatrix}
    ^2897319801297630107^ & ^328124887710626729^\\
      ^20197107104701740^ & ^2287346221788023^ 
   \end{vmatrix} = \digitstt{\xintiSub {\xintiMul {2897319801297630107}{2287346221788023}}{\xintiMul{20197107104701740}{328124887710626729}}}\]

\endgroup

More generally the various fractions obtained from the truncation of a
continued fraction to its initial terms are called the convergents. The
commands of \xintcfracname such as \csb{xintFtoCv}, \csb{xintFtoCCv},
and others which compute such convergents, return them as a list of
braced items, with no separator. This list can then be treated either
with \csa{xint\-AssignArray}, or \csa{xintListWithSep}, or any other way
(but then, some \TeX{} programming knowledge will be necessary). Here
is an example:

\noindent
\centeredline{|$$\xintFrac{915286/188421}\to \xintListWithSep {,}%|}%
\centeredline{|{\xintApply{\xintFrac}{\xintFtoCv{915286/188421}}}$$|}
\[ \xintFrac{915286/188421}\to \xintListWithSep {,}
{\xintApply\xintFrac{\xintFtoCv{915286/188421}}}\]
\centeredline{|$$\xintFrac{915286/188421}\to \xintListWithSep {,}%|}%
\centeredline{|{\xintApply{\xintFrac}{\xintFtoCCv{915286/188421}}}$$|}
\[ \xintFrac{915286/188421}\to \xintListWithSep {,}
{\xintApply\xintFrac{\xintFtoCCv{915286/188421}}}\] We thus see that the
`centered convergents' obtained with \csb{xintFtoCCv} are among the fuller list
of convergents as returned by \csb{xintFtoCv}. 

Here is a more complicated use of \csa{xintApply}
and \csa{xintListWithSep}. We first define a macro which will be applied to each
convergent:\centeredline{|\newcommand{\mymacro}[1]|%
  |{$\xintFrac{#1}=[\xintFtoCs{#1}]$\vtop to 6pt{}}|}%
Next, we use the following code:
\centeredline{|$\xintFrac{49171/18089}\to{}$|}%
\centeredline{|\xintListWithSep {,
  }{\xintApply{\mymacro}{\xintFtoCv{49171/18089}}}|}
It produces:\par
\noindent$ \xintFrac{49171/18089}\to {}$\xintListWithSep {,
  }{\xintApply{\mymacro}{\xintFtoCv{49171/18089}}}.


\def\cn #1{\xintiPow {2}{#1}}%

The macro \csb{xintCntoF} allows to specify the coefficients as
functions of the index. The values to which expand the
coefficient function do not have to be integers. \centeredline{|\def\cn
  #1{\xintiPow {2}{#1}}% 2^n|}%
  \centeredline{|\[\xintFrac{\xintCntoF {6}{\cn}}=\xintCFrac
    [l]{\xintCntoF {6}{\cn}}\]|}%
\[\xintFrac{\xintCntoF {6}{\cn}}=\xintCFrac [l]{\xintCntoF
    {6}{\cn}}\]
Notice the use of the optional argument |[l]| to \csa{xintCFrac}. Other
possibilities are |[r]| and (default) |[c]|.
\def\cn #1{\xintPow {2}{-#1}}%
\centeredline{|\def\cn #1{\xintPow {2}{-#1}}% 1/2^n|}%
\centeredline{%
|\[\xintFrac{\xintCntoF {6}{\cn}} = \xintGCFrac [r]{\xintCntoGC {6}{\cn}}|}%
\centeredline{| = [\xintFtoCs {\xintCntoF {6}{\cn}}]\]|}%
\[\xintFrac{\xintCntoF {6}{\cn}}=\xintGCFrac [r]{\xintCntoGC {6}{\cn}}= 
  [\xintFtoCs {\xintCntoF {6}{\cn}}]\]
We used \csb{xintCntoGC} as we wanted to display also the continued fraction and
not only the fraction returned by \csa{xintCntoF}. 

There are also \csb{xintGCntoF} and \csb{xintGCntoGC} which allow the same for
generalized fractions. The following initial portion of a generalized continued
fraction for $\pi$:
\def\an #1{\the\numexpr 2*#1+1\relax }%
\def\bn #1{\the\numexpr (#1+1)*(#1+1)\relax }%
\[ \xintFrac{\xintDiv {4}{\xintGCntoF {5}{\an}{\bn}}} = 
        \cfrac{4}{\xintGCFrac{\xintGCntoGC {5}{\an}{\bn}}} =
\xintTrunc {10}{\xintDiv {4}{\xintGCntoF {5}{\an}{\bn}}}\dots\]
was obtained with this code:
\dverb|&
\def\an #1{\the\numexpr 2*#1+1\relax }%
\def\bn #1{\the\numexpr (#1+1)*(#1+1)\relax }%
\[ \xintFrac{\xintDiv {4}{\xintGCntoF {5}{\an}{\bn}}} = 
        \cfrac{4}{\xintGCFrac{\xintGCntoGC {5}{\an}{\bn}}} =
\xintTrunc {10}{\xintDiv {4}{\xintGCntoF {5}{\an}{\bn}}}\dots\]
|
We see that the quality of approximation is not fantastic compared to the simple
continued fraction of $\pi$ with about as many terms:
\dverb|&
\[ \xintFrac{\xintCstoF{3,7,15,1,292,1,1}}=
   \xintGCFrac{3+1/7+1/15+1/1+1/292+1/1+1/1}=
   \xintTrunc{10}{\xintCstoF{3,7,15,1,292,1,1}}\dots\]
|
\[ \xintFrac{\xintCstoF{3,7,15,1,292,1,1}}=
\xintGCFrac{3+1/7+1/15+1/1+1/292+1/1+1/1}=
\xintTrunc{10}{\xintCstoF{3,7,15,1,292,1,1}}\dots\]

\hypertarget{e-convergents}{To}
conclude this overview of most of the package functionalities, let us explore
the convergents of Euler's number $e$.
\dverb|&
\def\cn #1{\the\numexpr\ifcase \numexpr #1+3-3*((#1+2)/3)\relax
                           1\or1\or2*(#1/3)\fi\relax }
% produces the pattern 1,1,2,1,1,4,1,1,6,1,1,8,... which are the
% coefficients of the simple continued fraction of e-1.
\cnta 0
\def\mymacro #1{\advance\cnta by 1
                \noindent
                \hbox to 3em {\hfil\small\texttt{\the\cnta.} }%
                $\xintTrunc {30}{\xintAdd {1[0]}{#1}}\dots=
                 \xintFrac{\xintAdd {1[0]}{#1}}$}%
\xintListWithSep{\vtop to 6pt{}\vbox to 12pt{}\par}
    {\xintApply\mymacro{\xintiCstoCv{\xintCntoCs {35}{\cn}}}}
|
\smallskip The volume of computation is kept minimal by the following steps:
\begin{itemize}
\item a comma separated list of the first 36 coefficients is produced by
  \csb{xintCntoCs},
\item this is then given to \csb{xintiCstoCv} which produces the list of the
  convergents (there is also \csb{xintCstoCv}, but our
  coefficients being integers we used the infinitesimally
  faster \csb{xintiCstoCv}),
\item then the whole list was converted into a sequence of one-line paragraphs,
  each convergent becomes the argument to a  macro printing it
  together with its decimal expansion with 30 digits after the decimal point.
\item A count register |\cnta| was used to give a line count serving as a visual
  aid: we could also have done that in an expandable way, but well, let's relax
  from time to time\dots
\end{itemize}


\def\cn #1{\the\numexpr\ifcase \numexpr #1+3-3*((#1+2)/3)\relax
                           1\or1\or2*(#1/3)\fi\relax }
% produces the pattern 1,1,2,1,1,4,1,1,6,1,1,8,... which are the
% coefficients of the simple continued fraction of e-1.
\cnta 0
\def\mymacro #1{\advance\cnta by 1
                \noindent
                \hbox to 3em {\hfil\small\digitstt{\the\cnta.} }%
                $\xintTrunc {30}{\xintAdd {1[0]}{#1}}\dots=
                 \xintFrac{\xintAdd {1[0]}{#1}}$}%
\xintListWithSep{\vtop to 6pt{}\vbox to 12pt{}\par}
    {\xintApply\mymacro{\xintiCstoCv{\xintCntoCs {35}{\cn}}}}

% \def\testmacro #1{\xintTrunc {30}{\xintAdd {1[0]}{#1}}\xintAdd {1[0]}{#1}}
% \pdfresettimer
% \edef\z{\xintApply\testmacro{\xintiCstoCv{\xintCntoCs {35}{\cn}}}}
% (\the\pdfelapsedtime)


\smallskip The actual computation of the list of all 36 convergents accounts for
only 8\% of the total time (total time equal to about 5 hundredths of a second
in my testing, on my laptop): another 80\% is occupied with the computation of
the truncated decimal expansions (and the addition of 1 to everything as the
formula gives the continued fraction of $e-1$). One can with no problem compute
much bigger convergents. Let's get the 200th convergent. It turns out to
have the same first 268 digits after the decimal point as $e-1$. Higher
convergents get more and more digits in proportion to their index: the 500th
convergent already gets 799 digits correct! To allow speedy compilation of the
source of this document when the need arises, I limit here to the 200th
convergent (getting the 500th took about 1.2s on my laptop last time I tried,
and the 200th convergent is obtained ten times faster).
\dverb|&
\edef\z {\xintCntoF {199}{\cn}}%
\begingroup\parindent 0pt \leftskip 2.5cm
\indent\llap {Numerator = }{\printnumber{\xintNumerator\z}\par
\indent\llap {Denominator = }\printnumber{\xintDenominator\z}\par
\indent\llap {Expansion = }\printnumber{\xintTrunc{268}\z}\dots
\par\endgroup
|

\edef\z {\xintCntoF {199}{\cn}}%

\begingroup\parindent 0pt \leftskip 2.5cm
\indent\llap {Numerator = }\digitstt{\printnumber{\xintNumerator\z}}\par
\indent\llap {Denominator = }\digitstt{\printnumber{\xintDenominator\z}}\par
\indent\llap 
    {Expansion = }\digitstt{\printnumber{\xintTrunc{268}\z}\dots}\par\endgroup

One can also use a centered continued fraction: we get more digits but there are
also more computations as the numerators may be either
$1$ or $-1$.

\subsection{\csbh{xintCFrac}}\label{xintCFrac}

\csa{xintCFrac}|{f}| is a math-mode only, \LaTeX{} with |amsmath| only, macro
which first computes then displays with the help of |\cfrac| the simple
continued fraction corresponding to the given fraction (or macro expanding in
two steps to one such). It admits an optional argument which may be |[l]|, |[r]|
or (the default) |[c]| to specify the location of the one's in the numerators of
the sub-fractions. Each coefficient is typeset using the \csb{xintFrac} macro
from the \xintfracname package.

\subsection{\csbh{xintGCFrac}}\label{xintGCFrac}

\csa{xintGCFrac}|{a+b/c+d/e+f/g+h/...}| uses similarly |\cfrac| to typeset a
generalized continued fraction in inline format.  It admits the same optional
argument as \csa{xintCFrac}.
\centeredline{|\[\xintGCFrac {1+\xintPow{1.5}{3}/{1/7}+{-3/5}/\xintFac {6}}\]|}
\[\xintGCFrac {1+\xintPow{1.5}{3}/{1/7}+{-3/5}/\xintFac {6}}\]
As can be seen this is typesetting macro, although it does proceed to the
evaluation of the coefficients themselves. See \csb{xintGCtoF} if you are
impatient to see this fraction computed. Numerators and denominators are made
arguments to the
\csb{xintFrac} macro.

\subsection{\csbh{xintGCtoGCx}}\label{xintGCtoGCx}
{\small New with release |1.05|.\par}


\csa{xintGCtoGCx}|{sepa}{sepb}{a+b/c+d/e+f/...+x/y}| returns the list of the
coefficients of the generalized continued fraction of |f|, each one within a
pair of braces, and separated with the help of |sepa| and |sepb|. Thus
\centeredline{|\xintGCtoGCx :;{1+2/3+4/5+6/7}| gives \xintGCtoGCx
  :;{1+2/3+4/5+6/7}} Plain \TeX{}+|amstex| users may be interested in:\par
\noindent|$$\xintGCtoGCx {+\cfrac}{\\}{a+b/...}\endcfrac$$|\par
\noindent
|$$\xintGCtoGCx {+\cfrac\xintFwOver}{\\\xintFwOver}{a+b/...}\endcfrac$$|\par


\subsection{\csbh{xintFtoCs}}\label{xintFtoCs}

\csa{xintFtoCs}|{f}| returns the comma separated list of the coefficients of the
simple continued fraction of |f|.
\centeredline{%
|\[ \xintSignedFrac{-5262046/89233} = [\xintFtoCs{-5262046/89233}]\]|}%
\[ \xintSignedFrac{-5262046/89233} = [\xintFtoCs{-5262046/89233}]\]


\subsection{\csbh{xintFtoCx}}\label{xintFtoCx}

\csa{xintFtoCx}|{sep}{f}| returns the list of the coefficients of the simple
continued fraction of |f|, withing group braces and separated with the help of
|sep|. \centeredline{|$$\xintFtoCx {+\cfrac1\\ }{f}\endcfrac$$|} will
display the 
continued fraction in |\cfrac| format, with Plain \TeX{} and |amstex|.

\subsection{\csbh{xintFtoGC}}\label{xintFtoGC}

\csa{xintFtoGC}|{f}| does the same as \csa{xintFtoCx}|{+1/}{f}|. Its
output may thus be used in the package macros expecting such an `inline
format'. This continued fraction is a \emph{simple} one, not a
\emph{generalized} one, but as it is produced in the format used for
user input of generalized continued fractions, the macro was called
\csa{xintFtoGC} rather than \csa{xintFtoC} for example.
\centeredline{|566827/208524=\xintFtoGC {566827/208524}|}%
\centeredline{566827/208524=\xintFtoGC {566827/208524}}

\subsection{\csbh{xintFtoCC}}\label{xintFtoCC}

\csa{xintFtoCC}|{f}| returns the `centered' continued fraction of |f|, in
`inline format'.
\centeredline{|566827/208524=\xintFtoCC {566827/208524}|}%
\centeredline{566827/208524=\xintFtoCC {566827/208524}}
\centeredline{%
|\[\xintFrac{566827/208524} = \xintGCFrac{\xintFtoCC{566827/208524}}\]|}%
\[\xintFrac{566827/208524} = \xintGCFrac{\xintFtoCC{566827/208524}}\]

\subsection{\csbh{xintFtoCv}}\label{xintFtoCv}

\csa{xintFtoCv}|{f}| returns the list of the (braced) convergents of |f|, with
no separator. To be treated with \csb{xintAssignArray} or \csb{xintListWithSep}.
\centeredline{%
|\[\xintListWithSep{\to}{\xintApply\xintFrac{\xintFtoCv{5211/3748}}}\]|}%
\[\xintListWithSep{\to}{\xintApply\xintFrac{\xintFtoCv{5211/3748}}}\]

\subsection{\csbh{xintFtoCCv}}\label{xintFtoCCv}

\csa{xintFtoCCv}|{f}| returns the list of the (braced) centered convergents of
|f|, with no separator. To be treated with \csb{xintAssignArray} or
\csb{xintListWithSep}.
\centeredline{%
|\[\xintListWithSep{\to}{\xintApply\xintFrac{\xintFtoCCv{5211/3748}}}\]|}%
\[\xintListWithSep{\to}{\xintApply\xintFrac{\xintFtoCCv{5211/3748}}}\]

\subsection{\csbh{xintCstoF}}\label{xintCstoF}

\csa{xintCstoF}|{a,b,c,d,...,z}| computes the fraction corresponding to the
coefficients, which may be fractions or even macros expanding to such
fractions (in two steps). The final fraction may then be highly
reducible.
\centeredline{|\[\xintGCFrac {-1+1/3+1/-5+1/7+1/-9+1/11+1/-13}|}%
\centeredline{|=\xintSignedFrac{\xintCstoF {-1,3,-5,7,-9,11,-13}}|}%
\centeredline{|=\xintSignedFrac{\xintGCtoF  
                {-1+1/3+1/-5+1/7+1/-9+1/11+1/-13}}\]|}%
\[\xintGCFrac {-1+1/3+1/-5+1/7+1/-9+1/11+1/-13}=
\xintSignedFrac{\xintCstoF {-1,3,-5,7,-9,11,-13}}
=\xintSignedFrac{\xintGCtoF  {-1+1/3+1/-5+1/7+1/-9+1/11+1/-13}}\]
\centeredline{|\xintGCFrac{{1/2}+1/{1/3}+1/{1/4}+1/{1/5}}= |}%
\centeredline{|  \xintFrac{\xintCstoF {1/2,1/3,1/4,1/5}}|}%
\[\xintGCFrac{{1/2}+1/{1/3}+1/{1/4}+1/{1/5}}= 
\xintFrac{\xintCstoF {1/2,1/3,1/4,1/5}}\] A generalized continued fraction may
produce a reducible fraction (\csa{xintCstoF} tries its best not to accumulate
in a silly way superfluous factors but will not do simplifications which would
be obvious to a human, like simplification by 3 in the result above).

\subsection{\csbh{xintCstoCv}}\label{xintCstoCv}

\csa{xintCstoCv}|{a,b,c,d,...,z}| returns the list of the corresponding
convergents. It is allowed to use fractions as coefficients (the computed
convergents have then no reason to be the real convergents of the final
fraction). When the coefficients are integers, the convergents are irreducible
fractions, but otherwise it is of course not necessarily the case.
\centeredline{|\xintListWithSep:{\xintCstoCv{1,2,3,4,5,6}}|}%
\centeredline{\digitstt{\xintListWithSep:{\xintCstoCv{1,2,3,4,5,6}}}}
\centeredline{|\xintListWithSep:{\xintCstoCv{1,1/2,1/3,1/4,1/5,1/6}}|}%
\centeredline{\digitstt{\xintListWithSep:{\xintCstoCv{1,1/2,1/3,1/4,1/5,1/6}}}}
% j'ai retiré les [0] à partir de la version 1.09b, le 3 octobre 2013.
% I
% know that these |[0]| are a bit annoying\footnote{and the awful truth is that
% it 
%   is added forcefully by \csa{xintCstoCv} at the last step\dots } but this is
% the way \xintfracname likes to reception fractions: this format is best for
% further processing by the bundle macros. For `inline' printing, one may apply
% \csb{xintRaw} and for display in math mode \csb{xintFrac}.
\centeredline{|\[\xintListWithSep{\to}{\xintApply\xintFrac{\xintCstoCv|}%
    \centeredline{|{\xintPow {-.3}{-5},7.3/4.57,\xintCstoF{3/4,9,-1/3}}}}\]|}%
\[\xintListWithSep{\to}{\xintApply\xintFrac{\xintCstoCv
       {\xintPow {-.3}{-5},7.3/4.57,\xintCstoF{3/4,9,-1/3}}}}\]


\subsection{\csbh{xintCstoGC}}\label{xintCstoGC}

\csa{xintCstoGC}|{a,b,..,z}| transforms a comma separated list (or
something expanding to such a list) into an
`inline format' continued fraction |{a}+1/{b}+1/...+1/{z}|. The
coefficients are just copied and put within braces, without expansion.
The output can then be used in \csb{xintGCFrac} for example.
\centeredline{|\[\xintGCFrac {\xintCstoGC {-1,1/2,-1/3,1/4,-1/5}}|}%
\centeredline{|=\xintSignedFrac {\xintCstoF {-1,1/2,-1/3,1/4,-1/5}}\]|}%
\[\xintGCFrac {\xintCstoGC {-1,1/2,-1/3,1/4,-1/5}} =
\xintSignedFrac{\xintCstoF {-1,1/2,-1/3,1/4,-1/5}}\]

\subsection{\csbh{xintGCtoF}}\label{xintGCtoF}

\csa{xintGCtoF}|{a+b/c+d/e+f/g+......+v/w+x/y}| computes the fraction defined by
the inline generalized continued fraction. Coefficients may be fractions but
must then be put within braces. They can be macros. The plus signs are
mandatory.
\dverb|&
\[\xintGCFrac {1+\xintPow{1.5}{3}/{1/7}+{-3/5}/\xintFac {6}} = 
\xintFrac{\xintGCtoF {1+\xintPow{1.5}{3}/{1/7}+{-3/5}/\xintFac {6}}} =
\xintFrac{\xintIrr{\xintGCtoF 
                  {1+\xintPow{1.5}{3}/{1/7}+{-3/5}/\xintFac {6}}}}\]
|
\[\xintGCFrac {1+\xintPow{1.5}{3}/{1/7}+{-3/5}/\xintFac {6}} = 
\xintFrac{\xintGCtoF {1+\xintPow{1.5}{3}/{1/7}+{-3/5}/\xintFac {6}}} =
\xintFrac{\xintIrr{\xintGCtoF {1+\xintPow{1.5}{3}/{1/7}+{-3/5}/\xintFac {6}}}}\]
\dverb|&
\[ \xintGCFrac{{1/2}+{2/3}/{4/5}+{1/2}/{1/5}+{3/2}/{5/3}} = 
   \xintFrac{\xintGCtoF {{1/2}+{2/3}/{4/5}+{1/2}/{1/5}+{3/2}/{5/3}}} \]
|
\[ \xintGCFrac{{1/2}+{2/3}/{4/5}+{1/2}/{1/5}+{3/2}/{5/3}} = 
   \xintFrac{\xintGCtoF {{1/2}+{2/3}/{4/5}+{1/2}/{1/5}+{3/2}/{5/3}}} \] 
The macro tries its best not to accumulate superfluous factor in the
denominators, but doesn't reduce the fraction to irreducible form before
returning it and does not do simplifications which would be obvious to a human.

\subsection{\csbh{xintGCtoCv}}\label{xintGCtoCv}

\csa{xintGCtoCv}|{a+b/c+d/e+f/g+......+v/w+x/y}| returns the list of the
corresponding convergents. The coefficients may be fractions, but must
then be inside braces. Or they may be macros, too. 

The convergents will in the general case be reducible. To put them into
irreducible form, one needs one more step, for example it can be done
with |\xintApply\xintIrr|.
\dverb|&
\[\xintListWithSep{,}{\xintApply\xintFrac
                {\xintGCtoCv{3+{-2}/{7/2}+{3/4}/12+{-56}/3}}}\]
\[\xintListWithSep{,}{\xintApply\xintFrac{\xintApply\xintIrr
                {\xintGCtoCv{3+{-2}/{7/2}+{3/4}/12+{-56}/3}}}}\]
|
\[\xintListWithSep{,}{\xintApply\xintFrac
                {\xintGCtoCv{3+{-2}/{7/2}+{3/4}/12+{-56}/3}}}\]
\[\xintListWithSep{,}{\xintApply\xintFrac{\xintApply\xintIrr
                {\xintGCtoCv{3+{-2}/{7/2}+{3/4}/12+{-56}/3}}}}\]

\subsection{\csbh{xintCntoF}}\label{xintCntoF}

\def\macro #1{\the\numexpr 1+#1*#1\relax}

\csa{xintCntoF}|{N}{\macro}| computes the fraction |f| having coefficients
|c(j)=\macro{j}| for |j=0,1,...,N|. The |N| parameter is given to a |\numexpr|.
The values of the coefficients, as returned by |\macro| do not have to be
positive, nor integers, and it is thus not necessarily the case that the
original |c(j)| are the true coefficients of the final |f|. \centeredline{%
  |\def\macro #1{\the\numexpr 1+#1*#1\relax}\xintCntoF {5}{\macro}|}%
\centeredline{\digitstt{\xintCntoF {5}{\macro}}}

\subsection{\csbh{xintGCntoF}}\label{xintGCntoF}

\def\coeffA #1{\the\numexpr #1+4-3*((#1+2)/3)\relax }%
\def\coeffB #1{\xintMON{#1}}% (-1)^n

\csa{xintGCntoF}|{N}{\macroA}{\macroB}| returns the fraction |f| corresponding
to the inline generalized continued fraction |a0+b0/a1+b1/a2+....+b(N-1)/aN|,
with |a(j)=\macroA{j}| and |b(j)=\macroB{j}|. The |N| parameter is given to a
|\numexpr|. 
\[\xintGCFrac{\xintGCntoGC {6}{\coeffA}{\coeffB}}
= \xintFrac{\xintGCntoF {6}{\coeffA}{\coeffB}}\]
There is also \csb{xintGCntoGC} to get the `inline format' continued
fraction. The previous display was obtained with:
\centeredline{|\def\coeffA #1{\the\numexpr #1+4-3*((#1+2)/3)\relax }%|}%
\centeredline{|\def\coeffB #1{\xintMON{#1}}% (-1)^n|}%
\centeredline{|\[\xintGCFrac{\xintGCntoGC {6}{\coeffA}{\coeffB}}|}%
\centeredline{|  = \xintFrac{\xintGCntoF  {6}{\coeffA}{\coeffB}}\]|}


\subsection{\csbh{xintCntoCs}}\label{xintCntoCs}

\csa{xintCntoCs}|{N}{\macro}| produces the comma separated list of the
corresponding coefficients, from |n=0| to |n=N|. The |N| is given to a
|\numexpr|.
\centeredline{%
|\def\macro #1{\the\numexpr 1+#1*#1\relax}|}%
\centeredline{|\xintCntoCs {5}{\macro}|\digitstt{->\xintCntoCs {5}{\macro}}}%
\centeredline{|\[\xintFrac{\xintCntoF
    {5}{\macro}}=\xintCFrac{\xintCntoF {5}{\macro}}\]|}%
\[ \xintFrac{\xintCntoF
    {5}{\macro}}=\xintCFrac{\xintCntoF {5}{\macro}}\]

\subsection{\csbh{xintCntoGC}}\label{xintCntoGC}

\def\macro #1{\the\numexpr\ifodd#1 -1-#1\else1+#1\fi\relax/%
               \the\numexpr 1+#1*#1\relax}

\csa{xintCntoGC}|{N}{\macro}| evaluates the |c(j)=\macro{j}| from |j=0|
to |j=N| and returns a continued fraction written in inline
format: |{c(0)}+1/{c(1)}+1/...+1/{c(N)}|. The parameter |N| is given to a
|\numexpr|. The coefficients, after expansion, are, as shown, being
enclosed in an added pair of braces, they may thus be
fractions.
\centeredline{%
|\def\macro #1{\the\numexpr\ifodd#1 -1-#1\else1+#1\fi\relax/%|}%
\centeredline{|\the\numexpr 1+#1*#1\relax}|}%
\centeredline{|\edef\x{\xintCntoGC {5}{\macro}}\meaning\x|}%
\centeredline{\edef\x{\xintCntoGC {5}{\macro}}\digitstt{\meaning\x}}%
\centeredline{|\[\xintGCFrac{\xintCntoGC {5}{\macro}}\]|}%
\[\xintGCFrac{\xintCntoGC {5}{\macro}}\]

\subsection{\csbh{xintGCntoGC}}\label{xintGCntoGC}

\csa{xintGCntoGC}|{N}{\macroA}{\macroB}| evaluates the coefficients and then
returns the corresponding |{a0}+{b0}/{a1}+{b1}/{a2}+...+{b(N-1)}/{aN}| inline
generalized fraction. |N| is givent to a |\numexpr|. As shown, the coefficients
are enclosed into added pairs of braces, and may thus be fractions.
\dverb|&
\def\an #1{\the\numexpr #1*#1*#1+1\relax}%
\def\bn #1{\the\numexpr \xintiMON{#1}*(#1+1)\relax}%
$\xintGCntoGC {5}{\an}{\bn}}=\xintGCFrac {\xintGCntoGC {5}{\an}{\bn}}
        = \displaystyle\xintFrac {\xintGCntoF  {5}{\an}{\bn}}$\par
|
\def\an #1{\the\numexpr #1*#1*#1+1\relax}%
\def\bn #1{\the\numexpr \xintiMON{#1}*(#1+1)\relax}%
$\xintGCntoGC {5}{\an}{\bn}=\xintGCFrac {\xintGCntoGC {5}{\an}{\bn}}
        = \displaystyle\xintFrac {\xintGCntoF  {5}{\an}{\bn}}$\par



\subsection{\csbh{xintiCstoF},~\csbh{xintiGCtoF},~\csbh{xint\-iCstoCv},~\csbh{xintiGCtoCv}}\label{xintiCstoF}
\label{xintiGCtoF}
\label{xintiCstoCv}
\label{xintiGCtoCv}

The same as the corresponding macros without the `i', but for
integer-only input. Infinitesimally faster; to notice the higher
efficiency one would need to use them with an input having (at least)
hundreds of coefficients.


\subsection{\csbh{xintGCtoGC}}\label{xintGCtoGC}

\csa{xintGCtoGC}|{a+b/c+d/e+f/g+......+v/w+x/y}| expands (with the usual
meaning) each one of the coefficients and returns an inline continued fraction
of the same type, each expanded coefficient being enclosed withing braces.
\dverb|&
\edef\x {\xintGCtoGC 
  {1+\xintPow{1.5}{3}/{1/7}+{-3/5}/\xintFac {6}+\xintCstoF {2,-7,-5}/16}}
\meaning\x
|
\edef\x {\xintGCtoGC 
     {1+\xintPow{1.5}{3}/{1/7}+{-3/5}/\xintFac {6}+\xintCstoF {2,-7,-5}/16}}
\digitstt{\meaning\x}

To be honest I have, it seems, forgotten why I wrote this macro in the
first place.

\catcode`\& 4

\makeatletter
\StopEventually{\end{document}\endinput}

\def\storedlinecounts {}
\def\StoreCodelineNo #1{\edef\storedlinecounts{\storedlinecounts
                        {{#1}{\the\c@CodelineNo}}}\c@CodelineNo\z@ }

\makeatother

\newgeometry{hmarginratio=4:3,hscale=0.75}

\def\MacroFont{\ttfamily\small\hyphenchar\font45 
               \baselineskip12pt\relax }
\MakePercentIgnore
% 
% \catcode`\<=0 \catcode`\>=11 \catcode`\*=11 \catcode`\/=11
% \let</doc>\relax
% \def<*xint>{\catcode`\<=12 \catcode`\>=12 \catcode`\*=12 \catcode`\/=12 }
%
%</doc>
%<*xint>
% \section {Package \xintname implementation}
% 
% The commenting of the macros is currently (\docdate) very sparse.
%
% With release |1.09a| all macros doing arithmetic operations and a few more
% apply 
% systematically |\xintnum| to their arguments; this adds a little overhead but
% this is 
% more convenient for using count registers even with infix notation; also this
% is what |xintfrac.sty| did all along. Simplifies the discussion in the
% documentation too. 
% 
% \localtableofcontents
% \subsection{Catcodes, \protect\eTeX{} and reload detection}
% 
% The method for package identification and reload detection is copied verbatim
% from the packages by \textsc{Heiko Oberdiek} (with some modifications starting
% with 
% release |1.09b|).
%
% The method for catcodes was also inspired by these packages, we proceed
% slightly differently. 
%
% Starting with version |1.06| of the package, also |`| must be
% catcode-protected, 
% because we replace everywhere in the code the twice-expansion done with
% |\expandafter| by the systematic use of |\romannumeral-`0|.
%
% Starting with version |1.06b| I decide that I suffer from an indigestion of @
% signs, so I replace them all with underscores |_|, \`a la \LaTeX 3. 
%
% Release |1.09b| is more economical: some macros are defined already in
% |xint.sty| and re-used in other modules. All catcode changes have been unified
% and \csa{XINT_storecatcodes} will be used by  each module
% to redefine |\XINT_restorecatcodes_endinput| in case catcodes have changed
% in-between the loading of |xint.sty| and the module (not very probable
% anyhow...). 
%
%    \begin{macrocode}
\begingroup\catcode61\catcode48\catcode32=10\relax%
  \catcode13=5    % ^^M
  \endlinechar=13 %
  \catcode123=1   % {
  \catcode125=2   % }
  \catcode64=11   % @
  \catcode95=11   % _
  \catcode35=6    % #
  \catcode44=12   % ,
  \catcode45=12   % -
  \catcode46=12   % .
  \catcode58=12   % :
  \expandafter\let\expandafter\x\csname ver@xint.sty\endcsname
  \expandafter
    \ifx\csname PackageInfo\endcsname\relax
      \def\y#1#2{\immediate\write-1{Package #1 Info: #2.}}%
    \else
      \def\y#1#2{\PackageInfo{#1}{#2}}%
    \fi
  \expandafter
  \ifx\csname numexpr\endcsname\relax
     \y{xint}{\numexpr not available, aborting input}%
     \aftergroup\endinput
  \else
    \ifx\x\relax % plain-TeX, first loading
    \else
      \def\empty {}%
      \ifx\x\empty % LaTeX, first loading,
      % variable is initialized, but \ProvidesPackage not yet seen
      \else
        \y{xint}{I was already loaded, aborting input}%
        \aftergroup\endinput
      \fi
    \fi
  \fi
  \def\ChangeCatcodesIfInputNotAborted
  {%
      \endgroup
      \def\XINT_storecatcodes
      {% takes care of all, to allow more economical code in modules
           \catcode63=\the\catcode63   % ? xintexpr
           \catcode124=\the\catcode124 % | xintexpr
           \catcode38=\the\catcode38   % & xintexpr
           \catcode64=\the\catcode64   % @ xintexpr
           \catcode33=\the\catcode33   % ! xintexpr
           \catcode93=\the\catcode93   % ] -, xintfrac, xintseries, xintcfrac
           \catcode91=\the\catcode91   % [ -, xintfrac, xintseries, xintcfrac
           \catcode36=\the\catcode36   % $ xintgcd only
        \catcode94=\the\catcode94   % ^
        \catcode96=\the\catcode96   % `
        \catcode47=\the\catcode47   % /
        \catcode41=\the\catcode41   % )
        \catcode40=\the\catcode40   % (
        \catcode42=\the\catcode42   % *
        \catcode43=\the\catcode43   % +
        \catcode62=\the\catcode62   % >
        \catcode60=\the\catcode60   % <
        \catcode58=\the\catcode58   % :
        \catcode46=\the\catcode46   % .
        \catcode45=\the\catcode45   % -
        \catcode44=\the\catcode44   % ,
        \catcode35=\the\catcode35   % #
        \catcode95=\the\catcode95   % _
        \catcode125=\the\catcode125 % }
        \catcode123=\the\catcode123 % {
        \endlinechar=\the\endlinechar
        \catcode13=\the\catcode13   % ^^M
        \catcode32=\the\catcode32   % 
        \catcode61=\the\catcode61\relax   % =
      }%
      \edef\XINT_restorecatcodes_endinput
      {%
           \XINT_storecatcodes\noexpand\endinput %
      }%
      \def\XINT_setcatcodes
      {%
        \catcode61=12   % =
        \catcode32=10   % space
        \catcode13=5    % ^^M
        \endlinechar=13 % 
        \catcode123=1   % {
        \catcode125=2   % }
        \catcode95=11   % _ (replaces @ everywhere, starting with 1.06b)
        \catcode35=6    % #
        \catcode44=12   % ,
        \catcode45=12   % -
        \catcode46=12   % .
        \catcode58=11   % : (made letter for error cs)
        \catcode60=12   % <
        \catcode62=12   % >
        \catcode43=12   % +
        \catcode42=12   % *
        \catcode40=12   % (
        \catcode41=12   % )
        \catcode47=12   % /
        \catcode96=12   % `
        \catcode94=11   % ^ 
      \catcode36=3   % $
      \catcode91=12  % [
      \catcode93=12  % ]
      \catcode33=11  % !
      \catcode64=11  % @
      \catcode38=12  % &
      \catcode124=12 % |
      \catcode63=11  % ?
      }%
      \XINT_setcatcodes
  }%
\ChangeCatcodesIfInputNotAborted 
\def\XINTsetupcatcodes {% for use by other modules
      \edef\XINT_restorecatcodes_endinput
      {%
           \XINT_storecatcodes\noexpand\endinput %
      }%
      \XINT_setcatcodes 
}%
%    \end{macrocode}
% \subsection{Package identification}
%
% Inspired from \textsc{Heiko Oberdiek}'s packages. Modified in |1.09b| to allow
% re-use in the other modules. Also I assume now that if |\ProvidesPackage|
% exists it then does define |\ver@<pkgname>.sty|, code of |HO| for some reason
% escaping me  (compatibility with LaTeX 2.09 or other things ??) seems to set
% extra precautions. 
%
%    \begin{macrocode}
\begingroup
  \catcode58=12 % : (does not matter, actually)
  \expandafter\ifx\csname ProvidesPackage\endcsname\relax
    \def\x{\endgroup
           \def\XINT_providespackage ##1##2[##3]%
              {\immediate\write-1{Package: ##2 ##3}%
               \expandafter\xdef\csname ver@##2.sty\endcsname{##3}}}%
  \else
    \def\x{\endgroup\let\XINT_providespackage\relax }%
  \fi
\x
\XINT_providespackage
\ProvidesPackage {xint}%
  [2013/10/03 v1.09b Expandable operations on long numbers (jfB)]%
%    \end{macrocode}
% \subsection{Token management, constants}
%    \begin{macrocode}
\def\xint_gobble_     {}%
\def\xint_gobble_i    #1{}%
\def\xint_gobble_ii   #1#2{}%
\def\xint_gobble_iii  #1#2#3{}%
\def\xint_gobble_iv   #1#2#3#4{}%
\def\xint_gobble_v    #1#2#3#4#5{}%
\def\xint_gobble_vi   #1#2#3#4#5#6{}%
\def\xint_gobble_vii  #1#2#3#4#5#6#7{}%
\def\xint_gobble_viii #1#2#3#4#5#6#7#8{}%
\def\xint_firstoftwo  #1#2{#1}%
\def\xint_secondoftwo #1#2{#2}%
\def\xint_firstoftwo_andstop  #1#2{ #1}%
\def\xint_secondoftwo_andstop #1#2{ #2}%
\def\xint_exchangetwo_keepbraces_andstop #1#2{ {#2}{#1}}%
\def\xint_firstofthree  #1#2#3{#1}%
\def\xint_secondofthree #1#2#3{#2}%
\def\xint_thirdofthree  #1#2#3{#3}%
\def\xint_minus_andstop { -}%
\def\xint_gob_til_R     #1\R {}%
\def\xint_gob_til_W     #1\W {}%
\def\xint_gob_til_Z     #1\Z {}%
\def\xint_gob_til_zero  #10{}%
\def\xint_gob_til_one   #11{}%
\def\xint_gob_til_G     #1G{}%
\def\xint_gob_til_minus #1-{}% was missing since 1.06b, \xintDSR could not work.
\def\xint_gob_til_zeros_iii #1000{}%
\def\xint_gob_til_zeros_iv  #10000{}%
\def\xint_gob_til_relax      #1\relax {}%
\def\xint_gob_til_xint_undef #1\xint_undef {}%
\def\xint_gob_til_xint_relax #1\xint_relax {}%
\def\xint_UDzerofork      #10\dummy  #2#3\krof {#2}%
\def\xint_UDsignfork      #1-\dummy  #2#3\krof {#2}%
\def\xint_UDwfork         #1\W\dummy #2#3\krof {#2}%
\def\xint_UDzerosfork     #100\dummy #2#3\krof {#2}%
\def\xint_UDonezerofork   #110\dummy #2#3\krof {#2}%
\def\xint_UDzerominusfork #10-\dummy #2#3\krof {#2}%
\def\xint_UDsignsfork     #1--\dummy #2#3\krof {#2}%
\def\xint_afterfi #1#2\fi {\fi #1}%
\let\xint_relax\relax
\def\xint_braced_xint_relax {\xint_relax }%
\chardef\xint_c_     0
\chardef\xint_c_i    1 
\chardef\xint_c_ii   2
\chardef\xint_c_iii  3
\chardef\xint_c_iv   4
\chardef\xint_c_v    5
\chardef\xint_c_viii 8
\chardef\xint_c_ix   9
\chardef\xint_c_x   10
\newcount\xint_c_x^viii  \xint_c_x^viii 100000000
%    \end{macrocode}
% \subsection{\csh{xintRev}, \csh{xintReverseOrder}}
% \lverb|&
% \xintRev: fait l'expansion avec \romannumeral-`0, vérifie le signe.$\
% \xintReverseOrder: ne fait PAS l'expansion, ne regarde PAS le signe.|
%    \begin{macrocode}
\def\xintRev {\romannumeral0\xintrev }%
\def\xintrev #1%
{% 
    \expandafter\XINT_rev_fork
    \romannumeral-`0#1\xint_relax % empty #1 ok
        \xint_undef\xint_undef\xint_undef\xint_undef
        \xint_undef\xint_undef\xint_undef\xint_undef
    \xint_relax
}%
\def\XINT_rev_fork #1%
{%
    \xint_UDsignfork
      #1\dummy {\expandafter\xint_minus_andstop
                \romannumeral0\XINT_rord_main {}}%
       -\dummy {\XINT_rord_main {}#1}%
    \krof
}%
\def\XINT_Rev         {\romannumeral0\XINT_rev }%
\def\xintReverseOrder {\romannumeral0\XINT_rev }%
\def\XINT_rev #1%  
{%
    \XINT_rord_main {}#1%
      \xint_relax
        \xint_undef\xint_undef\xint_undef\xint_undef
        \xint_undef\xint_undef\xint_undef\xint_undef
      \xint_relax
}%
\def\XINT_rord_main #1#2#3#4#5#6#7#8#9%  
{%
    \xint_gob_til_xint_undef #9\XINT_rord_cleanup\xint_undef
    \XINT_rord_main {#9#8#7#6#5#4#3#2#1}%
}%
\def\XINT_rord_cleanup\xint_undef\XINT_rord_main #1#2\xint_relax 
{%
    \expandafter\space\xint_gob_til_xint_relax #1%
}%
%    \end{macrocode}
% \subsection{\csh{xintRevWithBraces}}
% \lverb|New with 1.06. Makes the expansion of its argument and then reverses
% the 
% resulting tokens or braced tokens, adding a pair of braces to each (thus,
% maintaining it when it was already there.|
%    \begin{macrocode}
\def\xintRevWithBraces         {\romannumeral0\xintrevwithbraces }%
\def\xintRevWithBracesNoExpand {\romannumeral0\xintrevwithbracesnoexpand }%
\def\xintrevwithbraces #1%
{%
    \expandafter\XINT_revwbr_loop\expandafter{\expandafter}%
    \romannumeral-`0#1\xint_relax\xint_relax\xint_relax\xint_relax
                      \xint_relax\xint_relax\xint_relax\xint_relax\Z
}%
\def\xintrevwithbracesnoexpand #1%
{%
    \XINT_revwbr_loop {}%
    #1\xint_relax\xint_relax\xint_relax\xint_relax
      \xint_relax\xint_relax\xint_relax\xint_relax\Z
}%
\def\XINT_revwbr_loop #1#2#3#4#5#6#7#8#9% 
{%
    \xint_gob_til_xint_relax #9\XINT_revwbr_finish_a\xint_relax
    \XINT_revwbr_loop {{#9}{#8}{#7}{#6}{#5}{#4}{#3}{#2}#1}%
}%
\def\XINT_revwbr_finish_a\xint_relax\XINT_revwbr_loop #1#2\Z
{%
    \XINT_revwbr_finish_b #2\R\R\R\R\R\R\R\Z #1%
}%
\def\XINT_revwbr_finish_b #1#2#3#4#5#6#7#8\Z
{%
    \xint_gob_til_R 
            #1\XINT_revwbr_finish_c 8%
            #2\XINT_revwbr_finish_c 7%
            #3\XINT_revwbr_finish_c 6%
            #4\XINT_revwbr_finish_c 5%
            #5\XINT_revwbr_finish_c 4%
            #6\XINT_revwbr_finish_c 3%
            #7\XINT_revwbr_finish_c 2%
            \R\XINT_revwbr_finish_c 1\Z
}%
\def\XINT_revwbr_finish_c #1#2\Z
{%
    \expandafter\expandafter\expandafter
        \space
    \csname xint_gobble_\romannumeral #1\endcsname
}%
%    \end{macrocode}
% \subsection{\csh{xintLen}, \csh{xintLength}}
% \lverb|&
% \xintLen -> fait l'expansion, ne compte PAS le signe.$\
% \xintLength -> ne fait PAS l'expansion, compte le signe.$\
% 1.06: improved code is roughly 20$% faster than the one from earlier
% versions. 1.09a, \xintnum inserted| 
%    \begin{macrocode}
\def\xintiLen {\romannumeral0\xintilen }%
\def\xintilen #1%
{%
    \expandafter\XINT_length_fork
    \romannumeral0\xintnum{#1}\xint_relax\xint_relax\xint_relax\xint_relax
                      \xint_relax\xint_relax\xint_relax\xint_relax\Z 
}%
\let\xintLen\xintiLen \let\xintlen\xintilen
\def\XINT_Len #1%
{%
    \romannumeral0\XINT_length_fork
    #1\xint_relax\xint_relax\xint_relax\xint_relax
      \xint_relax\xint_relax\xint_relax\xint_relax\Z 
}%
\def\XINT_length_fork #1%
{%
    \expandafter\XINT_length_loop
    \xint_UDsignfork
      #1\dummy {{0}}%
       -\dummy {{0}#1}%
    \krof
}%
\def\XINT_Length {\romannumeral0\XINT_length }%
\def\XINT_length #1%
{%
    \XINT_length_loop 
    {0}#1\xint_relax\xint_relax\xint_relax\xint_relax
         \xint_relax\xint_relax\xint_relax\xint_relax\Z
}%
\let\xintLength\XINT_Length
\def\XINT_length_loop #1#2#3#4#5#6#7#8#9%
{%
    \xint_gob_til_xint_relax #9\XINT_length_finish_a\xint_relax
    \expandafter\XINT_length_loop\expandafter {\the\numexpr #1+8\relax}%
}%
\def\XINT_length_finish_a\xint_relax
    \expandafter\XINT_length_loop\expandafter #1#2\Z
{%
    \XINT_length_finish_b #2\W\W\W\W\W\W\W\Z {#1}%
}%
\def\XINT_length_finish_b #1#2#3#4#5#6#7#8\Z
{%
    \xint_gob_til_W 
            #1\XINT_length_finish_c 8%
            #2\XINT_length_finish_c 7%
            #3\XINT_length_finish_c 6%
            #4\XINT_length_finish_c 5%
            #5\XINT_length_finish_c 4%
            #6\XINT_length_finish_c 3%
            #7\XINT_length_finish_c 2%
            \W\XINT_length_finish_c 1\Z
}%
\def\XINT_length_finish_c #1#2\Z #3%
   {\expandafter\space\the\numexpr #3-#1\relax}%
%    \end{macrocode}
% \subsection{\csh{xintCSVtoList}}
% \lverb|&
% \xintCSVtoList transforms a,b,..,z into {a}{b}...{z}. The comma separated list
% may 
% be a macro which is first expanded (protect the first item with a space if it
% is not to be expanded). Each chain of spaces from the initial
% input will be collapsed as usual by the TeX initial scanning. There is no
% attempt to get rid of those spaces.
% First included in release 1.06.|
%    \begin{macrocode}
\def\xintCSVtoList {\romannumeral0\xintcsvtolist }%
\def\xintCSVtoListNoExpand {\romannumeral0\xintcsvtolistnoexpand }%
\def\xintcsvtolist #1%
{%
    \expandafter\XINT_csvtol_loop_a\expandafter 
    {\expandafter}\romannumeral-`0#1%
        ,\xint_undef,\xint_undef,\xint_undef,\xint_undef
        ,\xint_undef,\xint_undef,\xint_undef,\xint_undef,\Z
}%
\def\xintcsvtolistnoexpand #1%
{%
    \XINT_csvtol_loop_a 
    {}#1,\xint_undef,\xint_undef,\xint_undef,\xint_undef
        ,\xint_undef,\xint_undef,\xint_undef,\xint_undef,\Z
}%
\def\XINT_csvtol_loop_a #1#2,#3,#4,#5,#6,#7,#8,#9,% 
{%
    \xint_gob_til_xint_undef #9\XINT_csvtol_finish_a\xint_undef
    \XINT_csvtol_loop_b {#1}{{#2}{#3}{#4}{#5}{#6}{#7}{#8}{#9}}%
}%
\def\XINT_csvtol_loop_b #1#2{\XINT_csvtol_loop_a {#1#2}}%
\def\XINT_csvtol_finish_a\xint_undef\XINT_csvtol_loop_b #1#2#3\Z
{%
    \XINT_csvtol_finish_b #3\R,\R,\R,\R,\R,\R,\R,\Z #2{#1}%
}%
\def\XINT_csvtol_finish_b #1,#2,#3,#4,#5,#6,#7,#8\Z
{%
    \xint_gob_til_R 
            #1\XINT_csvtol_finish_c 8%
            #2\XINT_csvtol_finish_c 7%
            #3\XINT_csvtol_finish_c 6%
            #4\XINT_csvtol_finish_c 5%
            #5\XINT_csvtol_finish_c 4%
            #6\XINT_csvtol_finish_c 3%
            #7\XINT_csvtol_finish_c 2%
            \R\XINT_csvtol_finish_c 1\Z
}%
\def\XINT_csvtol_finish_c #1#2\Z
{%
    \csname XINT_csvtol_finish_d\romannumeral #1\endcsname
}%
\def\XINT_csvtol_finish_dviii #1#2#3#4#5#6#7#8#9{ #9}%
\def\XINT_csvtol_finish_dvii  #1#2#3#4#5#6#7#8#9{ #9{#1}}%
\def\XINT_csvtol_finish_dvi   #1#2#3#4#5#6#7#8#9{ #9{#1}{#2}}%
\def\XINT_csvtol_finish_dv    #1#2#3#4#5#6#7#8#9{ #9{#1}{#2}{#3}}%
\def\XINT_csvtol_finish_div   #1#2#3#4#5#6#7#8#9{ #9{#1}{#2}{#3}{#4}}%
\def\XINT_csvtol_finish_diii  #1#2#3#4#5#6#7#8#9{ #9{#1}{#2}{#3}{#4}{#5}}%
\def\XINT_csvtol_finish_dii   #1#2#3#4#5#6#7#8#9{ #9{#1}{#2}{#3}{#4}{#5}{#6}}%
\def\XINT_csvtol_finish_di    #1#2#3#4#5#6#7#8#9%
                                            { #9{#1}{#2}{#3}{#4}{#5}{#6}{#7}}%
%    \end{macrocode}
% \subsection{\csh{xintListWithSep}}
% \lverb|&
% \xintListWithSep {\sep}{{a}{b}...{z}} returns a \sep b \sep .... \sep z$\
% Included in release 1.04. The 'sep' can be \par's: the macro
% xintlistwithsep etc... are all declared long. 'sep' does not have to be a
% single token. It is not expandded. The list may be a macro and it is expanded.
% 1.06 modifies the `feature' of returning sep if the list is empty: the output
% is now empty in that case. (sep was not used for a one element list, but
% strangely it was for a zero-element list).|
%    \begin{macrocode}
\def\xintListWithSep {\romannumeral0\xintlistwithsep }%
\def\xintListWithSepNoExpand {\romannumeral0\xintlistwithsepnoexpand }%
\long\def\xintlistwithsep #1#2%
    {\expandafter\XINT_lws\expandafter {\romannumeral-`0#2}{#1}}%
\long\def\XINT_lws #1#2{\XINT_lws_start {#2}#1\Z }%
\long\def\xintlistwithsepnoexpand #1#2{\XINT_lws_start {#1}#2\Z }%
\long\def\XINT_lws_start #1#2%
{%
    \xint_gob_til_Z #2\XINT_lws_dont\Z 
    \XINT_lws_loop_a {#2}{#1}%
}%
\long\def\XINT_lws_dont\Z\XINT_lws_loop_a #1#2{ }%
\long\def\XINT_lws_loop_a #1#2#3%
{%
    \xint_gob_til_Z #3\XINT_lws_end\Z
    \XINT_lws_loop_b {#1}{#2#3}{#2}%
}%
\long\def\XINT_lws_loop_b #1#2{\XINT_lws_loop_a {#1#2}}%
\long\def\XINT_lws_end\Z\XINT_lws_loop_b #1#2#3{ #1}%
%    \end{macrocode}
% \subsection{\csh{xintNthElt}}
% \lverb|&
% \xintNthElt {i}{{a}{b}...{z}} (or `tokens' abcd...z) returns the i th
% element (one pair of braces removed). The list is first expanded.
% First included in release 1.06. With 1.06a, a value of i = 0 (or negative)
% makes the macro return the length. This is different from \xintLen which is
% for numbers (checks sign) and different from \xintLength which does not first
% expand its argument. With 1.09b, only i=0 gives the length, negative values
% return the i th element from the end.|
%    \begin{macrocode}
\def\xintNthElt         {\romannumeral0\xintnthelt }%
\def\xintNthEltNoExpand {\romannumeral0\xintntheltnoexpand }%
\def\xintnthelt #1#2%
{%
    \expandafter\XINT_nthelt_a\expandafter {\the\numexpr #1\expandafter}%
                              \expandafter {\romannumeral-`0#2}%
}%
\def\xintntheltnoexpand #1#2%
{%
    \expandafter\XINT_nthelt_a\expandafter {\the\numexpr #1}{#2}%
}%
\def\XINT_nthelt_a #1%
{%
     \ifnum #1<0 
     \expandafter\XINT_nthelt_b\else\expandafter\XINT_nthelt_c
     \fi {#1}%
}%
\def\XINT_nthelt_b #1#2%
{%
    \expandafter\XINT_nthelt_c\expandafter
               {\the\numexpr -#1\expandafter}\expandafter
               {\romannumeral0\xintrevwithbraces {#2}}%
}%
\def\XINT_nthelt_c #1#2%
{%
    \ifnum #1>\xint_c_
          \xint_afterfi {\XINT_nthelt_loop_a {#1}}%
    \else
          \xint_afterfi {\XINT_length_loop {0}}%
    \fi #2\xint_relax\xint_relax\xint_relax\xint_relax
          \xint_relax\xint_relax\xint_relax\xint_relax\Z
}%
\def\XINT_nthelt_loop_a #1%
{%
    \ifnum #1>\xint_c_viii
        \expandafter\XINT_nthelt_loop_b
    \else
        \expandafter\XINT_nthelt_getit
    \fi
    {#1}%
}%
\def\XINT_nthelt_loop_b #1#2#3#4#5#6#7#8#9%
{%
    \xint_gob_til_xint_relax #9\XINT_nthelt_silentend\xint_relax
    \expandafter\XINT_nthelt_loop_a\expandafter{\the\numexpr #1-8\relax}%
}%
\def\XINT_nthelt_silentend #1\Z { }%
\def\XINT_nthelt_getit #1%
{%
    \expandafter\expandafter\expandafter\XINT_nthelt_finish
    \csname xint_gobble_\romannumeral\numexpr#1-1\endcsname
}%
\def\XINT_nthelt_finish #1#2\Z 
{%
    \xint_UDwfork
      #1\dummy { }%
      \W\dummy { #1}%
    \krof
}%
%    \end{macrocode}
% \subsection{\csh{xintApply}}
% \lverb|&
% \xintApply {\macro}{{a}{b}...{z}} returns {\macro{a}}...{\macro{b}}
% where each instance of \macro is fully expanded. The list is first
% expanded and may thus be a macro. Introduced with release 1.04.|
%    \begin{macrocode}
\def\xintApply         {\romannumeral0\xintapply }%
\def\xintApplyNoExpand {\romannumeral0\xintapplynoexpand }%
\def\xintapply #1#2%
{%
    \expandafter\XINT_apply\expandafter {\romannumeral-`0#2}%
    {#1}%
}%
\def\XINT_apply #1#2{\XINT_apply_loop_a {}{#2}#1\Z }%
\def\xintapplynoexpand #1#2{\XINT_apply_loop_a {}{#1}#2\Z }%
\def\XINT_apply_loop_a #1#2#3%
{%
    \xint_gob_til_Z #3\XINT_apply_end\Z 
    \expandafter
    \XINT_apply_loop_b 
    \expandafter {\romannumeral-`0#2{#3}}{#1}{#2}%
}%
\def\XINT_apply_loop_b #1#2{\XINT_apply_loop_a {#2{#1}}}%
\def\XINT_apply_end\Z\expandafter\XINT_apply_loop_b\expandafter #1#2#3{ #2}%
%    \end{macrocode}
% \subsection{\csh{xintApplyUnbraced}}
% \lverb|&
% \xintApplyUnbraced {\macro}{{a}{b}...{z}} returns \macro{a}...\macro{z}
% where each instance of \macro is expanded using \romannumeral-`0. The second
% argument may be a macro as it is first expanded itself (fully). No braces
% are added: this allows for example a non-expandable \def in \macro, without
% having to do \gdef. The list is first expanded. Introduced with release 1.06b.
% Define \macro to start with a space if it is not expandable or its execution
% should be delayed only when all of \macro{a}...\macro{z} is ready. |
%    \begin{macrocode}
\def\xintApplyUnbraced {\romannumeral0\xintapplyunbraced }%
\def\xintApplyUnbracedNoExpand {\romannumeral0\xintapplyunbracednoexpand }%
\def\xintapplyunbraced #1#2%
{%
    \expandafter\XINT_applyunbr\expandafter {\romannumeral-`0#2}%
    {#1}%
}%
\def\XINT_applyunbr #1#2{\XINT_applyunbr_loop_a {}{#2}#1\Z }%
\def\xintapplyunbracednoexpand #1#2%
   {\XINT_applyunbr_loop_a {}{#1}#2\Z }%
\def\XINT_applyunbr_loop_a #1#2#3%
{%
    \xint_gob_til_Z #3\XINT_applyunbr_end\Z 
    \expandafter\XINT_applyunbr_loop_b
    \expandafter {\romannumeral-`0#2{#3}}{#1}{#2}%
}%
\def\XINT_applyunbr_loop_b #1#2{\XINT_applyunbr_loop_a {#2#1}}%
\def\XINT_applyunbr_end\Z
    \expandafter\XINT_applyunbr_loop_b\expandafter #1#2#3{ #2}%
%    \end{macrocode}
% \subsection{\csh{xintApplyInline}}
% \lverb|&
% \xintApplyInline\macro{{a}{b}...{z}} has the same effect as executing 
% \macro{a} and then applying again \xintApplyInline to the shortened list
% {{b}...{z}} until 
% nothing is left. This is a non-expandable command which will result in 
% more efficient code than using
% \xintApplyUnbraced. It uses a \futurelet and a \def and its endoflist marker
% is the catcode 11 colon. Expands (fully, not completely) its second argument
% first, which may thus be 
% a macro.|
%    \begin{macrocode}
\def\xintApplyInline #1#2%
{%
    \def\XINT_apply_themacro {#1}% 
    \expandafter\XINT_applyinline_a\romannumeral-`0#2:%
}%
\def\XINT_applyinline_a {\futurelet\XINT_apply_nexttoken\XINT_applyinline_b }%
\def\XINT_applyinline_b #1%
{%
    \ifx\XINT_apply_nexttoken :\expandafter\xint_gobble_iii\fi
    \XINT_apply_themacro {#1}\XINT_applyinline_a
}%                           
%    \end{macrocode}
% \subsection{\csh{xintAssign},~\csh{xintAssignArray},~\csh{xintDigitsOf}}
% \lverb|&
% \xintAssign {a}{b}..{z}\to\A\B...\Z,$\
% \xintAssignArray {a}{b}..{z}\to\U
%
% version 1.01 corrects an oversight in 1.0 related to the value of
% \escapechar at the time of using \xintAssignArray or \xintRelaxArray
% These macros are non-expandable. 
%
% In version 1.05a I suddenly see some incongruous \expandafter's in (what is
% called now) \XINT_assignarray_end_c, which I remove.
%
% Release 1.06 modifies the macros created by \xintAssignArray to feed their
% argument to a \numexpr. Release 1.06a detects an incredible typo in 1.01, (bad
% copy-paste from 
% \xintRelaxArray) which caused \xintAssignArray to use #1 rather than the #2 as
% in the correct earlier 1.0 version!!!  This went through undetected because
% \xint_arrayname, although weird, was still usable: the probability to
% overwrite something was almost zero. The bug got finally revealed doing 
% \xintAssignArray {}{}{}\to\Stuff.
% 
% With release 1.06b an empty argument (or expanding to empty) to
% \xintAssignArray is ok.|
%    \begin{macrocode}
\def\xintAssign #1\to
{%
    \expandafter\XINT_assign_a\romannumeral-`0#1{}\to
}%
\def\XINT_assign_a #1% attention to the # at the beginning of next line
#{%
    \def\xint_temp {#1}%
    \ifx\empty\xint_temp
        \expandafter\XINT_assign_b 
    \else
        \expandafter\XINT_assign_B
    \fi
}%
\def\XINT_assign_b #1#2\to #3%
{% 
    \edef #3{#1}\def\xint_temp {#2}%
    \ifx\empty\xint_temp
      \else
      \xint_afterfi{\XINT_assign_a #2\to }%
    \fi
}%
\def\XINT_assign_B #1\to #2%
{%
    \edef #2{\xint_temp}%
}%
\def\xintRelaxArray #1%
{%
    \edef\XINT_restoreescapechar {\escapechar\the\escapechar\relax}%
    \escapechar -1
    \edef\xint_arrayname {\string #1}%
    \XINT_restoreescapechar
    \expandafter\let\expandafter\xint_temp
                \csname\xint_arrayname 0\endcsname
    \count 255 0
    \loop
      \global\expandafter\let
             \csname\xint_arrayname\the\count255\endcsname\relax
      \ifnum \count 255 < \xint_temp
      \advance\count 255 1
    \repeat  
    \global\expandafter\let\csname\xint_arrayname 00\endcsname\relax
    \global\let #1\relax    
}%
\def\xintAssignArray #1\to #2% 1.06b: #1 may now be empty
{% 
    \edef\XINT_restoreescapechar {\escapechar\the\escapechar\relax }%
    \escapechar -1
    \edef\xint_arrayname {\string #2}%
    \XINT_restoreescapechar
    \count 255 0
    \expandafter\XINT_assignarray_loop \romannumeral-`0#1\xint_relax
    \csname\xint_arrayname 00\endcsname
    \csname\xint_arrayname 0\endcsname 
    {\xint_arrayname}%
    #2%
}%
\def\XINT_assignarray_loop #1%
{%
    \def\xint_temp {#1}%
    \ifx\xint_braced_xint_relax\xint_temp
       \expandafter\edef\csname\xint_arrayname 0\endcsname{\the\count 255 }%
       \expandafter\expandafter\expandafter\XINT_assignarray_end_a
    \else
       \advance\count 255 1
       \expandafter\edef
          \csname\xint_arrayname\the\count 255\endcsname{\xint_temp }%
       \expandafter\XINT_assignarray_loop
    \fi
}%
\def\XINT_assignarray_end_a #1%
{%
    \expandafter\XINT_assignarray_end_b\expandafter #1%
}%
\def\XINT_assignarray_end_b #1#2#3%
{%
    \expandafter\XINT_assignarray_end_c
    \expandafter #1\expandafter #2\expandafter {#3}%
}%
\def\XINT_assignarray_end_c #1#2#3#4%
{%
    \def #4##1%
    {%
        \romannumeral0\expandafter #1\expandafter{\the\numexpr ##1}%
    }%
    \def #1##1%
    {%
        \ifnum ##1< 0
            \xint_afterfi {\xintError:ArrayIndexIsNegative\space 0}%
        \else
            \xint_afterfi {%
              \ifnum ##1>#2
                  \xint_afterfi {\xintError:ArrayIndexBeyondLimit\space 0}%
              \else
                  \xint_afterfi
                  {\expandafter\expandafter\expandafter
                   \space\csname #3##1\endcsname}%
              \fi}%
        \fi
     }%
}%
\let\xintDigitsOf\xintAssignArray
%    \end{macrocode}
% \subsection{\csh{XINT\_RQ}}
% \lverb|&
% cette macro renverse et ajoute le nombre minimal de zéros à
% la fin pour que la longueur soit alors multiple de 4$\
% \romannumeral0\XINT_RQ {}<le truc à renverser>\R\R\R\R\R\R\R\R\Z$\
% Attention, ceci n'est utilisé que pour des chaînes de chiffres, et donc le
% comportement avec des {..} ou autres espaces n'a fait l'objet d'aucune
% attention |
%    \begin{macrocode}
\def\XINT_RQ #1#2#3#4#5#6#7#8#9%  
{%
    \xint_gob_til_R #9\XINT_RQ_end_a\R\XINT_RQ {#9#8#7#6#5#4#3#2#1}%
}%
\def\XINT_RQ_end_a\R\XINT_RQ #1#2\Z 
{%
    \XINT_RQ_end_b #1\Z
}%
\def\XINT_RQ_end_b #1#2#3#4#5#6#7#8%  
{%
    \xint_gob_til_R 
            #8\XINT_RQ_end_viii 
            #7\XINT_RQ_end_vii
            #6\XINT_RQ_end_vi
            #5\XINT_RQ_end_v
            #4\XINT_RQ_end_iv
            #3\XINT_RQ_end_iii
            #2\XINT_RQ_end_ii
            \R\XINT_RQ_end_i
            \Z #2#3#4#5#6#7#8%
}%
\def\XINT_RQ_end_viii #1\Z #2#3#4#5#6#7#8#9\Z { #9}%
\def\XINT_RQ_end_vii  #1\Z #2#3#4#5#6#7#8#9\Z { #8#9000}%
\def\XINT_RQ_end_vi   #1\Z #2#3#4#5#6#7#8#9\Z { #7#8#900}%
\def\XINT_RQ_end_v    #1\Z #2#3#4#5#6#7#8#9\Z { #6#7#8#90}%
\def\XINT_RQ_end_iv   #1\Z #2#3#4#5#6#7#8#9\Z { #5#6#7#8#9}%
\def\XINT_RQ_end_iii  #1\Z #2#3#4#5#6#7#8#9\Z { #4#5#6#7#8#9000}%
\def\XINT_RQ_end_ii   #1\Z #2#3#4#5#6#7#8#9\Z { #3#4#5#6#7#8#900}%
\def\XINT_RQ_end_i      \Z #1#2#3#4#5#6#7#8\Z { #1#2#3#4#5#6#7#80}%
\def\XINT_SQ #1#2#3#4#5#6#7#8%
{%
    \xint_gob_til_R #8\XINT_SQ_end_a\R\XINT_SQ {#8#7#6#5#4#3#2#1}%
}%
\def\XINT_SQ_end_a\R\XINT_SQ #1#2\Z
{%
    \XINT_SQ_end_b #1\Z
}%
\def\XINT_SQ_end_b #1#2#3#4#5#6#7%
{%
    \xint_gob_til_R
            #7\XINT_SQ_end_vii
            #6\XINT_SQ_end_vi
            #5\XINT_SQ_end_v
            #4\XINT_SQ_end_iv
            #3\XINT_SQ_end_iii
            #2\XINT_SQ_end_ii
            \R\XINT_SQ_end_i
            \Z #2#3#4#5#6#7%
}%
\def\XINT_SQ_end_vii  #1\Z #2#3#4#5#6#7#8\Z { #8}%
\def\XINT_SQ_end_vi   #1\Z #2#3#4#5#6#7#8\Z { #7#8000000}%
\def\XINT_SQ_end_v    #1\Z #2#3#4#5#6#7#8\Z { #6#7#800000}%
\def\XINT_SQ_end_iv   #1\Z #2#3#4#5#6#7#8\Z { #5#6#7#80000}%
\def\XINT_SQ_end_iii  #1\Z #2#3#4#5#6#7#8\Z { #4#5#6#7#8000}%
\def\XINT_SQ_end_ii   #1\Z #2#3#4#5#6#7#8\Z { #3#4#5#6#7#800}%
\def\XINT_SQ_end_i      \Z #1#2#3#4#5#6#7\Z { #1#2#3#4#5#6#70}%
\def\XINT_OQ #1#2#3#4#5#6#7#8#9%
{%
    \xint_gob_til_R #9\XINT_OQ_end_a\R\XINT_OQ {#9#8#7#6#5#4#3#2#1}%
}%
\def\XINT_OQ_end_a\R\XINT_OQ #1#2\Z
{%
    \XINT_OQ_end_b #1\Z
}%
\def\XINT_OQ_end_b #1#2#3#4#5#6#7#8%
{%
    \xint_gob_til_R
            #8\XINT_OQ_end_viii
            #7\XINT_OQ_end_vii
            #6\XINT_OQ_end_vi
            #5\XINT_OQ_end_v
            #4\XINT_OQ_end_iv
            #3\XINT_OQ_end_iii
            #2\XINT_OQ_end_ii
            \R\XINT_OQ_end_i
            \Z #2#3#4#5#6#7#8%
}%
\def\XINT_OQ_end_viii #1\Z #2#3#4#5#6#7#8#9\Z { #9}%
\def\XINT_OQ_end_vii  #1\Z #2#3#4#5#6#7#8#9\Z { #8#90000000}%
\def\XINT_OQ_end_vi   #1\Z #2#3#4#5#6#7#8#9\Z { #7#8#9000000}%
\def\XINT_OQ_end_v    #1\Z #2#3#4#5#6#7#8#9\Z { #6#7#8#900000}%
\def\XINT_OQ_end_iv   #1\Z #2#3#4#5#6#7#8#9\Z { #5#6#7#8#90000}%
\def\XINT_OQ_end_iii  #1\Z #2#3#4#5#6#7#8#9\Z { #4#5#6#7#8#9000}%
\def\XINT_OQ_end_ii   #1\Z #2#3#4#5#6#7#8#9\Z { #3#4#5#6#7#8#900}%
\def\XINT_OQ_end_i      \Z #1#2#3#4#5#6#7#8\Z { #1#2#3#4#5#6#7#80}%
%    \end{macrocode}
% \subsection{\csh{XINT\_cuz}}
%    \begin{macrocode}
\def\xint_cleanupzeros_andstop #1#2#3#4%
{%
    \expandafter\space\the\numexpr #1#2#3#4\relax 
}%
\def\xint_cleanupzeros_nospace #1#2#3#4%
{%
    \the\numexpr #1#2#3#4\relax 
}%
\def\XINT_rev_andcuz #1%
{%
    \expandafter\xint_cleanupzeros_andstop 
    \romannumeral0\XINT_rord_main {}#1%
      \xint_relax
        \xint_undef\xint_undef\xint_undef\xint_undef
        \xint_undef\xint_undef\xint_undef\xint_undef
      \xint_relax 
}%
%    \end{macrocode}
% \lverb|&
% routine CleanUpZeros. Utilisée en particulier par la
% soustraction.$\
% INPUT:  longueur **multiple de 4**  (<-- ATTENTION)$\
% OUTPUT: on a retiré tous les leading zéros, on n'est **plus*
% nécessairement de longueur 4n$\
% Délimiteur pour _main: \W\W\W\W\W\W\W\Z avec SEPT \W|
%    \begin{macrocode}
\def\XINT_cuz #1%
{%
    \XINT_cuz_loop #1\W\W\W\W\W\W\W\Z%
}%
\def\XINT_cuz_loop #1#2#3#4#5#6#7#8%
{%
    \xint_gob_til_W #8\xint_cuz_end_a\W
    \xint_gob_til_Z #8\xint_cuz_end_A\Z
    \XINT_cuz_check_a {#1#2#3#4#5#6#7#8}%
}%
\def\xint_cuz_end_a #1\XINT_cuz_check_a #2%
{%
    \xint_cuz_end_b #2%
}%
\def\xint_cuz_end_b #1#2#3#4#5\Z 
{%
    \expandafter\space\the\numexpr #1#2#3#4\relax
}%
\def\xint_cuz_end_A \Z\XINT_cuz_check_a #1{ 0}%
\def\XINT_cuz_check_a #1%
{%
    \expandafter\XINT_cuz_check_b\the\numexpr #1\relax
}%
\def\XINT_cuz_check_b #1%
{%
    \xint_gob_til_zero #1\xint_cuz_backtoloop 0\XINT_cuz_stop #1%
}%
\def\XINT_cuz_stop #1\W #2\Z{ #1}%
\def\xint_cuz_backtoloop 0\XINT_cuz_stop 0{\XINT_cuz_loop }%
%    \end{macrocode}
% \subsection{\csh{xintIsOne}}
% \lverb|&
% Added in 1.03. Attention: \XINT_isOne does not do any expansion. Release 1.09a
% defines \xintIsOne which is more user-friendly. Will be modified if xintfracis
% loaded. | 
%    \begin{macrocode}
\def\xintIsOne {\romannumeral0\xintisone }%
\def\xintisone #1{\expandafter\XINT_isone \romannumeral0\xintnum{#1}\W\Z }%
\def\XINT_isOne #1{\romannumeral0\XINT_isone #1\W\Z }%
\def\XINT_isone #1#2%
{%
    \xint_gob_til_one #1\XINT_isone_b 1%
    \expandafter\space\expandafter 0\xint_gob_til_Z #2%
}%
\def\XINT_isone_b #1\xint_gob_til_Z #2%
{%
    \xint_gob_til_W #2\XINT_isone_yes \W
    \expandafter\space\expandafter 0\xint_gob_til_Z
}%
\def\XINT_isone_yes #1\Z { 1}%
%    \end{macrocode}
% \subsection{\csh{xintNum}}
% \lverb|&
% For example \xintNum {----+-+++---+----000000000000003}$\
% 1.05 defines \xintiNum, which allows redefinition of \xintNum by xintfrac.sty
% Slightly modified in 1.06b (\R->\xint_relax) to avoid initial re-scan of
% input stack (while still allowing empty #1). In versions earlier than 1.09a
% it was entirely up to the user to apply \xintnum; starting with 1.09a
% arithmetic 
% macros of xint.sty (like earlier already xintfrac.sty with its own \xintnum)
% make use of \xintnum. This allows arguments to
% be count registers, or even \numexpr arbitrary long expressions (with the
% trick of braces, see the user documentation).|
%    \begin{macrocode}
\def\xintiNum {\romannumeral0\xintinum }%
\def\xintinum #1%
{%
    \expandafter\XINT_num_loop
    \romannumeral-`0#1\xint_relax\xint_relax\xint_relax\xint_relax
                      \xint_relax\xint_relax\xint_relax\xint_relax\Z 
}%
\let\xintNum\xintiNum \let\xintnum\xintinum
\def\XINT_num #1%
{%
    \XINT_num_loop #1\xint_relax\xint_relax\xint_relax\xint_relax
                     \xint_relax\xint_relax\xint_relax\xint_relax\Z 
}%
\def\XINT_num_loop #1#2#3#4#5#6#7#8%
{% 
    \xint_gob_til_xint_relax #8\XINT_num_end\xint_relax
    \XINT_num_NumEight #1#2#3#4#5#6#7#8%
}%
\def\XINT_num_end\xint_relax\XINT_num_NumEight #1\xint_relax #2\Z
{%
    \expandafter\space\the\numexpr #1+0\relax
}%
\def\XINT_num_NumEight #1#2#3#4#5#6#7#8%
{%
    \ifnum \numexpr #1#2#3#4#5#6#7#8+0= 0
      \xint_afterfi {\expandafter\XINT_num_keepsign_a
                     \the\numexpr #1#2#3#4#5#6#7#81\relax}%
    \else
      \xint_afterfi {\expandafter\XINT_num_finish
                     \the\numexpr #1#2#3#4#5#6#7#8\relax}%
    \fi
}%
\def\XINT_num_keepsign_a #1%
{%
    \xint_gob_til_one#1\XINT_num_gobacktoloop 1\XINT_num_keepsign_b  
}%
\def\XINT_num_gobacktoloop 1\XINT_num_keepsign_b {\XINT_num_loop }%
\def\XINT_num_keepsign_b #1{\XINT_num_loop -}%
\def\XINT_num_finish #1\xint_relax #2\Z { #1}%
%    \end{macrocode}
% \subsection{\csh{xintSgn}}
% \lverb|&
% Changed in 1.05. Earlier code was unnecessarily strange. 1.09a with \xintnum|
%    \begin{macrocode}
\def\xintiSgn {\romannumeral0\xintisgn }%
\def\xintisgn #1%
{%
    \expandafter\XINT_sgn \romannumeral-`0#1\Z%
}%
\def\xintSgn {\romannumeral0\xintsgn }%
\def\xintsgn #1%
{%
    \expandafter\XINT_sgn \romannumeral0\xintnum{#1}\Z%
}%
\def\XINT_Sgn #1{\romannumeral0\XINT_sgn #1\Z }%
\def\XINT_sgn #1#2\Z
{%
    \xint_UDzerominusfork
      #1-\dummy  { 0}%
      0#1\dummy  { -1}%
       0-\dummy  { 1}%
    \krof
}%
%    \end{macrocode}
% \subsection{\csh{xintSgnFork}}
% \lverb|&
% Expandable three-way fork added in 1.07. The argument #1
% must expand to -1,0 or 1. A \count should be put within a \numexpr..\relax.
% No space allowed between the condition and the branches! |
%    \begin{macrocode}
\def\xintSgnFork {\romannumeral0\xintsgnfork }%
\def\xintsgnfork #1%
{%
    \ifcase #1 \xint_afterfi{\expandafter\space\xint_secondofthree}%
            \or\xint_afterfi{\expandafter\space\xint_thirdofthree}%
          \else\xint_afterfi{\expandafter\space\xint_firstofthree}%
    \fi
}%
%    \end{macrocode}
% \subsection{\csh{xintifSgn}}
% \lverb|&
% Expandable three-way fork added in 1.09a. Branches expandably depending on
% whether if <0, =0, >0. No space between condition and branches!. The use of
% \romannumeral0\xintsgn rather than \xintSgn is related to the (partial)
% acceptability of the ternary operator : in \xintNewExpr | 
%    \begin{macrocode}
\def\xintifSgn {\romannumeral0\xintifsgn }%
\def\xintifsgn #1%
{%
    \ifcase \romannumeral0\xintsgn{#1} 
               \xint_afterfi{\expandafter\space\xint_secondofthree}%
            \or\xint_afterfi{\expandafter\space\xint_thirdofthree}%
          \else\xint_afterfi{\expandafter\space\xint_firstofthree}%
    \fi
}%
%    \end{macrocode}
% \subsection{\csh{xintifZero},~\csh{xintifNotZero}}
% \lverb|&
% Expandable two-way fork added in 1.09a. Branches expandably depending on
% whether the argument is zero (branch A) or not (branch B). No space allowed
% between 
% condition and branches!|  
%    \begin{macrocode}
\def\xintifZero {\romannumeral0\xintifzero }%
\def\xintifzero #1%
{%
    \if\xintSgn{\xintAbs{#1}}0% 
       \xint_afterfi{\expandafter\space\xint_firstoftwo}%
    \else
       \xint_afterfi{\expandafter\space\xint_secondoftwo}%
    \fi
}%
\def\xintifNotZero {\romannumeral0\xintifnotzero }%
\def\xintifnotzero #1%
{%
    \if\xintSgn{\xintAbs{#1}}1% 
       \xint_afterfi{\expandafter\space\xint_firstoftwo}%
    \else
       \xint_afterfi{\expandafter\space\xint_secondoftwo}%
    \fi
}%
%    \end{macrocode}
% \subsection{\csh{xintifEq}}
% \lverb|&
% \xintifEq {n}{m}{YES if n=m}{NO if n<>m}. No space before branches!| 
%    \begin{macrocode}
\def\xintifEq {\romannumeral0\xintifeq }%
\def\xintifeq #1#2%
{%
    \if\xintCmp{#1}{#2}0% 
               \xint_afterfi{\expandafter\space\xint_firstoftwo}%
          \else\xint_afterfi{\expandafter\space\xint_secondoftwo}%
    \fi
}%
%    \end{macrocode}
% \subsection{\csh{xintifGt}}
% \lverb|&
% \xintifEq {n}{m}{YES if n>m}{NO if n<=m}.| 
%    \begin{macrocode}
\def\xintifGt {\romannumeral0\xintifgt }%
\def\xintifgt #1#2%
{%
    \if\xintCmp{#1}{#2}1% 
               \xint_afterfi{\expandafter\space\xint_firstoftwo}%
          \else\xint_afterfi{\expandafter\space\xint_secondoftwo}%
    \fi
}%
%    \end{macrocode}
% \subsection{\csh{xintifLt}}
% \lverb|&
% \xintifEq {n}{m}{YES if n<m}{NO if n>=m}.| 
%    \begin{macrocode}
\def\xintifLt {\romannumeral0\xintiflt }%
\def\xintiflt #1#2%
{%
    \xintSgnFork{\xintCmp{#1}{#2}}% 
               {\expandafter\space\xint_firstoftwo}%
               {\expandafter\space\xint_secondoftwo}%
               {\expandafter\space\xint_secondoftwo}%
}%
%    \end{macrocode}
% \subsection{\csh{xintOpp}}
% \lverb|\xintnum added in 1.09a|
%    \begin{macrocode}
\def\xintiiOpp {\romannumeral0\xintiiopp }%
\def\xintiiopp #1%
{%
    \expandafter\XINT_opp \romannumeral-`0#1%
}%
\def\xintiOpp {\romannumeral0\xintiopp }%
\def\xintiopp #1%
{%
    \expandafter\XINT_opp \romannumeral0\xintnum{#1}%
}%
\let\xintOpp\xintiOpp \let\xintopp\xintiopp
\def\XINT_Opp #1{\romannumeral0\XINT_opp #1}%
\def\XINT_opp #1%
{%
    \xint_UDzerominusfork
      #1-\dummy  { 0}%      zero
      0#1\dummy  { }%     negative
       0-\dummy  { -#1}%  positive
    \krof
}%
%    \end{macrocode}
% \subsection{\csh{xintAbs}}
% \lverb|Release 1.09a has now \xintiabs which does \xintnum (contrarily to some
% other i-macros, but similarly as \xintiAdd etc...) and this is
% inherited by DecSplit, by Sqr, and macros of xintgcd.sty.|
%    \begin{macrocode}
\def\xintiiAbs {\romannumeral0\xintiiabs }%
\def\xintiiabs #1%
{%
    \expandafter\XINT_abs \romannumeral-`0#1%
}%
\def\xintiAbs {\romannumeral0\xintiabs }%
\def\xintiabs #1%
{%
    \expandafter\XINT_abs \romannumeral0\xintnum{#1}%
}%
\let\xintAbs\xintiAbs \let\xintabs\xintiabs
\def\XINT_Abs #1{\romannumeral0\XINT_abs #1}%
\def\XINT_abs #1%
{%
    \xint_UDsignfork
      #1\dummy  { }%
       -\dummy  { #1}%
    \krof
}%
%    \end{macrocode}
% \lverb|&
% -----------------------------------------------------------------$\
% -----------------------------------------------------------------$\
% ARITHMETIC OPERATIONS: ADDITION, SUBTRACTION, SUMS,
% MULTIPLICATION, PRODUCTS, FACTORIAL, POWERS, EUCLIDEAN DIVISION.
%
% Release 1.03 re-organizes sub-routines to facilitate future developments: the
% diverse variants of addition, with diverse conditions on inputs and output are
% first listed; they will be used in multiplication, or in the summation, or in
% the power routines. I am aware that the commenting is close to non-existent,
% sorry about that.
%
% ADDITION I: \XINT_add_A
%
% INPUT:$\
% \romannumeral0\XINT_add_A 0{}<N1>\W\X\Y\Z <N2>\W\X\Y\Z$\
%     1.    <N1> et <N2> renversés $\
%     2.    de longueur 4n (avec des leading zéros éventuels)$\
%     3.    l'un des deux ne doit pas se terminer par 0000$\$relax
% [Donc on peut avoir 0000 comme input si l'autre est >0 et ne se termine pas en
% 0000 bien sûr]. On peut avoir l'un des deux vides. Mais alors l'autre ne doit
% être ni vide ni 0000.
%
% OUTPUT: la somme <N1>+<N2>, ordre normal, plus sur 4n, pas de leading zeros
% La procédure est plus rapide lorsque <N1> est le plus court des deux.$\
% Nota bene: (30 avril 2013). J'ai une version qui est deux fois plus rapide sur
% des nombres d'environ 1000 chiffres chacun, et qui commence à être avantageuse
% pour des nombres d'au moins 200 chiffres. Cependant il serait vraiment
% compliqué d'en étendre l'utilisation aux emplois de l'addition dans les
% autres routines, comme celle de multiplication ou celle de division; et son
% implémentation ajouterait au minimum la mesure de la longueur des summands.|
%    \begin{macrocode}
\def\XINT_add_A #1#2#3#4#5#6%  
{%
    \xint_gob_til_W #3\xint_add_az\W
    \XINT_add_AB #1{#3#4#5#6}{#2}% 
}%
\def\xint_add_az\W\XINT_add_AB #1#2%  
{%
    \XINT_add_AC_checkcarry #1% 
}%
%    \end{macrocode}
% \lverb|&
% ici #2 est prévu pour l'addition, mais attention il devra être renversé
% pour \numexpr. #3 = résultat partiel. #4 = chiffres qui restent. On vérifie si
% le deuxième nombre s'arrête.|
%    \begin{macrocode}
\def\XINT_add_AB #1#2#3#4\W\X\Y\Z #5#6#7#8%  
{%
    \xint_gob_til_W #5\xint_add_bz\W 
    \XINT_add_ABE #1#2{#8#7#6#5}{#3}#4\W\X\Y\Z 
}%
\def\XINT_add_ABE #1#2#3#4#5#6%
{%
    \expandafter\XINT_add_ABEA\the\numexpr #1+10#5#4#3#2+#6\relax.%
}%
\def\XINT_add_ABEA #1#2#3.#4%  
{%
    \XINT_add_A  #2{#3#4}%
}%
%    \end{macrocode}
% \lverb|&
% ici le deuxième nombre est fini
% #6 part à la poubelle, #2#3#4#5 est le #2 dans \XINT_add_AB
% on ne vérifie pas la retenue cette fois, mais les fois suivantes|
%    \begin{macrocode}
\def\xint_add_bz\W\XINT_add_ABE #1#2#3#4#5#6%
{%
    \expandafter\XINT_add_CC\the\numexpr #1+10#5#4#3#2\relax.%
}%
\def\XINT_add_CC #1#2#3.#4%  
{%
    \XINT_add_AC_checkcarry  #2{#3#4}% on va examiner et \'eliminer #2
}%
%    \end{macrocode}
% \lverb|&
% retenue plus chiffres qui restent de l'un des deux nombres.
% #2 = résultat partiel
% #3#4#5#6 = summand, avec plus significatif à droite|
%    \begin{macrocode}
\def\XINT_add_AC_checkcarry #1%
{%
    \xint_gob_til_zero #1\xint_add_AC_nocarry 0\XINT_add_C 
}%
\def\xint_add_AC_nocarry 0\XINT_add_C #1#2\W\X\Y\Z
{%
    \expandafter
    \xint_cleanupzeros_andstop
    \romannumeral0%
    \XINT_rord_main {}#2%
      \xint_relax
        \xint_undef\xint_undef\xint_undef\xint_undef
        \xint_undef\xint_undef\xint_undef\xint_undef
      \xint_relax
    #1%
}%
\def\XINT_add_C #1#2#3#4#5%  
{%
    \xint_gob_til_W #2\xint_add_cz\W
    \XINT_add_CD {#5#4#3#2}{#1}%
}%
\def\XINT_add_CD #1%
{%
    \expandafter\XINT_add_CC\the\numexpr 1+10#1\relax.%
}%
\def\xint_add_cz\W\XINT_add_CD #1#2{ 1#2}%
%    \end{macrocode}
% \lverb|Addition II: \XINT_addr_A.$\
% INPUT: \romannumeral0\XINT_addr_A 0{}<N1>\W\X\Y\Z <N2>\W\X\Y\Z
%
% Comme \XINT_add_A, la différence principale c'est qu'elle donne son résultat
% aussi *sur 4n*, renversé. De plus cette variante accepte que l'un ou même les
% deux inputs soient vides. Utilisé par la sommation et par la division (pour
% les quotients). Et aussi par la multiplication d'ailleurs.$\ 
% INPUT: comme pour \XINT_add_A$\
%     1.    <N1> et <N2> renversés $\
%     2.    de longueur 4n (avec des leading zéros éventuels)$\
%     3.    l'un des deux ne doit pas se terminer par 0000$\
% OUTPUT: la somme <N1>+<N2>, *aussi renversée* et *sur 4n*|
%    \begin{macrocode}
\def\XINT_addr_A #1#2#3#4#5#6%  
{%
    \xint_gob_til_W #3\xint_addr_az\W
    \XINT_addr_B #1{#3#4#5#6}{#2}% 
}%
\def\xint_addr_az\W\XINT_addr_B #1#2%  
{%
    \XINT_addr_AC_checkcarry #1%
}%
\def\XINT_addr_B #1#2#3#4\W\X\Y\Z #5#6#7#8%  
{%
    \xint_gob_til_W #5\xint_addr_bz\W
    \XINT_addr_E #1#2{#8#7#6#5}{#3}#4\W\X\Y\Z 
}%
\def\XINT_addr_E #1#2#3#4#5#6%
{%
    \expandafter\XINT_addr_ABEA\the\numexpr #1+10#5#4#3#2+#6\relax
}%
\def\XINT_addr_ABEA #1#2#3#4#5#6#7%  
{%
    \XINT_addr_A  #2{#7#6#5#4#3}%
}%
\def\xint_addr_bz\W\XINT_addr_E #1#2#3#4#5#6%
{%
    \expandafter\XINT_addr_CC\the\numexpr #1+10#5#4#3#2\relax
}%
\def\XINT_addr_CC #1#2#3#4#5#6#7%  
{%
    \XINT_addr_AC_checkcarry  #2{#7#6#5#4#3}%
}%
\def\XINT_addr_AC_checkcarry #1%
{%
    \xint_gob_til_zero #1\xint_addr_AC_nocarry 0\XINT_addr_C 
}%
\def\xint_addr_AC_nocarry 0\XINT_addr_C #1#2\W\X\Y\Z { #1#2}%
\def\XINT_addr_C #1#2#3#4#5%  
{%
    \xint_gob_til_W #2\xint_addr_cz\W
    \XINT_addr_D {#5#4#3#2}{#1}%
}%
\def\XINT_addr_D #1%
{%
    \expandafter\XINT_addr_CC\the\numexpr 1+10#1\relax
}%
\def\xint_addr_cz\W\XINT_addr_D #1#2{ #21000}%
%    \end{macrocode}
% \lverb|ADDITION III, \XINT_addm_A$\
% INPUT:\romannumeral0\XINT_addm_A 0{}<N1>\W\X\Y\Z <N2>\W\X\Y\Z$\
%     1.    <N1> et <N2> renversés$\
%     2.    <N1> de longueur 4n ; <N2> non$\
%     3.    <N2> est *garanti au moins aussi long* que <N1>$\
% OUTPUT: la somme <N1>+<N2>, ordre normal, pas sur 4n, leading zeros retirés.
% Utilisé par la multiplication.|
%    \begin{macrocode}
\def\XINT_addm_A #1#2#3#4#5#6%  
{%
    \xint_gob_til_W #3\xint_addm_az\W
    \XINT_addm_AB #1{#3#4#5#6}{#2}% 
}%
\def\xint_addm_az\W\XINT_addm_AB #1#2%  
{%
    \XINT_addm_AC_checkcarry #1%
}%
\def\XINT_addm_AB #1#2#3#4\W\X\Y\Z #5#6#7#8%  
{%
    \XINT_addm_ABE #1#2{#8#7#6#5}{#3}#4\W\X\Y\Z 
}%
\def\XINT_addm_ABE #1#2#3#4#5#6%
{%
    \expandafter\XINT_addm_ABEA\the\numexpr #1+10#5#4#3#2+#6\relax.%
}%
\def\XINT_addm_ABEA #1#2#3.#4%  
{%
    \XINT_addm_A  #2{#3#4}%
}%
\def\XINT_addm_AC_checkcarry #1%
{%
    \xint_gob_til_zero #1\xint_addm_AC_nocarry 0\XINT_addm_C 
}%
\def\xint_addm_AC_nocarry 0\XINT_addm_C #1#2\W\X\Y\Z
{%
    \expandafter
    \xint_cleanupzeros_andstop
    \romannumeral0%
    \XINT_rord_main {}#2%
      \xint_relax
        \xint_undef\xint_undef\xint_undef\xint_undef
        \xint_undef\xint_undef\xint_undef\xint_undef
      \xint_relax
    #1%
}%
\def\XINT_addm_C #1#2#3#4#5%  
{%
    \xint_gob_til_W 
    #5\xint_addm_cw
    #4\xint_addm_cx 
    #3\xint_addm_cy 
    #2\xint_addm_cz 
    \W\XINT_addm_CD {#5#4#3#2}{#1}%
}%
\def\XINT_addm_CD #1%
{%
    \expandafter\XINT_addm_CC\the\numexpr 1+10#1\relax.%
}%
\def\XINT_addm_CC #1#2#3.#4%  
{%
    \XINT_addm_AC_checkcarry  #2{#3#4}%
}%
\def\xint_addm_cw 
    #1\xint_addm_cx
    #2\xint_addm_cy
    #3\xint_addm_cz
    \W\XINT_addm_CD 
{%
    \expandafter\XINT_addm_CDw\the\numexpr 1+#1#2#3\relax.%
}%
\def\XINT_addm_CDw #1.#2#3\X\Y\Z 
{%
    \XINT_addm_end #1#3%
}%
\def\xint_addm_cx 
    #1\xint_addm_cy
    #2\xint_addm_cz
    \W\XINT_addm_CD 
{%
    \expandafter\XINT_addm_CDx\the\numexpr 1+#1#2\relax.%
}%
\def\XINT_addm_CDx #1.#2#3\Y\Z 
{%
    \XINT_addm_end #1#3%
}%
\def\xint_addm_cy 
    #1\xint_addm_cz
    \W\XINT_addm_CD
{%
    \expandafter\XINT_addm_CDy\the\numexpr 1+#1\relax.%
}%
\def\XINT_addm_CDy  #1.#2#3\Z 
{%
    \XINT_addm_end #1#3%
}%
\def\xint_addm_cz\W\XINT_addm_CD #1#2#3{\XINT_addm_end #1#3}%
\def\XINT_addm_end #1#2#3#4#5%
    {\expandafter\space\the\numexpr #1#2#3#4#5\relax}%
%    \end{macrocode}
% \lverb|ADDITION IV, variante \XINT_addp_A$\
% INPUT:
% \romannumeral0\XINT_addp_A 0{}<N1>\W\X\Y\Z <N2>\W\X\Y\Z$\
%     1.    <N1> et <N2> renversés$\
%     2.    <N1> de longueur 4n ; <N2> non$\
%     3.    <N2> est *garanti au moins aussi long* que <N1>$\
% OUTPUT: la somme <N1>+<N2>, dans l'ordre renversé, sur 4n, et en faisant
% attention de ne pas terminer en 0000.
% Utilisé par la multiplication servant pour le calcul des puissances.|
%    \begin{macrocode}
\def\XINT_addp_A #1#2#3#4#5#6%  
{%
    \xint_gob_til_W #3\xint_addp_az\W
    \XINT_addp_AB #1{#3#4#5#6}{#2}% 
}%
\def\xint_addp_az\W\XINT_addp_AB #1#2%  
{%
    \XINT_addp_AC_checkcarry #1%
}%
\def\XINT_addp_AC_checkcarry #1%
{%
    \xint_gob_til_zero #1\xint_addp_AC_nocarry 0\XINT_addp_C 
}%
\def\xint_addp_AC_nocarry 0\XINT_addp_C 
{%
    \XINT_addp_F
}%
\def\XINT_addp_AB #1#2#3#4\W\X\Y\Z #5#6#7#8%  
{%
    \XINT_addp_ABE #1#2{#8#7#6#5}{#3}#4\W\X\Y\Z 
}%
\def\XINT_addp_ABE #1#2#3#4#5#6%
{%
    \expandafter\XINT_addp_ABEA\the\numexpr #1+10#5#4#3#2+#6\relax
}%
\def\XINT_addp_ABEA #1#2#3#4#5#6#7%  
{% 
   \XINT_addp_A  #2{#7#6#5#4#3}%<-- attention on met donc \`a droite
}%
\def\XINT_addp_C #1#2#3#4#5%  
{%
    \xint_gob_til_W 
    #5\xint_addp_cw
    #4\xint_addp_cx 
    #3\xint_addp_cy 
    #2\xint_addp_cz 
    \W\XINT_addp_CD   {#5#4#3#2}{#1}%
}%
\def\XINT_addp_CD #1%
{%
    \expandafter\XINT_addp_CC\the\numexpr 1+10#1\relax
}%
\def\XINT_addp_CC #1#2#3#4#5#6#7%
{%
    \XINT_addp_AC_checkcarry  #2{#7#6#5#4#3}%
}%
\def\xint_addp_cw 
    #1\xint_addp_cx
    #2\xint_addp_cy
    #3\xint_addp_cz
    \W\XINT_addp_CD 
{%
    \expandafter\XINT_addp_CDw\the\numexpr \xint_c_i+10#1#2#3\relax
}%
\def\XINT_addp_CDw #1#2#3#4#5#6%  
{%
    \xint_gob_til_zeros_iv #2#3#4#5\XINT_addp_endDw_zeros 
                          0000\XINT_addp_endDw #2#3#4#5%
}%
\def\XINT_addp_endDw_zeros 0000\XINT_addp_endDw 0000#1\X\Y\Z{ #1}%
\def\XINT_addp_endDw #1#2#3#4#5\X\Y\Z{ #5#4#3#2#1}%
\def\xint_addp_cx 
    #1\xint_addp_cy
    #2\xint_addp_cz
    \W\XINT_addp_CD 
{%
    \expandafter\XINT_addp_CDx\the\numexpr \xint_c_i+100#1#2\relax
}%
\def\XINT_addp_CDx #1#2#3#4#5#6%  
{%
    \xint_gob_til_zeros_iv #2#3#4#5\XINT_addp_endDx_zeros
                          0000\XINT_addp_endDx #2#3#4#5%
}%
\def\XINT_addp_endDx_zeros 0000\XINT_addp_endDx 0000#1\Y\Z{ #1}%
\def\XINT_addp_endDx #1#2#3#4#5\Y\Z{ #5#4#3#2#1}%
\def\xint_addp_cy #1\xint_addp_cz\W\XINT_addp_CD 
{%
    \expandafter\XINT_addp_CDy\the\numexpr \xint_c_i+1000#1\relax
}%
\def\XINT_addp_CDy #1#2#3#4#5#6%  
{%
    \xint_gob_til_zeros_iv #2#3#4#5\XINT_addp_endDy_zeros
                          0000\XINT_addp_endDy #2#3#4#5%
}%
\def\XINT_addp_endDy_zeros 0000\XINT_addp_endDy 0000#1\Z{ #1}%
\def\XINT_addp_endDy #1#2#3#4#5\Z{ #5#4#3#2#1}%
\def\xint_addp_cz\W\XINT_addp_CD #1#2{ #21000}%
\def\XINT_addp_F #1#2#3#4#5%  
{%
    \xint_gob_til_W 
    #5\xint_addp_Gw
    #4\xint_addp_Gx 
    #3\xint_addp_Gy 
    #2\xint_addp_Gz 
    \W\XINT_addp_G   {#2#3#4#5}{#1}%
}%
\def\XINT_addp_G #1#2%
{%
    \XINT_addp_F {#2#1}%
}%
\def\xint_addp_Gw 
    #1\xint_addp_Gx
    #2\xint_addp_Gy
    #3\xint_addp_Gz
    \W\XINT_addp_G #4%
{%
    \xint_gob_til_zeros_iv  #3#2#10\XINT_addp_endGw_zeros 
                          0000\XINT_addp_endGw #3#2#10%
}%
\def\XINT_addp_endGw_zeros 0000\XINT_addp_endGw 0000#1\X\Y\Z{ #1}%
\def\XINT_addp_endGw #1#2#3#4#5\X\Y\Z{ #5#1#2#3#4}%
\def\xint_addp_Gx
    #1\xint_addp_Gy
    #2\xint_addp_Gz
    \W\XINT_addp_G #3%
{%
    \xint_gob_til_zeros_iv  #2#100\XINT_addp_endGx_zeros 
                         0000\XINT_addp_endGx #2#100%
}%
\def\XINT_addp_endGx_zeros 0000\XINT_addp_endGx 0000#1\Y\Z{ #1}%
\def\XINT_addp_endGx #1#2#3#4#5\Y\Z{ #5#1#2#3#4}%
\def\xint_addp_Gy
    #1\xint_addp_Gz
    \W\XINT_addp_G #2%
{%
    \xint_gob_til_zeros_iv   #1000\XINT_addp_endGy_zeros 
                         0000\XINT_addp_endGy #1000%
}%
\def\XINT_addp_endGy_zeros 0000\XINT_addp_endGy 0000#1\Z{ #1}%
\def\XINT_addp_endGy #1#2#3#4#5\Z{ #5#1#2#3#4}%
\def\xint_addp_Gz\W\XINT_addp_G #1#2{ #2}%
%    \end{macrocode}
% \subsection{\csh{xintAdd}}
% \lverb|Release 1.09a has \xintnum added into \xintiAdd.|
%    \begin{macrocode}
\def\xintiiAdd {\romannumeral0\xintiiadd }%
\def\xintiiadd #1%
{%
    \expandafter\xint_iiadd\expandafter{\romannumeral-`0#1}%
}%
\def\xint_iiadd #1#2%
{%
    \expandafter\XINT_add_fork \romannumeral-`0#2\Z #1\Z 
}%
\def\xintiAdd {\romannumeral0\xintiadd }%
\def\xintiadd #1%
{%
    \expandafter\xint_add\expandafter{\romannumeral0\xintnum{#1}}%
}%
\def\xint_add #1#2%
{%
    \expandafter\XINT_add_fork \romannumeral0\xintnum{#2}\Z #1\Z 
}%
\let\xintAdd\xintiAdd \let\xintadd\xintiadd
\def\XINT_Add #1#2{\romannumeral0\XINT_add_fork #2\Z #1\Z }%
\def\XINT_add #1#2{\XINT_add_fork #2\Z #1\Z }%
%    \end{macrocode}
% \lverb|ADDITION 
% Ici #1#2 vient du *deuxième* argument de \xintAdd et  #3#4 donc du *premier*
% [algo plus efficace lorsque le premier est plus long que le second]|
%    \begin{macrocode}
\def\XINT_add_fork #1#2\Z #3#4\Z
{%
    \xint_UDzerofork
      #1\dummy \XINT_add_secondiszero
      #3\dummy \XINT_add_firstiszero
       0\dummy 
        {\xint_UDsignsfork
          #1#3\dummy \XINT_add_minusminus          % #1 = #3 = -
           #1-\dummy \XINT_add_minusplus           % #1 = -
           #3-\dummy \XINT_add_plusminus           % #3 = -
            --\dummy \XINT_add_plusplus
         \krof }%
    \krof
    {#2}{#4}#1#3%
}%
\def\XINT_add_secondiszero #1#2#3#4{ #4#2}%
\def\XINT_add_firstiszero #1#2#3#4{ #3#1}%
%    \end{macrocode}
% \lverb|#1 vient du *deuxième* et #2 vient du *premier*|
%    \begin{macrocode}
\def\XINT_add_minusminus #1#2#3#4%
{%
    \expandafter\xint_minus_andstop%
    \romannumeral0\XINT_add_pre {#2}{#1}%
}%
\def\XINT_add_minusplus #1#2#3#4%
{%
    \XINT_sub_pre {#4#2}{#1}%
}%
\def\XINT_add_plusminus #1#2#3#4%
{%
    \XINT_sub_pre {#3#1}{#2}%
}%
\def\XINT_add_plusplus #1#2#3#4%
{%
    \XINT_add_pre {#4#2}{#3#1}%
}%
\def\XINT_add_pre #1%
{%
  \expandafter\XINT_add_pre_b\expandafter
  {\romannumeral0\XINT_RQ {}#1\R\R\R\R\R\R\R\R\Z }%
}%
\def\XINT_add_pre_b #1#2%
{% 
    \expandafter\XINT_add_A
        \expandafter0\expandafter{\expandafter}%
    \romannumeral0\XINT_RQ {}#2\R\R\R\R\R\R\R\R\Z
        \W\X\Y\Z #1\W\X\Y\Z
}%
%    \end{macrocode}
% \subsection{\csh{xintSub}}
% \lverb|Release 1.09a has \xintnum added into \xintiSub.|
%    \begin{macrocode}
\def\xintiiSub {\romannumeral0\xintiisub }%
\def\xintiisub #1%
{%
    \expandafter\xint_iisub\expandafter{\romannumeral-`0#1}%
}%
\def\xint_iisub #1#2%
{%
    \expandafter\XINT_sub_fork \romannumeral-`0#2\Z #1\Z 
}%
\def\xintiSub {\romannumeral0\xintisub }%
\def\xintisub #1%
{%
    \expandafter\xint_sub\expandafter{\romannumeral0\xintnum{#1}}%
}%
\def\xint_sub #1#2%
{%
    \expandafter\XINT_sub_fork \romannumeral0\xintnum{#2}\Z #1\Z 
}%
\def\XINT_Sub #1#2{\romannumeral0\XINT_sub_fork #2\Z #1\Z }%
\def\XINT_sub #1#2{\XINT_sub_fork #2\Z #1\Z }%
\let\xintSub\xintiSub \let\xintsub\xintisub
%    \end{macrocode}
% \lverb|&
% SOUSTRACTION
% #3#4-#1#2:
% #3#4 vient du *premier*
% #1#2 vient du *second*|
%    \begin{macrocode}
\def\XINT_sub_fork #1#2\Z #3#4\Z
{%
    \xint_UDsignsfork
          #1#3\dummy \XINT_sub_minusminus
           #1-\dummy \XINT_sub_minusplus   % attention, #3=0 possible
           #3-\dummy \XINT_sub_plusminus   % attention, #1=0 possible
            --\dummy {\xint_UDzerofork
                      #1\dummy \XINT_sub_secondiszero
                      #3\dummy \XINT_sub_firstiszero
                       0\dummy \XINT_sub_plusplus
                      \krof }%
    \krof
    {#2}{#4}#1#3%
}%
\def\XINT_sub_secondiszero #1#2#3#4{ #4#2}%
\def\XINT_sub_firstiszero  #1#2#3#4{ -#3#1}%
\def\XINT_sub_plusplus #1#2#3#4%
{%
    \XINT_sub_pre {#4#2}{#3#1}%
}%
\def\XINT_sub_minusminus #1#2#3#4%
{%
    \XINT_sub_pre {#1}{#2}%
}%
\def\XINT_sub_minusplus #1#2#3#4% 
{%
    \xint_gob_til_zero #4\xint_sub_mp0\XINT_add_pre {#4#2}{#1}%
}%
\def\xint_sub_mp0\XINT_add_pre #1#2{ #2}%
\def\XINT_sub_plusminus #1#2#3#4% 
{%
    \xint_gob_til_zero #3\xint_sub_pm0\expandafter\xint_minus_andstop%
    \romannumeral0\XINT_add_pre {#2}{#3#1}%
}%
\def\xint_sub_pm #1\XINT_add_pre #2#3{ -#2}%
\def\XINT_sub_pre #1%
{%
  \expandafter\XINT_sub_pre_b\expandafter
  {\romannumeral0\XINT_RQ {}#1\R\R\R\R\R\R\R\R\Z }%
}%
\def\XINT_sub_pre_b #1#2%
{% 
    \expandafter\XINT_sub_A
        \expandafter1\expandafter{\expandafter}%
    \romannumeral0\XINT_RQ {}#2\R\R\R\R\R\R\R\R\Z
        \W\X\Y\Z #1 \W\X\Y\Z
}%
%    \end{macrocode}
% \lverb|&
% \romannumeral0\XINT_sub_A 1{}<N1>\W\X\Y\Z<N2>\W\X\Y\Z$\
% N1 et N2 sont présentés à l'envers ET ON A RAJOUTÉ DES ZÉROS
% POUR QUE LEURS LONGUEURS À CHACUN SOIENT MULTIPLES DE 4, MAIS
% AUCUN NE SE TERMINE EN 0000.$\ output: N2 - N1$\
% Elle donne le résultat dans le **bon ordre**, avec le bon signe,
% et sans zéros superflus.|
%    \begin{macrocode}
\def\XINT_sub_A #1#2#3\W\X\Y\Z #4#5#6#7%  
{%
    \xint_gob_til_W 
    #4\xint_sub_az 
    \W\XINT_sub_B #1{#4#5#6#7}{#2}#3\W\X\Y\Z 
}%
\def\XINT_sub_B #1#2#3#4#5#6#7%  
{%
    \xint_gob_til_W 
    #4\xint_sub_bz 
    \W\XINT_sub_onestep #1#2{#7#6#5#4}{#3}%
}%
%    \end{macrocode}
% \lverb|&
% d'abord la branche principale
% #6 = 4 chiffres de N1, plus significatif en *premier*, 
% #2#3#4#5 chiffres de N2, plus significatif en *dernier*
% On veut N2 - N1.|
%    \begin{macrocode}
\def\XINT_sub_onestep #1#2#3#4#5#6%
{%
    \expandafter\XINT_sub_backtoA\the\numexpr 11#5#4#3#2-#6+#1-\xint_c_i\relax.%
}%
%    \end{macrocode}
% \lverb|ON PRODUIT LE RÉSULTAT DANS LE BON ORDRE|
%    \begin{macrocode}
\def\XINT_sub_backtoA #1#2#3.#4%
{%
    \XINT_sub_A #2{#3#4}%
}%
\def\xint_sub_bz 
    \W\XINT_sub_onestep #1#2#3#4#5#6#7%
{%
    \xint_UDzerofork
      #1\dummy  \XINT_sub_C   % une retenue
       0\dummy  \XINT_sub_D   % pas de retenue
    \krof
    {#7}#2#3#4#5%
}%
\def\XINT_sub_D #1#2\W\X\Y\Z
{%
    \expandafter
    \xint_cleanupzeros_andstop
    \romannumeral0%
    \XINT_rord_main {}#2%
      \xint_relax
        \xint_undef\xint_undef\xint_undef\xint_undef
        \xint_undef\xint_undef\xint_undef\xint_undef
      \xint_relax
    #1%
}%
\def\XINT_sub_C #1#2#3#4#5%
{%
    \xint_gob_til_W 
    #2\xint_sub_cz 
    \W\XINT_sub_AC_onestep {#5#4#3#2}{#1}%
}%
\def\XINT_sub_AC_onestep #1%
{%
    \expandafter\XINT_sub_backtoC\the\numexpr 11#1-\xint_c_i\relax.%
}%
\def\XINT_sub_backtoC #1#2#3.#4%
{%
    \XINT_sub_AC_checkcarry #2{#3#4}% la retenue va \^etre examin\'ee
}%
\def\XINT_sub_AC_checkcarry #1%
{%
    \xint_gob_til_one #1\xint_sub_AC_nocarry 1\XINT_sub_C 
}%
\def\xint_sub_AC_nocarry 1\XINT_sub_C #1#2\W\X\Y\Z
{%
    \expandafter
    \XINT_cuz_loop
    \romannumeral0%
    \XINT_rord_main {}#2%
      \xint_relax
        \xint_undef\xint_undef\xint_undef\xint_undef
        \xint_undef\xint_undef\xint_undef\xint_undef
      \xint_relax
    #1\W\W\W\W\W\W\W\Z
}%
\def\xint_sub_cz\W\XINT_sub_AC_onestep #1%
{%
    \XINT_cuz
}%
\def\xint_sub_az\W\XINT_sub_B #1#2#3#4#5#6#7%  
{%
    \xint_gob_til_W 
    #4\xint_sub_ez 
    \W\XINT_sub_Eenter #1{#3}#4#5#6#7%
}%
%    \end{macrocode}
% \lverb|le premier nombre continue, le résultat sera < 0.|
%    \begin{macrocode}
\def\XINT_sub_Eenter #1#2%
{%
    \expandafter
    \XINT_sub_E\expandafter1\expandafter{\expandafter}%
    \romannumeral0%
    \XINT_rord_main {}#2%
      \xint_relax
        \xint_undef\xint_undef\xint_undef\xint_undef
        \xint_undef\xint_undef\xint_undef\xint_undef
      \xint_relax
    \W\X\Y\Z #1%
}%
\def\XINT_sub_E #1#2#3#4#5#6%
{%
    \xint_gob_til_W #3\xint_sub_F\W
    \XINT_sub_Eonestep #1{#6#5#4#3}{#2}%
}%
\def\XINT_sub_Eonestep #1#2%
{%
    \expandafter\XINT_sub_backtoE\the\numexpr 109999-#2+#1\relax.%
}%
\def\XINT_sub_backtoE #1#2#3.#4%
{%
    \XINT_sub_E #2{#3#4}%
}%
\def\xint_sub_F\W\XINT_sub_Eonestep #1#2#3#4%
{%
    \xint_UDonezerofork
      #4#1\dummy {\XINT_sub_Fdec 0}% soustraire  1. Et faire signe -
      #1#4\dummy {\XINT_sub_Finc 1}% additionner 1. Et faire signe -
        10\dummy  \XINT_sub_DD     % terminer. Mais avec signe -
    \krof
    {#3}%
}%
\def\XINT_sub_DD {\expandafter\xint_minus_andstop\romannumeral0\XINT_sub_D }%
\def\XINT_sub_Fdec #1#2#3#4#5#6%
{%
    \xint_gob_til_W #3\xint_sub_Fdec_finish\W
    \XINT_sub_Fdec_onestep #1{#6#5#4#3}{#2}%
}%
\def\XINT_sub_Fdec_onestep #1#2%
{%
    \expandafter\XINT_sub_backtoFdec\the\numexpr 11#2+#1-\xint_c_i\relax.%
}%
\def\XINT_sub_backtoFdec #1#2#3.#4%
{%
    \XINT_sub_Fdec #2{#3#4}%
}%
\def\xint_sub_Fdec_finish\W\XINT_sub_Fdec_onestep #1#2%
{%
    \expandafter\xint_minus_andstop\romannumeral0\XINT_cuz
}%
\def\XINT_sub_Finc #1#2#3#4#5#6%
{%
    \xint_gob_til_W #3\xint_sub_Finc_finish\W
    \XINT_sub_Finc_onestep #1{#6#5#4#3}{#2}%
}%
\def\XINT_sub_Finc_onestep #1#2%
{%
    \expandafter\XINT_sub_backtoFinc\the\numexpr 10#2+#1\relax.%
}%
\def\XINT_sub_backtoFinc #1#2#3.#4%
{%
    \XINT_sub_Finc #2{#3#4}%
}%
\def\xint_sub_Finc_finish\W\XINT_sub_Finc_onestep #1#2#3%
{%
    \xint_UDzerofork
     #1\dummy {\expandafter\xint_minus_andstop\xint_cleanupzeros_nospace}%
      0\dummy { -1}%
    \krof
    #3%
}%
\def\xint_sub_ez\W\XINT_sub_Eenter #1%
{%
    \xint_UDzerofork
      #1\dummy \XINT_sub_K % il y a une retenue
       0\dummy \XINT_sub_L % pas de retenue
    \krof
}%
\def\XINT_sub_L #1\W\X\Y\Z {\XINT_cuz_loop #1\W\W\W\W\W\W\W\Z }%
\def\XINT_sub_K #1%
{%
    \expandafter
    \XINT_sub_KK\expandafter1\expandafter{\expandafter}%
    \romannumeral0%
    \XINT_rord_main {}#1%
      \xint_relax
        \xint_undef\xint_undef\xint_undef\xint_undef
        \xint_undef\xint_undef\xint_undef\xint_undef
      \xint_relax
}%
\def\XINT_sub_KK #1#2#3#4#5#6%
{%
    \xint_gob_til_W #3\xint_sub_KK_finish\W
    \XINT_sub_KK_onestep #1{#6#5#4#3}{#2}%
}%
\def\XINT_sub_KK_onestep #1#2%
{%
    \expandafter\XINT_sub_backtoKK\the\numexpr 109999-#2+#1\relax.%
}%
\def\XINT_sub_backtoKK #1#2#3.#4%
{%
    \XINT_sub_KK #2{#3#4}%
}%
\def\xint_sub_KK_finish\W\XINT_sub_KK_onestep #1#2#3%
{%
    \expandafter\xint_minus_andstop
    \romannumeral0\XINT_cuz_loop #3\W\W\W\W\W\W\W\Z
}%
%    \end{macrocode}
% \subsection{\csh{xintCmp}}
% \lverb|Release 1.09a has \xintnum added into \xintiCmp.|
%    \begin{macrocode}
\def\xintiCmp {\romannumeral0\xinticmp }%
\def\xinticmp #1%
{%
    \expandafter\xint_cmp\expandafter{\romannumeral0\xintnum{#1}}%
}%
\let\xintCmp\xintiCmp \let\xintcmp\xinticmp
\def\xint_cmp #1#2%
{%
    \expandafter\XINT_cmp_fork \romannumeral0\xintnum{#2}\Z #1\Z 
}%
\def\XINT_Cmp #1#2{\romannumeral0\XINT_cmp_fork #2\Z #1\Z }%
%    \end{macrocode}
% \lverb|&
% COMPARAISON $\
% 1 si #3#4>#1#2, 0 si #3#4=#1#2, -1 si #3#4<#1#2$\
% #3#4 vient du *premier*,$ 
% #1#2 vient du *second*|
%    \begin{macrocode}
\def\XINT_cmp_fork #1#2\Z #3#4\Z
{%
    \xint_UDsignsfork
          #1#3\dummy \XINT_cmp_minusminus
           #1-\dummy \XINT_cmp_minusplus   
           #3-\dummy \XINT_cmp_plusminus   
            --\dummy {\xint_UDzerosfork
                      #1#3\dummy \XINT_cmp_zerozero
                       #10\dummy \XINT_cmp_zeroplus
                       #30\dummy \XINT_cmp_pluszero
                        00\dummy \XINT_cmp_plusplus
                      \krof }%
    \krof
    {#2}{#4}#1#3%
}%
\def\XINT_cmp_minusplus #1#2#3#4{ 1}%
\def\XINT_cmp_plusminus #1#2#3#4{ -1}%
\def\XINT_cmp_zerozero  #1#2#3#4{ 0}%
\def\XINT_cmp_zeroplus  #1#2#3#4{ 1}%
\def\XINT_cmp_pluszero  #1#2#3#4{ -1}%
\def\XINT_cmp_plusplus #1#2#3#4%
{%
    \XINT_cmp_pre {#4#2}{#3#1}%
}%
\def\XINT_cmp_minusminus #1#2#3#4%
{%
    \XINT_cmp_pre {#1}{#2}%
}%
\def\XINT_cmp_pre #1%
{%
  \expandafter\XINT_cmp_pre_b\expandafter
  {\romannumeral0\XINT_RQ {}#1\R\R\R\R\R\R\R\R\Z }%
}%
\def\XINT_cmp_pre_b #1#2%
{% 
    \expandafter\XINT_cmp_A
    \expandafter1\expandafter{\expandafter}%
    \romannumeral0\XINT_RQ {}#2\R\R\R\R\R\R\R\R\Z
        \W\X\Y\Z #1\W\X\Y\Z
}%
%    \end{macrocode}
% \lverb|&
% COMPARAISON$\
% N1 et N2 sont présentés à l'envers ET ON A RAJOUTÉ DES ZÉROS
% POUR QUE LEUR LONGUEURS À CHACUN SOIENT MULTIPLES DE 4, MAIS
% AUCUN NE SE TERMINE EN 0000.
% routine appelée via$\ 
% \XINT_cmp_A 1{}<N1>\W\X\Y\Z<N2>\W\X\Y\Z$\
% ATTENTION RENVOIE 1 SI N1 < N2, 0 si N1 = N2, -1 si N1 > N2|
%    \begin{macrocode}
\def\XINT_cmp_A #1#2#3\W\X\Y\Z #4#5#6#7%  
{%
    \xint_gob_til_W #4\xint_cmp_az\W
    \XINT_cmp_B #1{#4#5#6#7}{#2}#3\W\X\Y\Z 
}%
\def\XINT_cmp_B #1#2#3#4#5#6#7%  
{%
    \xint_gob_til_W#4\xint_cmp_bz\W
    \XINT_cmp_onestep #1#2{#7#6#5#4}{#3}%
}%
\def\XINT_cmp_onestep #1#2#3#4#5#6%
{%
    \expandafter\XINT_cmp_backtoA\the\numexpr 11#5#4#3#2-#6+#1-\xint_c_i\relax.%
}%
\def\XINT_cmp_backtoA #1#2#3.#4%
{%
    \XINT_cmp_A #2{#3#4}%
}%
\def\xint_cmp_bz\W\XINT_cmp_onestep #1\Z { 1}%
\def\xint_cmp_az\W\XINT_cmp_B #1#2#3#4#5#6#7%  
{%
    \xint_gob_til_W #4\xint_cmp_ez\W
    \XINT_cmp_Eenter #1{#3}#4#5#6#7%
}%
\def\XINT_cmp_Eenter #1\Z { -1}%
\def\xint_cmp_ez\W\XINT_cmp_Eenter #1%
{%
    \xint_UDzerofork
      #1\dummy \XINT_cmp_K             %     il y a une retenue
       0\dummy \XINT_cmp_L             %     pas de retenue
    \krof
}%
\def\XINT_cmp_K #1\Z { -1}%
\def\XINT_cmp_L #1{\XINT_OneIfPositive_main #1}%
\def\XINT_OneIfPositive #1%
{%
    \XINT_OneIfPositive_main #1\W\X\Y\Z%
}%
\def\XINT_OneIfPositive_main #1#2#3#4%
{%
    \xint_gob_til_Z #4\xint_OneIfPositive_terminated\Z
    \XINT_OneIfPositive_onestep #1#2#3#4%
}%
\def\xint_OneIfPositive_terminated\Z\XINT_OneIfPositive_onestep\W\X\Y\Z { 0}%
\def\XINT_OneIfPositive_onestep #1#2#3#4%
{%
    \expandafter\XINT_OneIfPositive_check\the\numexpr #1#2#3#4\relax
}%
\def\XINT_OneIfPositive_check #1%
{%
    \xint_gob_til_zero #1\xint_OneIfPositive_backtomain 0%
    \XINT_OneIfPositive_finish #1%
}%
\def\XINT_OneIfPositive_finish #1\W\X\Y\Z{ 1}%
\def\xint_OneIfPositive_backtomain 0\XINT_OneIfPositive_finish 0%
                   {\XINT_OneIfPositive_main }%
%    \end{macrocode}
% \subsection{\csh{xintEq},~\csh{xintGt},~\csh{xintLt}}
% \lverb|1.09a.|
%    \begin{macrocode}
\def\xintEq {\romannumeral0\xinteq }%
\def\xinteq #1#2{\xintifeq{#1}{#2}{1}{0}}%
\def\xintGt {\romannumeral0\xintgt }%
\def\xintgt #1#2{\xintifgt{#1}{#2}{1}{0}}%
\def\xintLt {\romannumeral0\xintlt }%
\def\xintlt #1#2{\xintiflt{#1}{#2}{1}{0}}%
%    \end{macrocode}
% \subsection{\csh{xintIsZero},~\csh{xintIsNotZero}}
% \lverb|1.09a.|
%    \begin{macrocode}
\def\xintIsZero {\romannumeral0\xintiszero }%
\def\xintiszero #1{\xintifsgn {#1}{0}{1}{0}}%
\def\xintIsNotZero {\romannumeral0\xintisnotzero }%
\def\xintisnotzero #1{\xintifsgn {#1}{1}{0}{1}}%
%    \end{macrocode}
% \subsection{\csh{xintAND},~\csh{xintOR},~\csh{xintXOR}}
% \lverb|1.09a.|
%    \begin{macrocode}
\def\xintAND {\romannumeral0\xintand }%
\def\xintand #1#2{\xintifzero {#1}{0}{\xintifzero {#2}{0}{1}}}%
\def\xintOR {\romannumeral0\xintor }%
\def\xintor #1#2{\xintifzero {#1}{\xintifzero {#2}{0}{1}}{1}}%
\def\xintXOR {\romannumeral0\xintxor }%
\def\xintxor #1#2{\ifcase \numexpr\xintIsZero{#1}+\xintIsZero{#2}\relax
                     \xint_afterfi{ 0}%
                  \or\xint_afterfi{ 1}%
                  \else\xint_afterfi { 0}%
                  \fi }%
%    \end{macrocode}
% \subsection{\csh{xintANDof}}
% \lverb|New with 1.09a. \xintANDof works with an empty list.|
%    \begin{macrocode}
\def\xintANDof      {\romannumeral0\xintandof }%
\def\xintandof    #1{\expandafter\XINT_andof_a\romannumeral-`0#1\relax }%
\def\XINT_andof_a #1{\expandafter\XINT_andof_b\romannumeral-`0#1\Z }%
\def\XINT_andof_b #1%
           {\xint_gob_til_relax #1\XINT_andof_e\relax\XINT_andof_c #1}%
\def\XINT_andof_c #1\Z 
           {\xintifZero{#1}{\XINT_andof_no}{\XINT_andof_a}}%
\def\XINT_andof_no #1\relax { 0}%
\def\XINT_andof_e #1\Z { 1}%
%    \end{macrocode}
% \subsection{\csh{xintANDof:csv}}
% \lverb|1.09a. For use by \xintexpr.|
%    \begin{macrocode}
\def\xintANDof:csv #1{\expandafter\XINT_andof:_a\romannumeral-`0#1,,^}%
\def\XINT_andof:_a {\expandafter\XINT_andof:_b\romannumeral-`0}%
\def\XINT_andof:_b #1{\if #1,\expandafter\XINT_andof:_e
                      \else\expandafter\XINT_andof:_c\fi #1}%
\def\XINT_andof:_c #1,{\xintifZero{#1}{\XINT_andof:_no}{\XINT_andof:_a}}%
\def\XINT_andof:_no #1^{0}%
\def\XINT_andof:_e  #1^{1}%
%    \end{macrocode}
% \subsection{\csh{xintORof}}
% \lverb|New with 1.09a. Works also with an empty list.|
%    \begin{macrocode}
\def\xintORof      {\romannumeral0\xintorof }%
\def\xintorof    #1{\expandafter\XINT_orof_a\romannumeral-`0#1\relax }%
\def\XINT_orof_a #1{\expandafter\XINT_orof_b\romannumeral-`0#1\Z }%
\def\XINT_orof_b #1%
           {\xint_gob_til_relax #1\XINT_orof_e\relax\XINT_orof_c #1}%
\def\XINT_orof_c #1\Z 
           {\xintifZero{#1}{\XINT_orof_a}{\XINT_orof_yes}}%
\def\XINT_orof_yes #1\relax { 1}%
\def\XINT_orof_e #1\Z { 0}%
%    \end{macrocode}
% \subsection{\csh{xintORof:csv}}
% \lverb|1.09a. For use by \xintexpr.|
%    \begin{macrocode}
\def\xintORof:csv #1{\expandafter\XINT_orof:_a\romannumeral-`0#1,,^}%
\def\XINT_orof:_a {\expandafter\XINT_orof:_b\romannumeral-`0}%
\def\XINT_orof:_b #1{\if #1,\expandafter\XINT_orof:_e
                      \else\expandafter\XINT_orof:_c\fi #1}%
\def\XINT_orof:_c #1,{\xintifZero{#1}{\XINT_orof:_a}{\XINT_orof:_yes}}%
\def\XINT_orof:_yes #1^{1}%
\def\XINT_orof:_e   #1^{0}%
%    \end{macrocode}
% \subsection{\csh{xintXORof}}
% \lverb|New with 1.09a. Works with an empty list, too.|
%    \begin{macrocode}
\def\xintXORof      {\romannumeral0\xintxorof }%
\def\xintxorof    #1{\expandafter\XINT_xorof_a\expandafter
                     0\romannumeral-`0#1\relax }%
\def\XINT_xorof_a #1#2{\expandafter\XINT_xorof_b\romannumeral-`0#2\Z #1}%
\def\XINT_xorof_b #1%
           {\xint_gob_til_relax #1\XINT_xorof_e\relax\XINT_xorof_c #1}%
\def\XINT_xorof_c #1\Z #2%
           {\xintifZero {#1}{\XINT_xorof_a #2}{\ifcase #2
                                               \xint_afterfi{\XINT_xorof_a 1}%
                                               \else
                                               \xint_afterfi{\XINT_xorof_a 0}%
                                               \fi }%
           }%
\def\XINT_xorof_e #1\Z #2{ #2}%
%    \end{macrocode}
% \subsection{\csh{xintXORof:csv}}
% \lverb|1.09a. For use by \xintexpr.|
%    \begin{macrocode}
\def\xintXORof:csv #1{\expandafter\XINT_xorof:_a\expandafter
                        0\romannumeral-`0#1,,^}%
\def\XINT_xorof:_a #1#2,{\expandafter\XINT_xorof:_b\romannumeral-`0#2,#1}%
\def\XINT_xorof:_b #1{\if #1,\expandafter\XINT_xorof:_e
                      \else\expandafter\XINT_xorof:_c\fi #1}%
\def\XINT_xorof:_c #1,#2%
           {\xintifZero {#1}{\XINT_xorof:_a #2}{\ifcase #2
                                               \xint_afterfi{\XINT_xorof:_a 1}%
                                               \else
                                               \xint_afterfi{\XINT_xorof:_a 0}%
                                               \fi }%
           }%
\def\XINT_xorof:_e  ,#1#2^{#1}% allows empty list
%    \end{macrocode}
% \subsection{\csh{xintGeq}}
% \lverb|& 
% Release 1.09a has \xintnum added into \xintiGeq.
% PLUS GRAND OU ÉGAL
% attention compare les **valeurs absolues**|
%    \begin{macrocode}
\def\xintiGeq {\romannumeral0\xintigeq }%
\def\xintigeq #1%
{%
    \expandafter\xint_geq\expandafter {\romannumeral0\xintnum{#1}}%
}%
\let\xintGeq\xintiGeq \let\xintgeq\xintigeq
\def\xint_geq #1#2%
{%
    \expandafter\XINT_geq_fork \romannumeral0\xintnum{#2}\Z #1\Z 
}%
\def\XINT_Geq #1#2{\romannumeral0\XINT_geq_fork #2\Z #1\Z }%
%    \end{macrocode}
% \lverb|&
% PLUS GRAND OU ÉGAL 
% ATTENTION, TESTE les VALEURS ABSOLUES|
%    \begin{macrocode}
\def\XINT_geq_fork #1#2\Z #3#4\Z
{%
    \xint_UDzerofork
      #1\dummy \XINT_geq_secondiszero % |#1#2|=0
      #3\dummy \XINT_geq_firstiszero % |#1#2|>0
       0\dummy {\xint_UDsignsfork
                  #1#3\dummy \XINT_geq_minusminus
                   #1-\dummy \XINT_geq_minusplus   
                   #3-\dummy \XINT_geq_plusminus
                    --\dummy \XINT_geq_plusplus
                \krof }%
    \krof
    {#2}{#4}#1#3%
}%
\def\XINT_geq_secondiszero     #1#2#3#4{ 1}%
\def\XINT_geq_firstiszero      #1#2#3#4{ 0}%
\def\XINT_geq_plusplus   #1#2#3#4{\XINT_geq_pre {#4#2}{#3#1}}%
\def\XINT_geq_minusminus #1#2#3#4{\XINT_geq_pre {#2}{#1}}%
\def\XINT_geq_minusplus  #1#2#3#4{\XINT_geq_pre {#4#2}{#1}}%
\def\XINT_geq_plusminus  #1#2#3#4{\XINT_geq_pre {#2}{#3#1}}%
\def\XINT_geq_pre #1%
{%
  \expandafter\XINT_geq_pre_b\expandafter
  {\romannumeral0\XINT_RQ {}#1\R\R\R\R\R\R\R\R\Z }%
}%
\def\XINT_geq_pre_b #1#2%
{% 
    \expandafter\XINT_geq_A
    \expandafter1\expandafter{\expandafter}%
    \romannumeral0\XINT_RQ {}#2\R\R\R\R\R\R\R\R\Z
        \W\X\Y\Z #1 \W\X\Y\Z
}%
%    \end{macrocode}
% \lverb|&
% PLUS GRAND OU ÉGAL$\
% N1 et N2 sont présentés à l'envers ET ON A RAJOUTÉ DES ZÉROS
% POUR QUE LEURS LONGUEURS À CHACUN SOIENT MULTIPLES DE 4, MAIS
% AUCUN NE SE TERMINE EN 0000$\
% routine appelée via$\ 
% \romannumeral0\XINT_geq_A 1{}<N1>\W\X\Y\Z<N2>\W\X\Y\Z$\
% ATTENTION RENVOIE 1 SI N1 < N2 ou N1 = N2 et 0 si N1 > N2|
%    \begin{macrocode}
\def\XINT_geq_A #1#2#3\W\X\Y\Z #4#5#6#7%  
{%
    \xint_gob_til_W #4\xint_geq_az\W
    \XINT_geq_B #1{#4#5#6#7}{#2}#3\W\X\Y\Z 
}%
\def\XINT_geq_B #1#2#3#4#5#6#7%  
{%
    \xint_gob_til_W #4\xint_geq_bz\W
    \XINT_geq_onestep #1#2{#7#6#5#4}{#3}%
}%
\def\XINT_geq_onestep #1#2#3#4#5#6%
{%
    \expandafter\XINT_geq_backtoA\the\numexpr 11#5#4#3#2-#6+#1-\xint_c_i\relax.%
}%
\def\XINT_geq_backtoA #1#2#3.#4%
{%
    \XINT_geq_A #2{#3#4}%
}%
\def\xint_geq_bz\W\XINT_geq_onestep #1\W\X\Y\Z { 1}%
\def\xint_geq_az\W\XINT_geq_B #1#2#3#4#5#6#7%  
{%
    \xint_gob_til_W #4\xint_geq_ez\W
    \XINT_geq_Eenter #1%
}%
\def\XINT_geq_Eenter #1\W\X\Y\Z { 0}%
\def\xint_geq_ez\W\XINT_geq_Eenter #1%
{%
    \xint_UDzerofork
      #1\dummy { 0}             %     il y a une retenue
       0\dummy { 1}             %     pas de retenue
    \krof
}%
%    \end{macrocode}
% \subsection{\csh{xintMax}}
% \lverb|&
% The rationale is that it is more efficient than using \xintCmp.
% 1.03 makes the code a tiny bit slower but easier to re-use for fractions.
% Note: actually since 1.08a code for fractions does not all reduce to these
% entry points, so perhaps I should revert the changes made in 1.03. Release
% 1.09a has \xintnum added into \xintiMax.| 
%    \begin{macrocode}
\def\xintiMax {\romannumeral0\xintimax }%
\def\xintimax #1%
{%
    \expandafter\xint_max\expandafter {\romannumeral0\xintnum{#1}}%
}%
\let\xintMax\xintiMax \let\xintmax\xintimax
\def\xint_max #1#2%
{%
    \expandafter\XINT_max_pre\expandafter {\romannumeral0\xintnum{#2}}{#1}%
}%
\def\XINT_max_pre #1#2{\XINT_max_fork #1\Z #2\Z {#2}{#1}}%
\def\XINT_Max #1#2{\romannumeral0\XINT_max_fork #2\Z #1\Z {#1}{#2}}%
%    \end{macrocode}
% \lverb|&
% #3#4 vient du *premier*,
% #1#2 vient du *second*|
%    \begin{macrocode}
\def\XINT_max_fork #1#2\Z #3#4\Z
{%
    \xint_UDsignsfork
          #1#3\dummy \XINT_max_minusminus  % A < 0, B < 0
           #1-\dummy \XINT_max_minusplus   % B < 0, A >= 0   
           #3-\dummy \XINT_max_plusminus   % A < 0, B >= 0 
            --\dummy {\xint_UDzerosfork
                      #1#3\dummy \XINT_max_zerozero % A = B = 0
                       #10\dummy \XINT_max_zeroplus % B = 0, A > 0
                       #30\dummy \XINT_max_pluszero % A = 0, B > 0
                        00\dummy \XINT_max_plusplus % A, B > 0
                      \krof }%
    \krof
    {#2}{#4}#1#3%
}%
%    \end{macrocode}
% \lverb|&
% A = #4#2, B = #3#1|
%    \begin{macrocode}
\def\XINT_max_zerozero  #1#2#3#4{\xint_firstoftwo_andstop }%
\def\XINT_max_zeroplus  #1#2#3#4{\xint_firstoftwo_andstop }%
\def\XINT_max_pluszero  #1#2#3#4{\xint_secondoftwo_andstop }%
\def\XINT_max_minusplus #1#2#3#4{\xint_firstoftwo_andstop }%
\def\XINT_max_plusminus #1#2#3#4{\xint_secondoftwo_andstop }%
\def\XINT_max_plusplus  #1#2#3#4%
{%
    \ifodd\XINT_Geq {#4#2}{#3#1}
      \expandafter\xint_firstoftwo_andstop
    \else
      \expandafter\xint_secondoftwo_andstop
    \fi
}%
%    \end{macrocode}
% \lverb+#3=-, #4=-, #1 = |B| = -B, #2 = |A| = -A+
%    \begin{macrocode}
\def\XINT_max_minusminus #1#2#3#4%
{%
    \ifodd\XINT_Geq {#1}{#2}
      \expandafter\xint_firstoftwo_andstop
    \else
      \expandafter\xint_secondoftwo_andstop
    \fi
}%
%    \end{macrocode}
% \subsection{\csh{xintMaxof}}
% \lverb|New with 1.09a|.
%    \begin{macrocode}
\def\xintiMaxof      {\romannumeral0\xintimaxof }%
\def\xintimaxof    #1{\expandafter\XINT_imaxof_a\romannumeral-`0#1\relax }%
\def\XINT_imaxof_a #1{\expandafter\XINT_imaxof_b\romannumeral0\xintnum{#1}\Z }%
\def\XINT_imaxof_b #1\Z #2%
           {\expandafter\XINT_imaxof_c\romannumeral-`0#2\Z {#1}\Z}%
\def\XINT_imaxof_c #1%
           {\xint_gob_til_relax #1\XINT_imaxof_e\relax\XINT_imaxof_d #1}%
\def\XINT_imaxof_d #1\Z 
           {\expandafter\XINT_imaxof_b\romannumeral0\xintimax {#1}}%
\def\XINT_imaxof_e #1\Z #2\Z { #2}%
\let\xintMaxof\xintiMaxof \let\xintmaxof\xintimaxof
%    \end{macrocode}
% \subsection{\csh{xintMin}}
% \lverb|\xintnum added New with 1.09a|.
%    \begin{macrocode}
\def\xintiMin {\romannumeral0\xintimin }%
\def\xintimin #1%
{%
    \expandafter\xint_min\expandafter {\romannumeral0\xintnum{#1}}%
}%
\let\xintMin\xintiMin \let\xintmin\xintimin
\def\xint_min #1#2%
{%
    \expandafter\XINT_min_pre\expandafter {\romannumeral0\xintnum{#2}}{#1}%
}%
\def\XINT_min_pre #1#2{\XINT_min_fork #1\Z #2\Z {#2}{#1}}%
\def\XINT_Min #1#2{\romannumeral0\XINT_min_fork #2\Z #1\Z {#1}{#2}}%
%    \end{macrocode}
% \lverb|&
% #3#4 vient du *premier*,
% #1#2 vient du *second*|
%    \begin{macrocode}
\def\XINT_min_fork #1#2\Z #3#4\Z
{%
    \xint_UDsignsfork
          #1#3\dummy \XINT_min_minusminus  % A < 0, B < 0
           #1-\dummy \XINT_min_minusplus   % B < 0, A >= 0   
           #3-\dummy \XINT_min_plusminus   % A < 0, B >= 0 
            --\dummy {\xint_UDzerosfork
                      #1#3\dummy \XINT_min_zerozero % A = B = 0
                       #10\dummy \XINT_min_zeroplus % B = 0, A > 0
                       #30\dummy \XINT_min_pluszero % A = 0, B > 0
                        00\dummy \XINT_min_plusplus % A, B > 0
                      \krof }%
    \krof
    {#2}{#4}#1#3%
}%
%    \end{macrocode}
% \lverb|&
% A = #4#2, B = #3#1|
%    \begin{macrocode}
\def\XINT_min_zerozero  #1#2#3#4{\xint_firstoftwo_andstop }%
\def\XINT_min_zeroplus  #1#2#3#4{\xint_secondoftwo_andstop }%
\def\XINT_min_pluszero  #1#2#3#4{\xint_firstoftwo_andstop }%
\def\XINT_min_minusplus #1#2#3#4{\xint_secondoftwo_andstop }%
\def\XINT_min_plusminus #1#2#3#4{\xint_firstoftwo_andstop }%
\def\XINT_min_plusplus  #1#2#3#4%
{%
    \ifodd\XINT_Geq {#4#2}{#3#1}
      \expandafter\xint_secondoftwo_andstop
    \else
      \expandafter\xint_firstoftwo_andstop
    \fi
}%
%    \end{macrocode}
% \lverb+#3=-, #4=-, #1 = |B| = -B, #2 = |A| = -A+
%    \begin{macrocode}
\def\XINT_min_minusminus #1#2#3#4%
{%
    \ifodd\XINT_Geq {#1}{#2}
      \expandafter\xint_secondoftwo_andstop
    \else
      \expandafter\xint_firstoftwo_andstop
    \fi
}%
%    \end{macrocode}
% \subsection{\csh{xintMinof}}
% \lverb|1.09a|
%    \begin{macrocode}
\def\xintiMinof      {\romannumeral0\xintiminof }%
\def\xintiminof    #1{\expandafter\XINT_iminof_a\romannumeral-`0#1\relax }%
\def\XINT_iminof_a #1{\expandafter\XINT_iminof_b\romannumeral0\xintnum{#1}\Z }%
\def\XINT_iminof_b #1\Z #2%
           {\expandafter\XINT_iminof_c\romannumeral-`0#2\Z {#1}\Z}%
\def\XINT_iminof_c #1%
           {\xint_gob_til_relax #1\XINT_iminof_e\relax\XINT_iminof_d #1}%
\def\XINT_iminof_d #1\Z 
           {\expandafter\XINT_iminof_b\romannumeral0\xintimin {#1}}%
\def\XINT_iminof_e #1\Z #2\Z { #2}%
\let\xintMinof\xintiMinof \let\xintminof\xintiminof
%    \end{macrocode}
% \subsection{\csh{xintSum}, \csh{xintSumExpr}}
% \lverb|&
% \xintSum {{a}{b}...{z}}$\
% \xintSumExpr {a}{b}...{z}\relax$\
% 1.03 (drastically) simplifies and makes the routines more efficient (for big
% computations). Also the way \xintSum and \xintSumExpr ...\relax are related.
% has been modified. Now \xintSumExpr \z \relax is accepted input when
% \z expands to a list of braced terms (prior only \xintSum {\z} or \xintSum \z
% was possible). 1.09a does NOT add \xintnum (I would need for this to
% re-organize the code first). |
%    \begin{macrocode}
\def\xintiSum {\romannumeral0\xintisum }%
\def\xintisum #1{\xintisumexpr #1\relax }%
\def\xintiSumExpr {\romannumeral0\xintisumexpr }%
\def\xintisumexpr {\expandafter\XINT_sumexpr\romannumeral-`0}%
\let\xintSum\xintiSum \let\xintsum\xintisum 
\let\xintSumExpr\xintiSumExpr \let\xintsumexpr\xintisumexpr
\def\XINT_sumexpr {\XINT_sum_loop {0000}{0000}}%
\def\XINT_sum_loop #1#2#3%
{%
    \expandafter\XINT_sum_checksign\romannumeral-`0#3\Z {#1}{#2}%
}%
\def\XINT_sum_checksign #1%
{%
    \xint_gob_til_relax #1\XINT_sum_finished\relax
    \xint_gob_til_zero #1\XINT_sum_skipzeroinput0%
    \xint_UDsignfork
      #1\dummy \XINT_sum_N
       -\dummy {\XINT_sum_P #1}%
    \krof
}%
\def\XINT_sum_finished #1\Z #2#3%
{%
    \XINT_sub_A 1{}#3\W\X\Y\Z #2\W\X\Y\Z
}%
\def\XINT_sum_skipzeroinput #1\krof #2\Z {\XINT_sum_loop }%
\def\XINT_sum_P #1\Z #2%
{%
    \expandafter\XINT_sum_loop\expandafter
    {\romannumeral0\expandafter
     \XINT_addr_A\expandafter0\expandafter{\expandafter}%
    \romannumeral0\XINT_RQ {}#1\R\R\R\R\R\R\R\R\Z
    \W\X\Y\Z #2\W\X\Y\Z }%
}%
\def\XINT_sum_N #1\Z #2#3%
{%
    \expandafter\XINT_sum_NN\expandafter
    {\romannumeral0\expandafter
     \XINT_addr_A\expandafter0\expandafter{\expandafter}%
    \romannumeral0\XINT_RQ {}#1\R\R\R\R\R\R\R\R\Z
    \W\X\Y\Z #3\W\X\Y\Z }{#2}%
}%
\def\XINT_sum_NN #1#2{\XINT_sum_loop {#2}{#1}}%
%    \end{macrocode}
% \subsection{\csh{xintMul}}
% \lverb|1.09a adds \xintnum|
%    \begin{macrocode}
\def\xintiiMul {\romannumeral0\xintiimul }%
\def\xintiimul #1%
{%
    \expandafter\xint_iimul\expandafter {\romannumeral-`0#1}%
}%
\def\xint_iimul #1#2%
{%
    \expandafter\XINT_mul_fork \romannumeral-`0#2\Z #1\Z 
}%
\def\xintiMul {\romannumeral0\xintimul }%
\def\xintimul #1%
{%
    \expandafter\xint_mul\expandafter {\romannumeral0\xintnum{#1}}%
}%
\def\xint_mul #1#2%
{%
    \expandafter\XINT_mul_fork \romannumeral0\xintnum{#2}\Z #1\Z 
}%
\let\xintMul\xintiMul \let\xintmul\xintimul
\def\XINT_Mul #1#2{\romannumeral0\XINT_mul_fork #2\Z #1\Z }%
%    \end{macrocode}
% \lverb|&
% MULTIPLICATION$\
% Ici #1#2 = 2e input et #3#4 = 1er input $\
% Release 1.03 adds some overhead to first compute and compare the
% lengths of the two inputs. The algorithm is asymmetrical and whether
% the first input is the longest or the shortest sometimes has a strong
% impact. 50 digits times 1000 digits used to be 5 times faster
% than 1000 digits times 50 digits. With the new code, the user input
% order does not matter as it is decided by the routine what is best.
% This is important for  the extension to fractions, as there is no way
% then to generally control or guess the most frequent sizes of the
% inputs besides actually computing their lengths.  |
%    \begin{macrocode}
\def\XINT_mul_fork #1#2\Z #3#4\Z
{%
    \xint_UDzerofork
      #1\dummy \XINT_mul_zero
      #3\dummy \XINT_mul_zero
       0\dummy 
        {\xint_UDsignsfork
          #1#3\dummy \XINT_mul_minusminus          % #1 = #3 = -
           #1-\dummy {\XINT_mul_minusplus #3}%          % #1 = -
           #3-\dummy {\XINT_mul_plusminus #1}%          % #3 = -
            --\dummy {\XINT_mul_plusplus #1#3}%
         \krof }%
    \krof
    {#2}{#4}%
}%
\def\XINT_mul_zero #1#2{ 0}%
\def\XINT_mul_minusminus #1#2%
{%
      \expandafter\XINT_mul_choice_a
      \expandafter{\romannumeral0\XINT_length {#2}}%
      {\romannumeral0\XINT_length {#1}}{#1}{#2}%
}%
\def\XINT_mul_minusplus #1#2#3%
{%
    \expandafter\xint_minus_andstop\romannumeral0\expandafter
    \XINT_mul_choice_a
    \expandafter{\romannumeral0\XINT_length {#1#3}}%
    {\romannumeral0\XINT_length {#2}}{#2}{#1#3}%
}%
\def\XINT_mul_plusminus #1#2#3%
{%
    \expandafter\xint_minus_andstop\romannumeral0\expandafter
    \XINT_mul_choice_a
    \expandafter{\romannumeral0\XINT_length {#3}}%
    {\romannumeral0\XINT_length {#1#2}}{#1#2}{#3}%
}%
\def\XINT_mul_plusplus #1#2#3#4%
{%
    \expandafter\XINT_mul_choice_a
    \expandafter{\romannumeral0\XINT_length {#2#4}}%
    {\romannumeral0\XINT_length {#1#3}}{#1#3}{#2#4}%
}%
\def\XINT_mul_choice_a #1#2%
{%
    \expandafter\XINT_mul_choice_b\expandafter{#2}{#1}%
}%
\def\XINT_mul_choice_b #1#2%
{%
    \ifnum #1<\xint_c_v
       \expandafter\XINT_mul_choice_littlebyfirst
    \else
    \ifnum #2<\xint_c_v
      \expandafter\expandafter\expandafter\XINT_mul_choice_littlebysecond
      \else
      \expandafter\expandafter\expandafter\XINT_mul_choice_compare
      \fi
    \fi      
    {#1}{#2}%
}%
\def\XINT_mul_choice_littlebyfirst #1#2#3#4%
{%
    \expandafter\XINT_mul_M
    \expandafter{\the\numexpr #3\expandafter}%
    \romannumeral0\XINT_RQ {}#4\R\R\R\R\R\R\R\R\Z \Z\Z\Z\Z
}%
\def\XINT_mul_choice_littlebysecond #1#2#3#4%
{%
    \expandafter\XINT_mul_M
    \expandafter{\the\numexpr #4\expandafter}%
    \romannumeral0\XINT_RQ {}#3\R\R\R\R\R\R\R\R\Z \Z\Z\Z\Z
}%
\def\XINT_mul_choice_compare #1#2%
{%
    \ifnum #1>#2
        \expandafter \XINT_mul_choice_i
    \else
        \expandafter \XINT_mul_choice_ii
    \fi
    {#1}{#2}%
}%
\def\XINT_mul_choice_i #1#2%
{%
   \ifnum #1<\numexpr\ifcase \numexpr (#2-\xint_c_iii)/\xint_c_iv\relax
                     \or 330\or 168\or 109\or 80\or 66\or 52\else 0\fi\relax
       \expandafter\XINT_mul_choice_same   
   \else
       \expandafter\XINT_mul_choice_permute
   \fi
}% 
\def\XINT_mul_choice_ii #1#2%
{%
   \ifnum #2<\numexpr\ifcase \numexpr (#1-\xint_c_iii)/\xint_c_iv\relax
                     \or 330\or 168\or 109\or 80\or 66\or 52\else 0\fi\relax
       \expandafter\XINT_mul_choice_permute  
   \else
       \expandafter\XINT_mul_choice_same
   \fi
}% 
\def\XINT_mul_choice_same #1#2%
{%
    \expandafter\XINT_mul_enter
    \romannumeral0\XINT_RQ {}#1\R\R\R\R\R\R\R\R\Z
    \Z\Z\Z\Z #2\W\W\W\W
}%
\def\XINT_mul_choice_permute #1#2%
{%
    \expandafter\XINT_mul_enter
    \romannumeral0\XINT_RQ {}#2\R\R\R\R\R\R\R\R\Z
    \Z\Z\Z\Z #1\W\W\W\W 
}%
%    \end{macrocode}
% \lverb|&
% Cette portion de routine d'addition se branche directement sur _addr_
% lorsque 
% le premier nombre est épuisé, ce qui est garanti arriver avant le second
% nombre. Elle produit son résultat toujours sur 4n, renversé. Ses deux inputs
% sont garantis sur 4n.|
%    \begin{macrocode}
\def\XINT_mul_Ar #1#2#3#4#5#6%  
{%
    \xint_gob_til_Z #6\xint_mul_br\Z\XINT_mul_Br #1{#6#5#4#3}{#2}% 
}%
\def\xint_mul_br\Z\XINT_mul_Br #1#2%  
{%
     \XINT_addr_AC_checkcarry #1%
}%
\def\XINT_mul_Br #1#2#3#4\W\X\Y\Z #5#6#7#8%
{%
    \expandafter\XINT_mul_ABEAr
    \the\numexpr #1+10#2+#8#7#6#5\relax.{#3}#4\W\X\Y\Z
}%
\def\XINT_mul_ABEAr #1#2#3#4#5#6.#7%
{%
    \XINT_mul_Ar #2{#7#6#5#4#3}%
}%
%    \end{macrocode}
% \lverb|&
% << Petite >> multiplication.
% mul_Mr renvoie le résultat *à l'envers*, sur *4n*$\
% \romannumeral0\XINT_mul_Mr {<n>}<N>\Z\Z\Z\Z$\
% Fait la multiplication de <N> par <n>, qui est < 10000.
% <N> est présenté *à l'envers*, sur *4n*. Lorsque <n> vaut 0, donne 0000.|
%    \begin{macrocode}
\def\XINT_mul_Mr #1%
{%
    \expandafter\XINT_mul_Mr_checkifzeroorone\expandafter{\the\numexpr #1}%
}%
\def\XINT_mul_Mr_checkifzeroorone #1%
{%
    \ifcase #1
      \expandafter\XINT_mul_Mr_zero
    \or 
      \expandafter\XINT_mul_Mr_one
    \else
      \expandafter\XINT_mul_Nr
    \fi
    {0000}{}{#1}%
}%
\def\XINT_mul_Mr_zero #1\Z\Z\Z\Z { 0000}%
\def\XINT_mul_Mr_one #1#2#3#4\Z\Z\Z\Z { #4}%
\def\XINT_mul_Nr #1#2#3#4#5#6#7%
{% 
    \xint_gob_til_Z #4\xint_mul_pr\Z\XINT_mul_Pr {#1}{#3}{#7#6#5#4}{#2}{#3}%
}%
\def\XINT_mul_Pr #1#2#3%
{%
    \expandafter\XINT_mul_Lr\the\numexpr \xint_c_x^viii+#1+#2*#3\relax 
}%
\def\XINT_mul_Lr 1#1#2#3#4#5#6#7#8#9%
{%
    \XINT_mul_Nr {#1#2#3#4}{#9#8#7#6#5}%
}%
\def\xint_mul_pr\Z\XINT_mul_Pr #1#2#3#4#5%
{%
    \xint_gob_til_zeros_iv #1\XINT_mul_Mr_end_nocarry 0000%
    \XINT_mul_Mr_end_carry #1{#4}%
}%
\def\XINT_mul_Mr_end_nocarry 0000\XINT_mul_Mr_end_carry 0000#1{ #1}%
\def\XINT_mul_Mr_end_carry #1#2#3#4#5{ #5#4#3#2#1}%
%    \end{macrocode}
% \lverb|&
% << Petite >> multiplication.
% renvoie le résultat *à l'endroit*, avec *nettoyage des leading zéros*.$\
% \romannumeral0\XINT_mul_M  {<n>}<N>\Z\Z\Z\Z$\
% Fait la multiplication de <N> par <n>, qui est < 10000.
% <N> est présenté *à l'envers*, sur *4n*. |
%    \begin{macrocode}
\def\XINT_mul_M #1%
{%
    \expandafter\XINT_mul_M_checkifzeroorone\expandafter{\the\numexpr #1}%
}%
\def\XINT_mul_M_checkifzeroorone #1%
{%
    \ifcase #1
      \expandafter\XINT_mul_M_zero
    \or 
      \expandafter\XINT_mul_M_one
    \else
      \expandafter\XINT_mul_N
    \fi
    {0000}{}{#1}%
}%
\def\XINT_mul_M_zero #1\Z\Z\Z\Z { 0}%
\def\XINT_mul_M_one #1#2#3#4\Z\Z\Z\Z 
{%
    \expandafter\xint_cleanupzeros_andstop\romannumeral0\XINT_rev{#4}%
}%
\def\XINT_mul_N #1#2#3#4#5#6#7%
{% 
    \xint_gob_til_Z #4\xint_mul_p\Z\XINT_mul_P {#1}{#3}{#7#6#5#4}{#2}{#3}%
}%
\def\XINT_mul_P #1#2#3%
{%
    \expandafter\XINT_mul_L\the\numexpr \xint_c_x^viii+#1+#2*#3\relax 
}%
\def\XINT_mul_L 1#1#2#3#4#5#6#7#8#9%
{%
    \XINT_mul_N {#1#2#3#4}{#5#6#7#8#9}%
}%
\def\xint_mul_p\Z\XINT_mul_P #1#2#3#4#5%
{%
    \XINT_mul_M_end #1#4%
}%
\def\XINT_mul_M_end #1#2#3#4#5#6#7#8%
{%
    \expandafter\space\the\numexpr #1#2#3#4#5#6#7#8\relax
}%
%    \end{macrocode}
% \lverb|&
% Routine de multiplication principale
% (attention délimiteurs modifiés pour 1.08)$\
% Le résultat partiel est toujours maintenu avec significatif à
% droite et il a un nombre multiple de 4 de chiffres$\
% \romannumeral0\XINT_mul_enter <N1>\Z\Z\Z\Z <N2>\W\W\W\W$\
% avec <N1> *renversé*, *longueur 4n* (zéros éventuellement ajoutés
% au-delà du chiffre le plus significatif)
% et <N2> dans l'ordre *normal*, et pas forcément longueur 4n.
% pas de signes.$\
% Pour 1.08: dans \XINT_mul_enter et les modifs de 1.03
% qui filtrent les courts, on pourrait croire  que le
% second opérande a au moins quatre chiffres; mais le problème c'est que
% ceci est appelé par \XINT_sqr. Et de plus \XINT_sqr est utilisé dans
% la nouvelle routine d'extraction de racine carrée: je ne veux pas
% rajouter l'overhead à \XINT_sqr de voir si a longueur est au moins 4.
% Dilemme donc. Il ne semble pas y avoir d'autres accès
% directs (celui de big fac n'est pas un problème). J'ai presque été
% tenté de faire du 5x4, mais si on veut maintenir les résultats
% intermédiaires sur 4n, il y a des complications. Par ailleurs,
% je modifie aussi un petit peu la façon de coder la suite, compte tenu
% du style que j'ai développé ultérieurement. Attention terminaison
% modifiée pour le deuxième opérande.|
%    \begin{macrocode}
\def\XINT_mul_enter #1\Z\Z\Z\Z #2#3#4#5%
{% 
    \xint_gob_til_W #5\XINT_mul_exit_a\W
    \XINT_mul_start {#2#3#4#5}#1\Z\Z\Z\Z 
}%
\def\XINT_mul_exit_a\W\XINT_mul_start #1%
{%
    \XINT_mul_exit_b #1%
}%
\def\XINT_mul_exit_b #1#2#3#4%
{%
    \xint_gob_til_W
      #2\XINT_mul_exit_ci
      #3\XINT_mul_exit_cii
      \W\XINT_mul_exit_ciii #1#2#3#4%
}%
\def\XINT_mul_exit_ciii #1\W #2\Z\Z\Z\Z \W\W\W
{%
    \XINT_mul_M {#1}#2\Z\Z\Z\Z
}%
\def\XINT_mul_exit_cii\W\XINT_mul_exit_ciii #1\W\W #2\Z\Z\Z\Z \W\W
{%
    \XINT_mul_M {#1}#2\Z\Z\Z\Z
}%
\def\XINT_mul_exit_ci\W\XINT_mul_exit_cii
                     \W\XINT_mul_exit_ciii #1\W\W\W #2\Z\Z\Z\Z \W
{%
    \XINT_mul_M {#1}#2\Z\Z\Z\Z
}%
\def\XINT_mul_start #1#2\Z\Z\Z\Z 
{%
    \expandafter\XINT_mul_main\expandafter
    {\romannumeral0\XINT_mul_Mr {#1}#2\Z\Z\Z\Z}#2\Z\Z\Z\Z 
}%
\def\XINT_mul_main #1#2\Z\Z\Z\Z #3#4#5#6%
{%
    \xint_gob_til_W #6\XINT_mul_finish_a\W
    \XINT_mul_compute {#3#4#5#6}{#1}#2\Z\Z\Z\Z 
}%
\def\XINT_mul_compute #1#2#3\Z\Z\Z\Z 
{%
    \expandafter\XINT_mul_main\expandafter
    {\romannumeral0\expandafter
     \XINT_mul_Ar\expandafter0\expandafter{\expandafter}%
     \romannumeral0\XINT_mul_Mr {#1}#3\Z\Z\Z\Z 
     \W\X\Y\Z 0000#2\W\X\Y\Z }#3\Z\Z\Z\Z 
}%
%    \end{macrocode}
% \lverb|&
% Ici, le deuxième nombre se termine. Fin du calcul. On utilise la variante
% \XINT_addm_A de l'addition car on sait que le deuxième terme est au moins
% aussi long que le premier. Lorsque le multiplicateur avait longueur 4n, la
% dernière addition a fourni le résultat à l'envers, il faut donc encore le
% renverser. |
%    \begin{macrocode}
\def\XINT_mul_finish_a\W\XINT_mul_compute #1%
{%
    \XINT_mul_finish_b #1%
}%
\def\XINT_mul_finish_b #1#2#3#4%
{%
    \xint_gob_til_W
      #1\XINT_mul_finish_c
      #2\XINT_mul_finish_ci
      #3\XINT_mul_finish_cii
      \W\XINT_mul_finish_ciii #1#2#3#4%
}%
\def\XINT_mul_finish_ciii #1\W #2#3\Z\Z\Z\Z \W\W\W
{%
    \expandafter\XINT_addm_A\expandafter0\expandafter{\expandafter}%
    \romannumeral0\XINT_mul_Mr {#1}#3\Z\Z\Z\Z \W\X\Y\Z 000#2\W\X\Y\Z 
}%
\def\XINT_mul_finish_cii
    \W\XINT_mul_finish_ciii #1\W\W #2#3\Z\Z\Z\Z \W\W
{%
    \expandafter\XINT_addm_A\expandafter0\expandafter{\expandafter}%
    \romannumeral0\XINT_mul_Mr {#1}#3\Z\Z\Z\Z \W\X\Y\Z 00#2\W\X\Y\Z 
}%
\def\XINT_mul_finish_ci #1\XINT_mul_finish_ciii #2\W\W\W #3#4\Z\Z\Z\Z \W 
{%
    \expandafter\XINT_addm_A\expandafter0\expandafter{\expandafter}%
    \romannumeral0\XINT_mul_Mr {#2}#4\Z\Z\Z\Z \W\X\Y\Z 0#3\W\X\Y\Z 
}%
\def\XINT_mul_finish_c #1\XINT_mul_finish_ciii \W\W\W\W #2#3\Z\Z\Z\Z
{%
    \expandafter\xint_cleanupzeros_andstop\romannumeral0\XINT_rev{#2}%
}%
%    \end{macrocode}
% \lverb|&
% Variante de la Multiplication$\
%   \romannumeral0\XINT_mulr_enter <N1>\Z\Z\Z\Z <N2>\W\W\W\W $\
%   Ici <N1> est à l'envers sur 4n, et <N2> est à l'endroit, pas sur 4n, comme
%   dans \XINT_mul_enter, mais le résultat est lui-même fourni *à l'envers*, sur
%   *4n* (en faisant attention de ne pas avoir 0000 à la fin).$\
% Utilisé par le calcul des puissances. J'ai modifié dans 1.08 sur le
% modèle de la nouvelle version de \XINT_mul_enter. Je pourrais économiser des
% macros et fusionner \XINT_mul_enter et \XINT_mulr_enter. Une autre fois.|
%    \begin{macrocode}
\def\XINT_mulr_enter #1\Z\Z\Z\Z #2#3#4#5%
{% 
    \xint_gob_til_W #5\XINT_mulr_exit_a\W
    \XINT_mulr_start {#2#3#4#5}#1\Z\Z\Z\Z 
}%
\def\XINT_mulr_exit_a\W\XINT_mulr_start #1%
{%
    \XINT_mulr_exit_b #1%
}%
\def\XINT_mulr_exit_b #1#2#3#4%
{%
    \xint_gob_til_W
      #2\XINT_mulr_exit_ci
      #3\XINT_mulr_exit_cii
      \W\XINT_mulr_exit_ciii #1#2#3#4%
}%
\def\XINT_mulr_exit_ciii #1\W #2\Z\Z\Z\Z \W\W\W
{%
    \XINT_mul_Mr {#1}#2\Z\Z\Z\Z
}%
\def\XINT_mulr_exit_cii\W\XINT_mulr_exit_ciii #1\W\W #2\Z\Z\Z\Z \W\W
{%
    \XINT_mul_Mr {#1}#2\Z\Z\Z\Z
}%
\def\XINT_mulr_exit_ci\W\XINT_mulr_exit_cii
                     \W\XINT_mulr_exit_ciii #1\W\W\W #2\Z\Z\Z\Z \W
{%
    \XINT_mul_Mr {#1}#2\Z\Z\Z\Z
}%
\def\XINT_mulr_start #1#2\Z\Z\Z\Z 
{%
    \expandafter\XINT_mulr_main\expandafter
    {\romannumeral0\XINT_mul_Mr {#1}#2\Z\Z\Z\Z}#2\Z\Z\Z\Z 
}%
\def\XINT_mulr_main #1#2\Z\Z\Z\Z #3#4#5#6%
{%
    \xint_gob_til_W #6\XINT_mulr_finish_a\W
    \XINT_mulr_compute {#3#4#5#6}{#1}#2\Z\Z\Z\Z 
}%
\def\XINT_mulr_compute #1#2#3\Z\Z\Z\Z 
{%
    \expandafter\XINT_mulr_main\expandafter
    {\romannumeral0\expandafter
     \XINT_mul_Ar\expandafter0\expandafter{\expandafter}%
     \romannumeral0\XINT_mul_Mr {#1}#3\Z\Z\Z\Z 
     \W\X\Y\Z 0000#2\W\X\Y\Z }#3\Z\Z\Z\Z 
}%
\def\XINT_mulr_finish_a\W\XINT_mulr_compute #1%
{%
    \XINT_mulr_finish_b #1%
}%
\def\XINT_mulr_finish_b #1#2#3#4%
{%
    \xint_gob_til_W
      #1\XINT_mulr_finish_c
      #2\XINT_mulr_finish_ci
      #3\XINT_mulr_finish_cii
      \W\XINT_mulr_finish_ciii #1#2#3#4%
}%
\def\XINT_mulr_finish_ciii #1\W #2#3\Z\Z\Z\Z \W\W\W
{%
    \expandafter\XINT_addp_A\expandafter0\expandafter{\expandafter}%
    \romannumeral0\XINT_mul_Mr {#1}#3\Z\Z\Z\Z \W\X\Y\Z 000#2\W\X\Y\Z 
}%
\def\XINT_mulr_finish_cii
    \W\XINT_mulr_finish_ciii #1\W\W #2#3\Z\Z\Z\Z \W\W
{%
    \expandafter\XINT_addp_A\expandafter0\expandafter{\expandafter}%
    \romannumeral0\XINT_mul_Mr {#1}#3\Z\Z\Z\Z \W\X\Y\Z 00#2\W\X\Y\Z 
}%
\def\XINT_mulr_finish_ci #1\XINT_mulr_finish_ciii #2\W\W\W #3#4\Z\Z\Z\Z \W 
{%
    \expandafter\XINT_addp_A\expandafter0\expandafter{\expandafter}%
    \romannumeral0\XINT_mul_Mr {#2}#4\Z\Z\Z\Z \W\X\Y\Z 0#3\W\X\Y\Z 
}%
\def\XINT_mulr_finish_c #1\XINT_mulr_finish_ciii \W\W\W\W #2#3\Z\Z\Z\Z { #2}%
%    \end{macrocode}
% \subsection{\csh{xintSqr}}
%    \begin{macrocode}
\def\xintiiSqr {\romannumeral0\xintiisqr }%
\def\xintiisqr #1%
{%
    \expandafter\XINT_sqr\expandafter {\romannumeral0\xintiiabs{#1}}% 
}%
\def\xintiSqr {\romannumeral0\xintisqr }%
\def\xintisqr #1%
{%
    \expandafter\XINT_sqr\expandafter {\romannumeral0\xintiabs{#1}}% 
}%
\let\xintSqr\xintiSqr \let\xintsqr\xintisqr
\def\XINT_sqr #1%
{% 
    \expandafter\XINT_mul_enter
          \romannumeral0%
          \XINT_RQ {}#1\R\R\R\R\R\R\R\R\Z
          \Z\Z\Z\Z #1\W\W\W\W
}%
%    \end{macrocode}
% \subsection{\csh{xintPrd}, \csh{xintPrdExpr}}
% \lverb|&
% \xintPrd {{a}...{z}}$\
% \xintPrdExpr {a}...{z}\relax$\
% Release 1.02 modified the product routine.  The earlier version was faster in
% situations where each new term is bigger than the product of all previous
% terms, a situation which arises in the algorithm for computing powers. The
% 1.02 version was changed to be more efficient on big products, where the new
% term is small compared to what has been computed so far (the power algorithm
% now has its own product routine). 
% 
% Finally, the 1.03 version just simplifies everything as the multiplication now
% decides what is best, with the price of a little overhead. So the code has
% been dramatically reduced here. 
% 
% In 1.03 I also modify the way \xintPrd and \xintPrdExpr ...\relax are
% related. Now \xintPrdExpr \z \relax is accepted input when \z expands
% to a list of braced terms (prior only \xintPrd {\z} or \xintPrd \z was
% possible). 
%
% In 1.06a I suddenly decide that \xintProductExpr was a silly name, and as the
% package is new and certainly not used, I decide I may just switch to
% \xintPrdExpr which I should have used from the beginning.|
%    \begin{macrocode}
\def\xintiPrd {\romannumeral0\xintiprd }%
\def\xintiprd #1{\xintiprdexpr #1\relax }%
\let\xintPrd\xintiPrd 
\let\xintprd\xintiprd
\def\xintiPrdExpr {\romannumeral0\xintiprdexpr }%
\def\xintiprdexpr {\expandafter\XINT_prdexpr\romannumeral-`0}%
\let\xintPrdExpr\xintiPrdExpr 
\let\xintprdexpr\xintiprdexpr
\def\XINT_prdexpr {\XINT_prod_loop_a 1\Z }%
\def\XINT_prod_loop_a #1\Z #2%
{%
    \expandafter\XINT_prod_loop_b \romannumeral-`0#2\Z #1\Z \Z
}%
\def\XINT_prod_loop_b #1%
{%
   \xint_gob_til_relax #1\XINT_prod_finished\relax
   \XINT_prod_loop_c #1%
}%
\def\XINT_prod_loop_c
{%
    \expandafter\XINT_prod_loop_a\romannumeral0\XINT_mul_fork
}%
\def\XINT_prod_finished #1\Z #2\Z \Z { #2}%
%    \end{macrocode}
% \subsection{\csh{xintFac}}
% \lverb|&
% Modified with 1.02 and again in 1.03 for greater efficiency. I am
% tempted, 
% here and elsewhere, to use \ifcase\XINT_Geq  {#1}{1000000000}  rather than
% \ifnum\XINT_Length {#1}>9 but for the time being I leave things as they stand.
% With release 1.05, rather than using \XINT_Length I opt finally for direct use
% of \numexpr (which will throw a suitable number too big message), and to raise
% the \xintError:$\ FactorialOfTooBigNumber for argument larger than 1000000
% (rather than 1000000000). With 1.09a, \xintFac uses \xintnum.| 
%    \begin{macrocode}
\def\xintiFac {\romannumeral0\xintifac }%
\def\xintifac #1%
{%
    \expandafter\XINT_fac_fork\expandafter{\the\numexpr #1}%
}%
\def\xintFac {\romannumeral0\xintfac }%
\def\xintfac #1%
{%
    \expandafter\XINT_fac_fork\expandafter{\romannumeral0\xintnum{#1}}%
}%
\def\XINT_fac_fork #1%
{%
    \ifcase\XINT_Sgn {#1}
       \xint_afterfi{\expandafter\space\expandafter 1\xint_gobble_i }%
    \or
       \expandafter\XINT_fac_checklength
    \else
       \xint_afterfi{\expandafter\xintError:FactorialOfNegativeNumber
                \expandafter\space\expandafter 1\xint_gobble_i }%
    \fi
    {#1}%
}%
\def\XINT_fac_checklength #1%
{%
    \ifnum #1>999999
         \xint_afterfi{\expandafter\xintError:FactorialOfTooBigNumber
                       \expandafter\space\expandafter 1\xint_gobble_i }%
    \else
         \xint_afterfi{\ifnum #1>9999
                          \expandafter\XINT_fac_big_loop
                       \else
                          \expandafter\XINT_fac_loop
                       \fi }%
    \fi
    {#1}%
}%
\def\XINT_fac_big_loop #1{\XINT_fac_big_loop_main {10000}{#1}{}}%
\def\XINT_fac_big_loop_main #1#2#3%
{%
    \ifnum #1<#2
        \expandafter
            \XINT_fac_big_loop_main
        \expandafter
           {\the\numexpr #1+1\expandafter }%
    \else
        \expandafter\XINT_fac_big_docomputation
    \fi
    {#2}{#3{#1}}%
}%
\def\XINT_fac_big_docomputation #1#2%
{%
    \expandafter \XINT_fac_bigcompute_loop \expandafter
    {\romannumeral0\XINT_fac_loop {9999}}#2\relax
}%
\def\XINT_fac_bigcompute_loop #1#2%
{%
    \xint_gob_til_relax #2\XINT_fac_bigcompute_end\relax
    \expandafter\XINT_fac_bigcompute_loop\expandafter
    {\expandafter\XINT_mul_enter
     \romannumeral0\XINT_RQ {}#2\R\R\R\R\R\R\R\R\Z
     \Z\Z\Z\Z #1\W\W\W\W }% 
}%
\def\XINT_fac_bigcompute_end #1#2#3#4#5%
{%
    \XINT_fac_bigcompute_end_ #5%
}%
\def\XINT_fac_bigcompute_end_ #1\R #2\Z \W\X\Y\Z #3\W\X\Y\Z { #3}%
\def\XINT_fac_loop #1{\XINT_fac_loop_main 1{1000}{#1}}%
\def\XINT_fac_loop_main #1#2#3%
{%
    \ifnum #3>#1
    \else
        \expandafter\XINT_fac_loop_exit
    \fi
    \expandafter\XINT_fac_loop_main\expandafter
    {\the\numexpr #1+1\expandafter }\expandafter
    {\romannumeral0\XINT_mul_Mr {#1}#2\Z\Z\Z\Z }%
    {#3}%
}%
\def\XINT_fac_loop_exit #1#2#3#4#5#6#7%
{%
    \XINT_fac_loop_exit_ #6%
}%
\def\XINT_fac_loop_exit_ #1#2#3%
{%
    \XINT_mul_M 
}%
%    \end{macrocode}
% \subsection{\csh{xintPow}}
% \lverb|&
% 1.02 modified the \XINT_posprod routine, and this meant that the
% original 
% version was moved here and renamed to \XINT_pow_posprod, as it was well
% adapted for computing powers. Then I moved in 1.03 the special variants of
% multiplication (hence of addition) which were needed to earlier in this file.
% Modified in 1.06, the exponent is  given to a \numexpr  rather than twice
% expanded. \xintnum added in 1.09a.|
%    \begin{macrocode}
\def\xintiPow {\romannumeral0\xintipow }%
\def\xintipow #1%
{%
    \expandafter\xint_pow\romannumeral0\xintnum{#1}\Z%
}%
\let\xintPow\xintiPow \let\xintpow\xintipow
\def\xint_pow #1#2\Z 
{% 
    \xint_UDsignfork
      #1\dummy \XINT_pow_Aneg
       -\dummy \XINT_pow_Anonneg
    \krof
       #1{#2}%
}%
\def\XINT_pow_Aneg #1#2#3%
{%
   \expandafter\XINT_pow_Aneg_\expandafter{\the\numexpr #3}{#2}%
}%
\def\XINT_pow_Aneg_ #1%
{%
   \ifodd #1
       \expandafter\XINT_pow_Aneg_Bodd
   \fi
   \XINT_pow_Anonneg_ {#1}%
}%
\def\XINT_pow_Aneg_Bodd #1%
{%
    \expandafter\XINT_opp\romannumeral0\XINT_pow_Anonneg_ 
}%
%    \end{macrocode}
% \lverb|&
% B = #3, faire le xpxp. Modified with 1.06: use of \numexpr.|
%    \begin{macrocode}
\def\XINT_pow_Anonneg #1#2#3%
{%
   \expandafter\XINT_pow_Anonneg_\expandafter {\the\numexpr #3}{#1#2}%
}%
%    \end{macrocode}
% \lverb+#1 = B, #2 = |A|+
%    \begin{macrocode}
\def\XINT_pow_Anonneg_ #1#2%
{%
    \ifcase\XINT_Cmp {#2}{1}
        \expandafter\XINT_pow_AisOne
    \or 
        \expandafter\XINT_pow_AatleastTwo
    \else
        \expandafter\XINT_pow_AisZero
    \fi
    {#1}{#2}%
}%
\def\XINT_pow_AisOne #1#2{ 1}%
%    \end{macrocode}
% \lverb|&
% #1 = B|
%    \begin{macrocode}
\def\XINT_pow_AisZero #1#2%
{%
     \ifcase\XINT_Sgn {#1}
         \xint_afterfi { 1}%
     \or
         \xint_afterfi { 0}%
     \else
         \xint_afterfi {\xintError:DivisionByZero\space 0}%
     \fi
}%
\def\XINT_pow_AatleastTwo #1%
{%
    \ifcase\XINT_Sgn {#1}
        \expandafter\XINT_pow_BisZero
    \or
        \expandafter\XINT_pow_checkBsize
    \else
        \expandafter\XINT_pow_BisNegative
    \fi
    {#1}%
}%
\def\XINT_pow_BisNegative #1#2{\xintError:FractionRoundedToZero\space 0}%
\def\XINT_pow_BisZero #1#2{ 1}%
%    \end{macrocode}
% \lverb|&
% B = #1 > 0, A = #2 > 1. With 1.05, I replace \xintiLen{#1}>9 by direct
% use 
% of \numexpr [to generate an error message if the exponent is too large]
% 1.06: \numexpr was already used above.|
%    \begin{macrocode}
\def\XINT_pow_checkBsize #1#2%
{%
    \ifnum #1>999999999 
        \expandafter\XINT_pow_BtooBig
    \else
        \expandafter\XINT_pow_loop
    \fi
    {#1}{#2}\XINT_pow_posprod
      \xint_relax
        \xint_undef\xint_undef\xint_undef\xint_undef
        \xint_undef\xint_undef\xint_undef\xint_undef
      \xint_relax
}%
\def\XINT_pow_BtooBig #1\xint_relax #2\xint_relax 
                         {\xintError:ExponentTooBig\space 0}%
\def\XINT_pow_loop #1#2%
{%
    \ifnum #1 = 1
        \expandafter\XINT_pow_loop_end 
    \else
        \xint_afterfi{\expandafter\XINT_pow_loop_a
            \expandafter{\the\numexpr 2*(#1/2)-#1\expandafter }% b mod 2
            \expandafter{\the\numexpr #1-#1/2\expandafter }%     [b/2]
            \expandafter{\romannumeral0\xintiisqr{#2}}}%
    \fi
    {{#2}}%
}%
\def\XINT_pow_loop_end {\romannumeral0\XINT_rord_main {}\relax }%
\def\XINT_pow_loop_a #1%
{%
    \ifnum #1 = 1
        \expandafter\XINT_pow_loop
    \else
        \expandafter\XINT_pow_loop_throwaway
    \fi
}%
\def\XINT_pow_loop_throwaway #1#2#3%
{%
   \XINT_pow_loop {#1}{#2}% 
}%
%    \end{macrocode}
% \lverb|&
% Routine de produit servant pour le calcul des puissances. Chaque
% nouveau 
%    terme est plus grand que ce qui a déjà été calculé. Par conséquent on a
%    intérêt à le conserver en second dans la routine de multiplication, donc le
%    précédent calcul a intérêt à avoir été donné sur 4n, à l'envers. Il faut
%    donc modifier la multiplication pour qu'elle fasse cela. Ce qui oblige à
%    utiliser une version spéciale de l'addition également.|
%    \begin{macrocode}
\def\XINT_pow_posprod #1%
{%
    \XINT_pow_pprod_checkifempty #1\Z
}%
\def\XINT_pow_pprod_checkifempty #1%
{%
    \xint_gob_til_relax #1\XINT_pow_pprod_emptyproduct\relax 
    \XINT_pow_pprod_RQfirst #1%
}%
\def\XINT_pow_pprod_emptyproduct #1\Z { 1}%
\def\XINT_pow_pprod_RQfirst #1\Z
{%
    \expandafter\XINT_pow_pprod_getnext\expandafter
    {\romannumeral0\XINT_RQ {}#1\R\R\R\R\R\R\R\R\Z}%
}%
\def\XINT_pow_pprod_getnext #1#2%
{%
    \XINT_pow_pprod_checkiffinished #2\Z {#1}%
}%
\def\XINT_pow_pprod_checkiffinished #1%
{%
    \xint_gob_til_relax #1\XINT_pow_pprod_end\relax 
    \XINT_pow_pprod_compute #1%
}%
\def\XINT_pow_pprod_compute #1\Z #2%
{%
    \expandafter\XINT_pow_pprod_getnext\expandafter
    {\romannumeral0\XINT_mulr_enter #2\Z\Z\Z\Z #1\W\W\W\W }%
}%
\def\XINT_pow_pprod_end\relax\XINT_pow_pprod_compute #1\Z #2%
{%
    \expandafter\xint_cleanupzeros_andstop
    \romannumeral0\XINT_rev {#2}%
}%
%    \end{macrocode}
% \subsection{\csh{xintDivision}, \csh{xintQuo}, \csh{xintRem}}
% \lverb|1.09a inserts the use of \xintnum|
%    \begin{macrocode}
\def\xintiQuo {\romannumeral0\xintiquo }%
\def\xintiRem {\romannumeral0\xintirem }%
\def\xintiquo {\expandafter\xint_firstoftwo_andstop
               \romannumeral0\xintidivision }%
\def\xintirem {\expandafter\xint_secondoftwo_andstop
               \romannumeral0\xintidivision }%
\let\xintQuo\xintiQuo \let\xintquo\xintiquo
\let\xintRem\xintiRem \let\xintrem\xintirem
%    \end{macrocode}
% \lverb|&
% #1 = A, #2 = B. On calcule le quotient de A par B.$\
% 1.03 adds the detection of 1 for B.|
%    \begin{macrocode}
\def\xintiDivision {\romannumeral0\xintidivision }%
\def\xintidivision #1%
{%
    \expandafter\xint_division\expandafter {\romannumeral0\xintnum{#1}}%
}%
\let\xintDivision\xintiDivision \let\xintdivision\xintidivision
\def\xint_division #1#2%
{%
    \expandafter\XINT_div_fork \romannumeral0\xintnum{#2}\Z #1\Z 
}%
\def\XINT_Division #1#2{\romannumeral0\XINT_div_fork #2\Z #1\Z }%
%    \end{macrocode}
% \lverb|&
% #1#2 = 2e input = diviseur = B. 
% #3#4 = 1er input = divisé = A|
%    \begin{macrocode}
\def\XINT_div_fork #1#2\Z #3#4\Z
{%
    \xint_UDzerofork
      #1\dummy \XINT_div_BisZero
      #3\dummy \XINT_div_AisZero
       0\dummy 
        {\xint_UDsignfork
           #1\dummy \XINT_div_BisNegative  % B < 0
           #3\dummy \XINT_div_AisNegative  % A < 0, B > 0
            -\dummy \XINT_div_plusplus     % B > 0, A > 0
         \krof }%
    \krof
    {#2}{#4}#1#3% #1#2=B, #3#4=A
}%
\def\XINT_div_BisZero #1#2#3#4{\xintError:DivisionByZero\space {0}{0}}%
\def\XINT_div_AisZero #1#2#3#4{ {0}{0}}%
%    \end{macrocode}
% \lverb|&
% jusqu'à présent c'est facile.$\
% minusplus signifie B < 0, A > 0$\
% plusminus signifie B > 0, A < 0$\
% Ici #3#1 correspond au diviseur B et #4#2 au divisé A.
%
% Cases with B<0 or especially A<0 are treated sub-optimally in terms of
% post-processing, things get reversed which could have been produced directly
% in the wanted order, but A,B>0 is given priority for optimization. |
%    \begin{macrocode}
\def\XINT_div_plusplus #1#2#3#4%
{%
    \XINT_div_prepare {#3#1}{#4#2}%
}%
%    \end{macrocode}
% \lverb|&
% B = #3#1 < 0, A non nul positif ou négatif|
%    \begin{macrocode}
\def\XINT_div_BisNegative #1#2#3#4%
{%
    \expandafter\XINT_div_BisNegative_post
    \romannumeral0\XINT_div_fork #1\Z #4#2\Z
}%
\def\XINT_div_BisNegative_post #1%
{%
    \expandafter\space\expandafter {\romannumeral0\XINT_opp #1}%
}%
%    \end{macrocode}
% \lverb|&
% B = #3#1 > 0, A =-#2< 0|
%    \begin{macrocode}
\def\XINT_div_AisNegative #1#2#3#4%
{%
    \expandafter\XINT_div_AisNegative_post
    \romannumeral0\XINT_div_prepare {#3#1}{#2}{#3#1}%
}%
\def\XINT_div_AisNegative_post #1#2%
{%
    \ifcase\XINT_Sgn {#2}
       \expandafter \XINT_div_AisNegative_zerorem
    \or
       \expandafter \XINT_div_AisNegative_posrem
    \fi
    {#1}{#2}%
}%
%    \end{macrocode}
% \lverb|&
% en #3 on a une copie de B (à l'endroit)|
%    \begin{macrocode}
\def\XINT_div_AisNegative_zerorem #1#2#3%
{%
    \expandafter\space\expandafter {\romannumeral0\XINT_opp #1}{0}%
}%
%    \end{macrocode}
% \lverb!#1 = quotient, #2 = reste, #3 = diviseur initial (à l'endroit)
% remplace Reste par B - Reste, après avoir remplacé Q par -(Q+1)
% de sorte que la formule a = qb + r, 0<= r < |b| est valable!
%    \begin{macrocode}
\def\XINT_div_AisNegative_posrem #1%
{%
    \expandafter \XINT_div_AisNegative_posrem_b \expandafter
       {\romannumeral0\xintiiopp{\xintInc {#1}}}%
}%
\def\XINT_div_AisNegative_posrem_b #1#2#3%
{%
    \expandafter \xint_exchangetwo_keepbraces_andstop \expandafter
    {\romannumeral0\XINT_sub {#3}{#2}}{#1}%
}%
%    \end{macrocode}
% \lverb|&
% par la suite A et B sont > 0.
% #1 = B. Pour le moment à l'endroit.
% Calcul du plus petit K = 4n >= longueur de B$\
% 1.03 adds the interception of B=1|
%    \begin{macrocode}
\def\XINT_div_prepare #1%
{%
    \expandafter \XINT_div_prepareB_aa \expandafter
        {\romannumeral0\XINT_length {#1}}{#1}% B > 0 ici
}%
\def\XINT_div_prepareB_aa #1%
{%
    \ifnum #1=1
      \expandafter\XINT_div_prepareB_ab
    \else
      \expandafter\XINT_div_prepareB_a
    \fi
    {#1}%
}%
\def\XINT_div_prepareB_ab #1#2%
{%
    \ifnum #2=1
      \expandafter\XINT_div_prepareB_BisOne
    \else 
      \expandafter\XINT_div_prepareB_e
    \fi {000}{3}{4}{#2}%
}%
\def\XINT_div_prepareB_BisOne #1#2#3#4#5{ {#5}{0}}%
\def\XINT_div_prepareB_a #1%
{%
  \expandafter\XINT_div_prepareB_c\expandafter
  {\the\numexpr \xint_c_iv*((#1+\xint_c_i)/\xint_c_iv)}{#1}%
}%
%    \end{macrocode}
% \lverb|&
% #1 = K|
%    \begin{macrocode}
\def\XINT_div_prepareB_c #1#2%
{%
    \ifcase \numexpr #1-#2\relax
       \expandafter\XINT_div_prepareB_d
    \or
       \expandafter\XINT_div_prepareB_di
    \or
       \expandafter\XINT_div_prepareB_dii
    \or
       \expandafter\XINT_div_prepareB_diii
    \fi {#1}%
}%
\def\XINT_div_prepareB_d    {\XINT_div_prepareB_e {}{0}}%
\def\XINT_div_prepareB_di   {\XINT_div_prepareB_e {0}{1}}%
\def\XINT_div_prepareB_dii  {\XINT_div_prepareB_e {00}{2}}%
\def\XINT_div_prepareB_diii {\XINT_div_prepareB_e {000}{3}}%
%    \end{macrocode}
% \lverb|&
% #1 = zéros à rajouter à B, #2=c, #3=K, #4 = B|
%    \begin{macrocode}
\def\XINT_div_prepareB_e #1#2#3#4%
{%
    \XINT_div_prepareB_f #4#1\Z {#3}{#2}{#1}%
}%
%    \end{macrocode}
% \lverb|&
% x = #1#2#3#4 = 4 premiers chiffres de B. #1 est non nul.
% Ensuite on renverse B pour calculs plus rapides par la suite.|
%    \begin{macrocode}
\def\XINT_div_prepareB_f #1#2#3#4#5\Z
{%
    \expandafter \XINT_div_prepareB_g \expandafter
        {\romannumeral0\XINT_rev {#1#2#3#4#5}}{#1#2#3#4}%
}%
%    \end{macrocode}
% \lverb|&
% #3= K, #4 = c, #5= {} ou {0} ou {00} ou {000}, #6 = A initial
% #1 = B préparé et renversé, #2 = x = quatre premiers chiffres
% On multiplie aussi A par 10^c.$\
% B, x, K, c, {} ou {0} ou {00} ou {000}, A initial|
%    \begin{macrocode}
\def\XINT_div_prepareB_g #1#2#3#4#5#6%
{%
    \XINT_div_prepareA_a {#6#5}{#2}{#3}{#1}{#4}%
}%
%    \end{macrocode}
% \lverb|&
% A, x, K, B, c, |
%    \begin{macrocode}
\def\XINT_div_prepareA_a #1%
{%
    \expandafter \XINT_div_prepareA_b \expandafter
       {\romannumeral0\XINT_length {#1}}{#1}% A >0 ici
}%
%    \end{macrocode}
% \lverb|&
% L0, A, x, K, B, ...|
%    \begin{macrocode}
\def\XINT_div_prepareA_b #1%
{%
  \expandafter\XINT_div_prepareA_c\expandafter{\the\numexpr 4*((#1+1)/4)}{#1}%
}%
%    \end{macrocode}
% \lverb|&
% L, L0, A, x, K, B,...|
%    \begin{macrocode}
\def\XINT_div_prepareA_c #1#2%
{%
    \ifcase \numexpr #1-#2\relax
       \expandafter\XINT_div_prepareA_d
    \or
       \expandafter\XINT_div_prepareA_di
    \or
       \expandafter\XINT_div_prepareA_dii
    \or
       \expandafter\XINT_div_prepareA_diii
    \fi {#1}%
}%
\def\XINT_div_prepareA_d     {\XINT_div_prepareA_e {}}%
\def\XINT_div_prepareA_di    {\XINT_div_prepareA_e {0}}%
\def\XINT_div_prepareA_dii   {\XINT_div_prepareA_e {00}}%
\def\XINT_div_prepareA_diii  {\XINT_div_prepareA_e {000}}%
%    \end{macrocode}
% \lverb|&
% #1#3 = A préparé, #2 = longueur de ce A préparé, |
%    \begin{macrocode}
\def\XINT_div_prepareA_e #1#2#3%
{%
    \XINT_div_startswitch {#1#3}{#2}% 
}%
%    \end{macrocode}
% \lverb|&
% A, L, x, K, B, c|
%    \begin{macrocode}
\def\XINT_div_startswitch #1#2#3#4%
{%
    \ifnum #2 > #4
      \expandafter\XINT_div_body_a
    \else
    \ifnum #2 = #4
      \expandafter\expandafter\expandafter\XINT_div_final_a
    \else
      \expandafter\expandafter\expandafter\XINT_div_finished_a
    \fi\fi {#1}{#4}{#3}{0000}{#2}%
}%
%    \end{macrocode}
% \lverb|&
% ---- "Finished": A, K, x, Q, L, B, c|
%    \begin{macrocode}
\def\XINT_div_finished_a #1#2#3%
{%
  \expandafter\XINT_div_finished_b\expandafter {\romannumeral0\XINT_cuz {#1}}%
}%
%    \end{macrocode}
% \lverb|&
% A, Q, L, B, c
% no leading zeros in A at this stage|
%    \begin{macrocode}
\def\XINT_div_finished_b #1#2#3#4#5%
{%
    \ifcase \XINT_Sgn {#1}
       \xint_afterfi {\XINT_div_finished_c {0}}%
    \or
       \xint_afterfi {\expandafter\XINT_div_finished_c\expandafter
                      {\romannumeral0\XINT_dsh_checksignx #5\Z {#1}}%
                     }%
    \fi
    {#2}%
}%
\def\XINT_div_finished_c #1#2%
{%
    \expandafter\space\expandafter {\romannumeral0\XINT_rev_andcuz {#2}}{#1}%
}%
%    \end{macrocode}
% \lverb|&
% ---- "Final": A, K, x, Q, L, B, c|
%    \begin{macrocode}
\def\XINT_div_final_a #1%
{%
    \XINT_div_final_b #1\Z
}%
\def\XINT_div_final_b #1#2#3#4#5\Z
{%
    \xint_gob_til_zeros_iv #1#2#3#4\xint_div_final_c0000%
    \XINT_div_final_c {#1#2#3#4}{#1#2#3#4#5}%
}%
\def\xint_div_final_c0000\XINT_div_final_c #1{\XINT_div_finished_a }%
%    \end{macrocode}
% \lverb|&
% a, A, K, x, Q, L, B ,c
% 1.01: code ré-écrit pour optimisations diverses.
% 1.04: again, code rewritten for tiny speed increase (hopefully).|
%    \begin{macrocode}
\def\XINT_div_final_c #1#2#3#4%
{%
    \expandafter \XINT_div_final_da \expandafter
    {\the\numexpr #1-(#1/#4)*#4\expandafter }\expandafter
    {\the\numexpr #1/#4\expandafter }\expandafter
    {\romannumeral0\xint_cleanupzeros_andstop #2}%
}%
%    \end{macrocode}
% \lverb|&
% r, q, A sans leading zéros, Q, L, B à l'envers sur 4n, c|
%    \begin{macrocode}
\def\XINT_div_final_da #1%
{%
    \ifnum #1>\xint_c_ix
       \expandafter\XINT_div_final_dP
    \else
       \xint_afterfi
       {\ifnum #1<\xint_c_
        \expandafter\XINT_div_final_dN
        \else
        \expandafter\XINT_div_final_db
        \fi }%
    \fi
}%
\def\XINT_div_final_dN #1%
{%
    \expandafter\XINT_div_final_dP\the\numexpr #1-\xint_c_i\relax
}%
\def\XINT_div_final_dP #1#2#3#4#5% q,A,Q,L,B (puis c)
{%
    \expandafter \XINT_div_final_f \expandafter
    {\romannumeral0\xintiisub {#2}%
        {\romannumeral0\XINT_mul_M {#1}#5\Z\Z\Z\Z }}%
    {\romannumeral0\XINT_add_A 0{}#1000\W\X\Y\Z #3\W\X\Y\Z }% 
}%
\def\XINT_div_final_db #1#2#3#4#5% q,A,Q,L,B (puis c)
{% 
    \expandafter\XINT_div_final_dc\expandafter
    {\romannumeral0\xintiisub {#2}%
        {\romannumeral0\XINT_mul_M {#1}#5\Z\Z\Z\Z }}%
    {#1}{#2}{#3}{#4}{#5}%
}%
\def\XINT_div_final_dc #1#2%
{%
    \ifnum\XINT_Sgn{#1}<\xint_c_
    \xint_afterfi 
    {\expandafter\XINT_div_final_dP\the\numexpr #2-\xint_c_i\relax}%
    \else \xint_afterfi {\XINT_div_final_e {#1}#2}%
    \fi
}%
\def\XINT_div_final_e #1#2#3#4#5#6% A final, q, trash, Q, L, B
{%
    \XINT_div_final_f {#1}%
    {\romannumeral0\XINT_add_A 0{}#2000\W\X\Y\Z #4\W\X\Y\Z }%
}%
\def\XINT_div_final_f #1#2#3% R,Q \`a d\'evelopper,c
{%
    \ifcase \XINT_Sgn {#1}
       \xint_afterfi {\XINT_div_final_end {0}}%
    \or
       \xint_afterfi {\expandafter\XINT_div_final_end\expandafter
                      {\romannumeral0\XINT_dsh_checksignx #3\Z {#1}}%
                     }%
    \fi
    {#2}%
}%
\def\XINT_div_final_end #1#2%
{%
    \expandafter\space\expandafter {#2}{#1}%
}%
%    \end{macrocode}
% \lverb|&
% Boucle Principale (on reviendra en div_body_b pas div_body_a)$\
% A, K, x, Q, L, B, c|
%    \begin{macrocode}
\def\XINT_div_body_a #1%
{%
    \XINT_div_body_b #1\Z {#1}%
}%
\def\XINT_div_body_b #1#2#3#4#5#6#7#8#9\Z
{%
    \XINT_div_body_c {#1#2#3#4#5#6#7#8}%
}%
%    \end{macrocode}
% \lverb|&
% a, A, K, x, Q, L, B, c|
%    \begin{macrocode}
\def\XINT_div_body_c #1#2#3%
{%
    \XINT_div_body_d {#3}{}#2\Z {#1}{#3}%
}%
\def\XINT_div_body_d #1#2#3#4#5#6%
{%
    \ifnum #1 >\xint_c_
        \expandafter\XINT_div_body_d
        \expandafter{\the\numexpr #1-\xint_c_iv\expandafter }%
    \else
        \expandafter\XINT_div_body_e
    \fi
    {#6#5#4#3#2}%
}%
\def\XINT_div_body_e #1#2\Z #3%
{%
    \XINT_div_body_f {#3}{#1}{#2}%
}%
%    \end{macrocode}
% \lverb|&
% a, alpha (à l'envers), alpha' (à l'endroit), K, x, Q, L, B (à l'envers), c|
%    \begin{macrocode}
\def\XINT_div_body_f #1#2#3#4#5#6#7#8%
{%
    \expandafter\XINT_div_body_gg
    \the\numexpr (#1+(#5+\xint_c_i)/\xint_c_ii)/(#5+\xint_c_i)+99999\relax 
    {#8}{#2}{#8}{#4}{#5}{#3}{#6}{#7}{#8}%
}%
%    \end{macrocode}
% \lverb|&
% q1 sur six chiffres (il en a 5 au max), B, alpha, B, K, x, alpha', Q, L, B, c|
%    \begin{macrocode}
\def\XINT_div_body_gg #1#2#3#4#5#6%
{%
    \xint_UDzerofork
      #2\dummy \XINT_div_body_gk 
       0\dummy {\XINT_div_body_ggk #2}%
    \krof
    {#3#4#5#6}%
}%
\def\XINT_div_body_gk #1#2#3%
{%
    \expandafter\XINT_div_body_h 
    \romannumeral0\XINT_div_sub_xpxp 
    {\romannumeral0\XINT_mul_Mr {#1}#2\Z\Z\Z\Z }{#3}\Z {#1}%
}%
\def\XINT_div_body_ggk #1#2#3%
{%
    \expandafter \XINT_div_body_gggk \expandafter
    {\romannumeral0\XINT_mul_Mr {#1}0000#3\Z\Z\Z\Z }%
    {\romannumeral0\XINT_mul_Mr {#2}#3\Z\Z\Z\Z }%
    {#1#2}%  
}%
\def\XINT_div_body_gggk #1#2#3#4%
{%
    \expandafter\XINT_div_body_h
    \romannumeral0\XINT_div_sub_xpxp
    {\romannumeral0\expandafter\XINT_mul_Ar
     \expandafter0\expandafter{\expandafter}#2\W\X\Y\Z #1\W\X\Y\Z }%
    {#4}\Z {#3}%
}%
%    \end{macrocode}
% \lverb|&
% alpha1 = alpha-q1 B, \Z, q1, B, K, x, alpha', Q, L, B, c|
%    \begin{macrocode}
\def\XINT_div_body_h #1#2#3#4#5#6#7#8#9\Z 
{%
    \ifnum #1#2#3#4>\xint_c_
        \xint_afterfi{\XINT_div_body_i {#1#2#3#4#5#6#7#8}}%
    \else
        \expandafter\XINT_div_body_k
    \fi
    {#1#2#3#4#5#6#7#8#9}%
}%
\def\XINT_div_body_k #1#2#3%
{%
    \XINT_div_body_l {#1}{#2}%
}%
%    \end{macrocode}
% \lverb|&
% a1, alpha1 (à l'endroit), q1, B, K, x, alpha', Q, L, B, c|
%    \begin{macrocode}
\def\XINT_div_body_i #1#2#3#4#5#6%
{%
    \expandafter\XINT_div_body_j
    \expandafter{\the\numexpr (#1+(#6+1)/2)/(#6+1)-1}%
       {#2}{#3}{#4}{#5}{#6}%
}%
\def\XINT_div_body_j #1#2#3#4%
{%
    \expandafter \XINT_div_body_l \expandafter
    {\romannumeral0\XINT_div_sub_xpxp
       {\romannumeral0\XINT_mul_Mr {#1}#4\Z\Z\Z\Z }{\XINT_Rev{#2}}}%
    {#3+#1}%
}%
%    \end{macrocode}
% \lverb|&
% alpha2 (à l'endroit, ou alpha1), q1+q2 (ou q1), K, x, alpha', Q, L, B, c|
%    \begin{macrocode}
\def\XINT_div_body_l #1#2#3#4#5#6#7%
{%
   \expandafter\XINT_div_body_m
   \the\numexpr \xint_c_x^viii+#2\relax {#6}{#3}{#7}{#1#5}{#4}%
}%
%    \end{macrocode}
% \lverb|&
% chiffres de q, Q, K, L, A'=nouveau A, x, B, c|
%    \begin{macrocode}
\def\XINT_div_body_m 1#1#2#3#4#5#6#7#8%
{%
    \ifnum #1#2#3#4>\xint_c_
       \xint_afterfi {\XINT_div_body_n {#8#7#6#5#4#3#2#1}}%
    \else
       \xint_afterfi {\XINT_div_body_n {#8#7#6#5}}%
    \fi
}%
%    \end{macrocode}
% \lverb|&
% q renversé, Q, K, L, A', x, B, c|
%    \begin{macrocode}
\def\XINT_div_body_n #1#2%
{%
    \expandafter\XINT_div_body_o\expandafter
    {\romannumeral0\XINT_addr_A 0{}#1\W\X\Y\Z #2\W\X\Y\Z }%
}%
%    \end{macrocode}
% \lverb|&
% q+Q, K, L, A', x, B, c|
%    \begin{macrocode}
\def\XINT_div_body_o #1#2#3#4%
{%
    \XINT_div_body_p {#3}{#2}{}#4\Z {#1}%
}%
%    \end{macrocode}
% \lverb|&
% L, K, {}, A'\Z, q+Q, x, B, c |
%    \begin{macrocode}
\def\XINT_div_body_p #1#2#3#4#5#6#7%
{%
    \ifnum #1 > #2
        \xint_afterfi
        {\ifnum #4#5#6#7 > \xint_c_
           \expandafter\XINT_div_body_q
         \else
           \expandafter\XINT_div_body_repeatp
         \fi }%
    \else
        \expandafter\XINT_div_gotofinal_a
    \fi
    {#1}{#2}{#3}#4#5#6#7%
}%
%    \end{macrocode}
% \lverb|&
% L, K, zeros,  A' avec moins de zéros\Z, q+Q, x, B, c|
%    \begin{macrocode}
\def\XINT_div_body_repeatp #1#2#3#4#5#6#7%
{%
    \expandafter\XINT_div_body_p\expandafter{\the\numexpr #1-4}{#2}{0000#3}%
}%
%    \end{macrocode}
% \lverb|&
% L -> L-4, zeros->zeros+0000, répéter jusqu'à ce que soit L=K
% soit on ne trouve plus 0000$\
% nouveau L, K, zeros, nouveau A=#4, \Z, Q+q (à l'envers), x, B, c|
%    \begin{macrocode}
\def\XINT_div_body_q #1#2#3#4\Z #5#6%
{%
    \XINT_div_body_b #4\Z {#4}{#2}{#6}{#3#5}{#1}%
}%
%    \end{macrocode}
% \lverb|&
% A, K, x, Q, L, B, c --> iterate$\
% Boucle Principale achevée. ATTENTION IL FAUT AJOUTER 4 ZEROS DE MOINS QUE CEUX
% QUI ONT ÉTÉ PRÉPARÉS DANS #3!!$\
% L, K (L=K), zeros, A\Z, Q, x, B, c|
%    \begin{macrocode}
\def\XINT_div_gotofinal_a #1#2#3#4\Z %
{%
    \XINT_div_gotofinal_b #3\Z {#4}{#1}%
}%
\def\XINT_div_gotofinal_b 0000#1\Z #2#3#4#5%
{%
    \XINT_div_final_a {#2}{#3}{#5}{#1#4}{#3}%
}%
%    \end{macrocode}
% \lverb|&
% La soustraction spéciale.
% 
% Elle fait l'expansion (une fois pour le premier, deux fois pour le second) de
% ses arguments. Ceux-ci doivent être à l'envers sur 4n. De plus on sait a
% priori que le second est > le premier. Et le résultat de la différence est
% renvoyé **avec la même longueur que le second** (donc avec des leading zéros
% éventuels), et *à l'endroit*.|
%    \begin{macrocode}
\def\XINT_div_sub_xpxp #1%
{%
    \expandafter \XINT_div_sub_xpxp_a  \expandafter{#1}%
}%
\def\XINT_div_sub_xpxp_a #1#2%
{%
    \expandafter\expandafter\expandafter\XINT_div_sub_xpxp_b
     #2\W\X\Y\Z #1\W\X\Y\Z
}%
\def\XINT_div_sub_xpxp_b
{%
    \XINT_div_sub_A 1{}%
}%
\def\XINT_div_sub_A #1#2#3#4#5#6%  
{%
    \xint_gob_til_W #3\xint_div_sub_az\W
    \XINT_div_sub_B #1{#3#4#5#6}{#2}% 
}%
\def\XINT_div_sub_B #1#2#3#4\W\X\Y\Z #5#6#7#8%  
{%
    \xint_gob_til_W #5\xint_div_sub_bz\W
    \XINT_div_sub_onestep #1#2{#8#7#6#5}{#3}#4\W\X\Y\Z 
}%
\def\XINT_div_sub_onestep #1#2#3#4#5#6%
{%
    \expandafter\XINT_div_sub_backtoA
    \the\numexpr 11#5#4#3#2-#6+#1-\xint_c_i\relax.%
}%
\def\XINT_div_sub_backtoA #1#2#3.#4%
{%
    \XINT_div_sub_A #2{#3#4}%
}%
\def\xint_div_sub_bz\W\XINT_div_sub_onestep #1#2#3#4#5#6#7%
{%
    \xint_UDzerofork
      #1\dummy  \XINT_div_sub_C   %
       0\dummy  \XINT_div_sub_D   % pas de retenue
    \krof
    {#7}#2#3#4#5%
}%
\def\XINT_div_sub_D #1#2\W\X\Y\Z
{%
    \expandafter\space
    \romannumeral0%
    \XINT_rord_main {}#2%
      \xint_relax
        \xint_undef\xint_undef\xint_undef\xint_undef
        \xint_undef\xint_undef\xint_undef\xint_undef
      \xint_relax
    #1%
}%
\def\XINT_div_sub_C #1#2#3#4#5%
{%
    \xint_gob_til_W #2\xint_div_sub_cz\W
    \XINT_div_sub_AC_onestep {#5#4#3#2}{#1}%
}%
\def\XINT_div_sub_AC_onestep #1%
{%
    \expandafter\XINT_div_sub_backtoC\the\numexpr 11#1-\xint_c_i\relax.%
}%
\def\XINT_div_sub_backtoC #1#2#3.#4%
{%
    \XINT_div_sub_AC_checkcarry #2{#3#4}% la retenue va \^etre examin\'ee
}%
\def\XINT_div_sub_AC_checkcarry #1%
{%
    \xint_gob_til_one #1\xint_div_sub_AC_nocarry 1\XINT_div_sub_C 
}%
\def\xint_div_sub_AC_nocarry 1\XINT_div_sub_C #1#2\W\X\Y\Z
{%
    \expandafter\space
    \romannumeral0%
    \XINT_rord_main {}#2%
      \xint_relax
        \xint_undef\xint_undef\xint_undef\xint_undef
        \xint_undef\xint_undef\xint_undef\xint_undef
      \xint_relax
    #1%
}%
\def\xint_div_sub_cz\W\XINT_div_sub_AC_onestep #1#2{ #2}%
\def\xint_div_sub_az\W\XINT_div_sub_B #1#2#3#4\Z { #3}%
%    \end{macrocode}
% \lverb|&
% &
% -----------------------------------------------------------------$\
% -----------------------------------------------------------------$\
% DECIMAL OPERATIONS: FIRST DIGIT, LASTDIGIT, ODDNESS,
% MULTIPLICATION BY TEN, QUOTIENT BY TEN, QUOTIENT OR
% MULTIPLICATION BY POWER OF TEN, SPLIT OPERATION.|
% \subsection{\csh{xintFDg}}
% \lverb|&
% FIRST DIGIT. Code simplified in 1.05.  
% And prepared for redefinition by xintfrac to parse through \xintNum. Version
% 1.09a inserts the \xintnum here.|
%    \begin{macrocode}
\def\xintiFDg {\romannumeral0\xintifdg }%
\def\xintifdg #1%
{%
    \expandafter\XINT_fdg \romannumeral-`0#1\W\Z
}%
\def\xintFDg {\romannumeral0\xintfdg }%
\def\xintfdg #1%
{%
    \expandafter\XINT_fdg \romannumeral0\xintnum{#1}\W\Z
}%
\def\XINT_FDg #1{\romannumeral0\XINT_fdg #1\W\Z }%
\def\XINT_fdg #1#2#3\Z
{%
    \xint_UDzerominusfork
      #1-\dummy  { 0}%   zero
      0#1\dummy  { #2}%  negative
       0-\dummy  { #1}%  positive
    \krof
}%
%    \end{macrocode}
% \subsection{\csh{xintLDg}}
% \lverb|&
% LAST DIGIT. Simplified in 1.05. And prepared for extension by xintfrac
%    to parse through \xintNum. 1.09a has it here.|
%    \begin{macrocode}
\def\xintiLDg {\romannumeral0\xintildg }%
\def\xintildg #1%
{%
    \expandafter\XINT_ldg\expandafter {\romannumeral-`0#1}%
}%
\def\xintLDg {\romannumeral0\xintldg }%
\def\xintldg #1%
{%
    \expandafter\XINT_ldg\expandafter {\romannumeral0\xintnum{#1}}%
}%
\def\XINT_LDg #1{\romannumeral0\XINT_ldg {#1}}%
\def\XINT_ldg #1%
{%
    \expandafter\XINT_ldg_\romannumeral0\XINT_rev {#1}\Z
}%
\def\XINT_ldg_ #1#2\Z{ #1}%
%    \end{macrocode}
% \subsection{\csh{xintMON}}
% \lverb|&
% MINUS ONE TO THE POWER N|
%    \begin{macrocode}
\def\xintiMON {\romannumeral0\xintimon }%
\def\xintimon #1%
{%
    \ifodd\xintiLDg {#1}
        \xint_afterfi{ -1}%
    \else
        \xint_afterfi{ 1}%
    \fi
}%
\def\xintiMMON {\romannumeral0\xintimmon }%
\def\xintimmon #1%
{%
    \ifodd\xintiLDg {#1}
        \xint_afterfi{ 1}%
    \else
        \xint_afterfi{ -1}%
    \fi
}%
\def\xintMON {\romannumeral0\xintmon }%
\def\xintmon #1%
{%
    \ifodd\xintLDg {#1}
        \xint_afterfi{ -1}%
    \else
        \xint_afterfi{ 1}%
    \fi
}%
\def\xintMMON {\romannumeral0\xintmmon }%
\def\xintmmon #1%
{%
    \ifodd\xintLDg {#1}
        \xint_afterfi{ 1}%
    \else
        \xint_afterfi{ -1}%
    \fi
}%
%    \end{macrocode}
% \subsection{\csh{xintOdd}}
% \lverb|&
% ODDNESS. 1.05 defines \xintiOdd, so \xintOdd can be modified by
% xintfrac to parse through \xintNum.|
%    \begin{macrocode}
\def\xintiOdd {\romannumeral0\xintiodd }%
\def\xintiodd #1%
{%
    \ifodd\xintiLDg{#1}
        \xint_afterfi{ 1}%
    \else
        \xint_afterfi{ 0}%
    \fi
}%
\def\XINT_Odd #1%
{\romannumeral0%
    \ifodd\XINT_LDg{#1}
        \xint_afterfi{ 1}%
    \else
        \xint_afterfi{ 0}%
    \fi
}%
\def\xintOdd {\romannumeral0\xintodd }%
\def\xintodd #1%
{%
    \ifodd\xintLDg{#1}
        \xint_afterfi{ 1}%
    \else
        \xint_afterfi{ 0}%
    \fi
}%
%    \end{macrocode}
% \subsection{\csh{xintDSL}}
% \lverb|&
% DECIMAL SHIFT LEFT (=MULTIPLICATION PAR 10)|
%    \begin{macrocode}
\def\xintDSL {\romannumeral0\xintdsl }%
\def\xintdsl #1%
{%
    \expandafter\XINT_dsl \romannumeral-`0#1\Z
}%
\def\XINT_DSL #1{\romannumeral0\XINT_dsl #1\Z }%
\def\XINT_dsl #1%
{%
    \xint_gob_til_zero #1\xint_dsl_zero 0\XINT_dsl_ #1%
}%
\def\xint_dsl_zero 0\XINT_dsl_ 0#1\Z { 0}%
\def\XINT_dsl_ #1\Z { #10}%
%    \end{macrocode}
% \subsection{\csh{xintDSR}}
% \lverb|&
% DECIMAL SHIFT RIGHT (=DIVISION PAR 10). Release 1.06b which replaced all @'s
% by 
% underscores left undefined the \xint_minus used in \XINT_dsr_b, and this bug
% was fixed only later in release 1.09b| 
%    \begin{macrocode}
\def\xintDSR {\romannumeral0\xintdsr }%
\def\xintdsr #1%
{%
    \expandafter\XINT_dsr_a\expandafter {\romannumeral-`0#1}\W\Z
}%
\def\XINT_DSR #1{\romannumeral0\XINT_dsr_a {#1}\W\Z }%
\def\XINT_dsr_a
{%
    \expandafter\XINT_dsr_b\romannumeral0\XINT_rev
}%
\def\XINT_dsr_b #1#2#3\Z
{%
    \xint_gob_til_W #2\xint_dsr_onedigit\W
    \xint_gob_til_minus #2\xint_dsr_onedigit-%
    \expandafter\XINT_dsr_removew
    \romannumeral0\XINT_rev {#2#3}%
}%
\def\xint_dsr_onedigit #1\XINT_rev #2{ 0}%
\def\XINT_dsr_removew #1\W { }%
%    \end{macrocode}
% \subsection{\csh{xintDSH}, \csh{xintDSHr}}
% \lverb+DECIMAL SHIFTS \xintDSH {x}{A}$\
% si x <= 0, fait A -> A.10^(|x|). v1.03 corrige l'oversight pour A=0.n 
% si x >  0, et A >=0, fait A -> quo(A,10^(x))$\
% si x >  0, et A < 0, fait A -> -quo(-A,10^(x))$\
% (donc pour x > 0 c'est comme DSR itéré x fois)$\
% \xintDSHr donne le `reste' (si x<=0 donne zéro).
%
% Release 1.06 now feeds x to a \numexpr first. I will revise the legacy code on
% another occasion.+
%    \begin{macrocode}
\def\xintDSHr {\romannumeral0\xintdshr }%
\def\xintdshr #1%
{%
    \expandafter\XINT_dshr_checkxpositive \the\numexpr #1\relax\Z
}%
\def\XINT_dshr_checkxpositive #1%
{%
    \xint_UDzerominusfork
      0#1\dummy \XINT_dshr_xzeroorneg
      #1-\dummy \XINT_dshr_xzeroorneg
       0-\dummy \XINT_dshr_xpositive
    \krof #1%
}%
\def\XINT_dshr_xzeroorneg #1\Z #2{ 0}%
\def\XINT_dshr_xpositive #1\Z 
{%
    \expandafter\xint_secondoftwo_andstop\romannumeral0\xintdsx {#1}%
}%
\def\xintDSH {\romannumeral0\xintdsh }%
\def\xintdsh #1#2%
{%
    \expandafter\xint_dsh\expandafter {\romannumeral-`0#2}{#1}%
}%
\def\xint_dsh #1#2%
{%
    \expandafter\XINT_dsh_checksignx \the\numexpr #2\relax\Z {#1}%
}%
\def\XINT_dsh_checksignx #1%
{%
    \xint_UDzerominusfork
      #1-\dummy  \XINT_dsh_xiszero
      0#1\dummy  \XINT_dsx_xisNeg_checkA     % on passe direct dans DSx
       0-\dummy  {\XINT_dsh_xisPos #1}%
    \krof
}%
\def\XINT_dsh_xiszero #1\Z #2{ #2}%
\def\XINT_dsh_xisPos #1\Z #2%
{%
    \expandafter\xint_firstoftwo_andstop
    \romannumeral0\XINT_dsx_checksignA #2\Z {#1}% via DSx
}%
%    \end{macrocode}
% \subsection{\csh{xintDSx}}
% \lverb+Je fais cette routine pour la version 1.01, après modification de
% \xintDecSplit. Dorénavant \xintDSx fera appel à \xintDecSplit et de même 
% \xintDSH fera appel à \xintDSx. J'ai donc supprimé entièrement l'ancien code
% de \xintDSH et re-écrit entièrement celui de \xintDecSplit pour x positif.
%
% --> Attention le cas x=0 est traité dans la même catégorie que x > 0 <--$\
% si x < 0, fait A -> A.10^(|x|)$\
% si x >=  0, et A >=0, fait A -> {quo(A,10^(x))}{rem(A,10^(x))}$\
% si x >=  0, et A < 0, d'abord on calcule {quo(-A,10^(x))}{rem(-A,10^(x))}$\
%    puis, si le premier n'est pas nul on lui donne le signe -$\
%          si le premier est nul on donne le signe - au second.
%
% On peut donc toujours reconstituer l'original A par 10^x Q \pm R
% où il faut prendre le signe plus si Q est positif ou nul et le signe moins si
% Q est strictement négatif.
%
% Release 1.06 has a faster and more compactly coded \XINT_dsx_zeroloop. 
% Also, x is now given to a \numexpr. The earlier code should be then
% simplified, but I leave as is for the time being. 
%
% In 1.07, I decide to modify
% the coding of \XINT_dsx_zeroloop, to avoid
% impacting the input stack (which prevented doing truncation or rounding or
% float with more than eight times the size of input stack; 40000 = 8x5000
% digits on my installation.) I think this was the only place in the code with
% such non tail recursion, as I recall being careful to avoid problems within
% the Factorial and Power routines, but I would need to check. Too tired now
% after having finished \xintexpr, \xintNewExpr, and \xintfloatexpr!+
%    \begin{macrocode}
\def\xintDSx {\romannumeral0\xintdsx }%
\def\xintdsx #1#2%
{%
    \expandafter\xint_dsx\expandafter {\romannumeral-`0#2}{#1}%
}%
\def\xint_dsx #1#2%
{%
    \expandafter\XINT_dsx_checksignx \the\numexpr #2\relax\Z {#1}%
}%
\def\XINT_DSx #1#2{\romannumeral0\XINT_dsx_checksignx #1\Z {#2}}%
\def\XINT_dsx #1#2{\XINT_dsx_checksignx #1\Z {#2}}%
\def\XINT_dsx_checksignx #1%
{%
    \xint_UDzerominusfork
      #1-\dummy  \XINT_dsx_xisZero
      0#1\dummy  \XINT_dsx_xisNeg_checkA
       0-\dummy  {\XINT_dsx_xisPos #1}%
    \krof
}%
\def\XINT_dsx_xisZero #1\Z #2{ {#2}{0}}% attention comme x > 0
\def\XINT_dsx_xisNeg_checkA #1\Z #2%
{%
    \XINT_dsx_xisNeg_checkA_ #2\Z {#1}%
}%
\def\XINT_dsx_xisNeg_checkA_ #1#2\Z #3%
{%
    \xint_gob_til_zero #1\XINT_dsx_xisNeg_Azero 0%
    \XINT_dsx_xisNeg_checkx {#3}{#3}{}\Z {#1#2}%
}%
\def\XINT_dsx_xisNeg_Azero #1\Z #2{ 0}%
\def\XINT_dsx_xisNeg_checkx #1%
{%
    \ifnum #1>999999999
       \xint_afterfi 
       {\xintError:TooBigDecimalShift
        \expandafter\space\expandafter 0\xint_gobble_iv }%
    \else 
       \expandafter \XINT_dsx_zeroloop 
    \fi
}%
\def\XINT_dsx_zeroloop #1#2%
{%
    \ifnum #1<9 \XINT_dsx_exita\fi
    \expandafter\XINT_dsx_zeroloop\expandafter 
        {\the\numexpr #1-8}{#200000000}%
}%
\def\XINT_dsx_exita\fi\expandafter\XINT_dsx_zeroloop 
{%
    \fi\expandafter\XINT_dsx_exitb
}%
\def\XINT_dsx_exitb #1#2%
{%
    \expandafter\expandafter\expandafter
    \XINT_dsx_addzeros\csname xint_gobble_\romannumeral -#1\endcsname #2%
}%
\def\XINT_dsx_addzeros #1\Z #2{ #2#1}%
\def\XINT_dsx_xisPos #1\Z #2%
{%
    \XINT_dsx_checksignA #2\Z {#1}%
}%
\def\XINT_dsx_checksignA #1%
{%
    \xint_UDzerominusfork
      #1-\dummy  \XINT_dsx_AisZero
      0#1\dummy  \XINT_dsx_AisNeg
       0-\dummy  {\XINT_dsx_AisPos #1}%
    \krof
}%
\def\XINT_dsx_AisZero #1\Z #2{ {0}{0}}%
\def\XINT_dsx_AisNeg #1\Z #2%
{%
    \expandafter\XINT_dsx_AisNeg_dosplit_andcheckfirst
    \romannumeral0\XINT_split_checksizex {#2}{#1}%
}%
\def\XINT_dsx_AisNeg_dosplit_andcheckfirst #1%
{%
    \XINT_dsx_AisNeg_checkiffirstempty #1\Z
}%
\def\XINT_dsx_AisNeg_checkiffirstempty #1%
{%
    \xint_gob_til_Z #1\XINT_dsx_AisNeg_finish_zero\Z
    \XINT_dsx_AisNeg_finish_notzero #1%
}%
\def\XINT_dsx_AisNeg_finish_zero\Z
    \XINT_dsx_AisNeg_finish_notzero\Z #1%
{%
    \expandafter\XINT_dsx_end
    \expandafter {\romannumeral0\XINT_num {-#1}}{0}%
}%
\def\XINT_dsx_AisNeg_finish_notzero #1\Z #2%
{%
    \expandafter\XINT_dsx_end
    \expandafter {\romannumeral0\XINT_num {#2}}{-#1}%
}%
\def\XINT_dsx_AisPos #1\Z #2%
{%
    \expandafter\XINT_dsx_AisPos_finish
    \romannumeral0\XINT_split_checksizex {#2}{#1}%
}%
\def\XINT_dsx_AisPos_finish #1#2%
{%
    \expandafter\XINT_dsx_end
    \expandafter {\romannumeral0\XINT_num {#2}}%
                 {\romannumeral0\XINT_num {#1}}%
}%
\def\XINT_dsx_end #1#2%
{%
    \expandafter\space\expandafter{#2}{#1}%
}%
%    \end{macrocode}
% \subsection{\csh{xintDecSplit},~\csh{xintDecSplitL},~\csh{xintDecSplitR}}
% \lverb!DECIMAL SPLIT
%
% The macro \xintDecSplit {x}{A} first replaces A with |A| (*)
% This macro cuts the number into two pieces L and R. The concatenation LR
% always reproduces |A|, and R may be empty or have leading zeros. The
% position of the cut is specified by the first argument x. If x is zero or
% positive the cut location is x slots to the left of the right end of the
% number. If x becomes equal to or larger than the length of the number then L
% becomes empty. If x is negative the location of the cut is |x| slots to the
% right of the left end of the number. 
%
% (*) warning: this may change in a future version. Only the behavior
% for A non-negative is guaranteed to remain the same.
%
% v1.05a: \XINT_split_checksizex does not compute the length anymore, rather the
% error will be from a \numexpr; but the limit of 999999999 does not make much
% sense. 
%
% v1.06: Improvements in \XINT_split_fromleft_loop, \XINT_split_fromright_loop
% and related macros. More readable coding, speed gains.
% Also, I now feed immediately a \numexpr with x. Some simplifications should
% probably be made to the code, which is kept as is for the time being.!
%    \begin{macrocode}
\def\xintDecSplitL {\romannumeral0\xintdecsplitl }%
\def\xintDecSplitR {\romannumeral0\xintdecsplitr }%
\def\xintdecsplitl 
{%
    \expandafter\xint_firstoftwo_andstop
    \romannumeral0\xintdecsplit 
}%
\def\xintdecsplitr 
{%
    \expandafter\xint_secondoftwo_andstop
    \romannumeral0\xintdecsplit 
}%
\def\xintDecSplit {\romannumeral0\xintdecsplit }%
\def\xintdecsplit #1#2%
{%
    \expandafter \xint_split \expandafter
    {\romannumeral0\xintiabs {#2}}{#1}%  fait expansion de A
}%
\def\xint_split #1#2%
{%
    \expandafter\XINT_split_checksizex\expandafter{\the\numexpr #2}{#1}% 
}%
\def\XINT_split_checksizex #1% 999999999 is anyhow very big, could be reduced
{%
    \ifnum\numexpr\XINT_Abs{#1}>999999999 
       \xint_afterfi {\xintError:TooBigDecimalSplit\XINT_split_bigx }%
    \else
       \expandafter\XINT_split_xfork
    \fi
    #1\Z
}%
\def\XINT_split_bigx  #1\Z #2%
{%
    \ifcase\XINT_Sgn {#1}
    \or \xint_afterfi { {}{#2}}% positive big x
    \else  
        \xint_afterfi { {#2}{}}% negative big x
    \fi
}%
\def\XINT_split_xfork #1%
{%
    \xint_UDzerominusfork
      #1-\dummy  \XINT_split_zerosplit
      0#1\dummy  \XINT_split_fromleft
       0-\dummy  {\XINT_split_fromright #1}%
    \krof
}%
\def\XINT_split_zerosplit #1\Z #2{ {#2}{}}%
\def\XINT_split_fromleft  #1\Z #2%
{%
    \XINT_split_fromleft_loop {#1}{}#2\W\W\W\W\W\W\W\W\Z 
}%
\def\XINT_split_fromleft_loop #1%
{%
    \ifnum #1<8 \XINT_split_fromleft_exita\fi
    \expandafter\XINT_split_fromleft_loop_perhaps\expandafter
    {\the\numexpr #1-8\expandafter}\XINT_split_fromleft_eight
}%
\def\XINT_split_fromleft_eight #1#2#3#4#5#6#7#8#9{#9{#1#2#3#4#5#6#7#8#9}}%
\def\XINT_split_fromleft_loop_perhaps #1#2%
{%
    \xint_gob_til_W #2\XINT_split_fromleft_toofar\W
    \XINT_split_fromleft_loop {#1}%
}%
\def\XINT_split_fromleft_toofar\W\XINT_split_fromleft_loop #1#2#3\Z
{%
    \XINT_split_fromleft_toofar_b #2\Z
}%
\def\XINT_split_fromleft_toofar_b #1\W #2\Z { {#1}{}}%
\def\XINT_split_fromleft_exita\fi
    \expandafter\XINT_split_fromleft_loop_perhaps\expandafter #1#2%
   {\fi \XINT_split_fromleft_exitb #1}%
\def\XINT_split_fromleft_exitb\the\numexpr #1-8\expandafter
{%
    \csname XINT_split_fromleft_endsplit_\romannumeral #1\endcsname
}%
\def\XINT_split_fromleft_endsplit_ #1#2\W #3\Z { {#1}{#2}}%
\def\XINT_split_fromleft_endsplit_i #1#2%
                {\XINT_split_fromleft_checkiftoofar #2{#1#2}}%
\def\XINT_split_fromleft_endsplit_ii #1#2#3%
                {\XINT_split_fromleft_checkiftoofar #3{#1#2#3}}%
\def\XINT_split_fromleft_endsplit_iii #1#2#3#4%
                {\XINT_split_fromleft_checkiftoofar #4{#1#2#3#4}}%
\def\XINT_split_fromleft_endsplit_iv #1#2#3#4#5%
                {\XINT_split_fromleft_checkiftoofar #5{#1#2#3#4#5}}%
\def\XINT_split_fromleft_endsplit_v #1#2#3#4#5#6%
                {\XINT_split_fromleft_checkiftoofar #6{#1#2#3#4#5#6}}%
\def\XINT_split_fromleft_endsplit_vi #1#2#3#4#5#6#7%
                {\XINT_split_fromleft_checkiftoofar #7{#1#2#3#4#5#6#7}}%
\def\XINT_split_fromleft_endsplit_vii #1#2#3#4#5#6#7#8%
                {\XINT_split_fromleft_checkiftoofar #8{#1#2#3#4#5#6#7#8}}%
\def\XINT_split_fromleft_checkiftoofar #1#2#3\W #4\Z 
{%
    \xint_gob_til_W #1\XINT_split_fromleft_wenttoofar\W
    \space {#2}{#3}%
}%
\def\XINT_split_fromleft_wenttoofar\W\space #1%
{%
    \XINT_split_fromleft_wenttoofar_b #1\Z
}%
\def\XINT_split_fromleft_wenttoofar_b #1\W #2\Z { {#1}}%
\def\XINT_split_fromright #1\Z #2%
{%
    \expandafter \XINT_split_fromright_a \expandafter
    {\romannumeral0\XINT_rev {#2}}{#1}{#2}%
}%
\def\XINT_split_fromright_a #1#2%
{%
    \XINT_split_fromright_loop {#2}{}#1\W\W\W\W\W\W\W\W\Z
}%
\def\XINT_split_fromright_loop #1%
{%
    \ifnum #1<8 \XINT_split_fromright_exita\fi
    \expandafter\XINT_split_fromright_loop_perhaps\expandafter
    {\the\numexpr #1-8\expandafter }\XINT_split_fromright_eight
}%
\def\XINT_split_fromright_eight #1#2#3#4#5#6#7#8#9{#9{#9#8#7#6#5#4#3#2#1}}%
\def\XINT_split_fromright_loop_perhaps #1#2%
{%
    \xint_gob_til_W #2\XINT_split_fromright_toofar\W
    \XINT_split_fromright_loop {#1}%
}%
\def\XINT_split_fromright_toofar\W\XINT_split_fromright_loop #1#2#3\Z { {}}%
\def\XINT_split_fromright_exita\fi
    \expandafter\XINT_split_fromright_loop_perhaps\expandafter #1#2%
    {\fi \XINT_split_fromright_exitb #1}%
\def\XINT_split_fromright_exitb\the\numexpr #1-8\expandafter
{%
    \csname XINT_split_fromright_endsplit_\romannumeral #1\endcsname
}%
\def\XINT_split_fromright_endsplit_ #1#2\W #3\Z #4%
{%
    \expandafter\space\expandafter {\romannumeral0\XINT_rev{#2}}{#1}%
}%
\def\XINT_split_fromright_endsplit_i   #1#2%
            {\XINT_split_fromright_checkiftoofar #2{#2#1}}%
\def\XINT_split_fromright_endsplit_ii  #1#2#3%
            {\XINT_split_fromright_checkiftoofar #3{#3#2#1}}%
\def\XINT_split_fromright_endsplit_iii #1#2#3#4%
            {\XINT_split_fromright_checkiftoofar #4{#4#3#2#1}}%
\def\XINT_split_fromright_endsplit_iv  #1#2#3#4#5%
            {\XINT_split_fromright_checkiftoofar #5{#5#4#3#2#1}}%
\def\XINT_split_fromright_endsplit_v   #1#2#3#4#5#6%
            {\XINT_split_fromright_checkiftoofar #6{#6#5#4#3#2#1}}%
\def\XINT_split_fromright_endsplit_vi  #1#2#3#4#5#6#7%
            {\XINT_split_fromright_checkiftoofar #7{#7#6#5#4#3#2#1}}%
\def\XINT_split_fromright_endsplit_vii #1#2#3#4#5#6#7#8%
            {\XINT_split_fromright_checkiftoofar #8{#8#7#6#5#4#3#2#1}}%
\def\XINT_split_fromright_checkiftoofar #1%
{%
    \xint_gob_til_W #1\XINT_split_fromright_wenttoofar\W
    \XINT_split_fromright_endsplit_
}%
\def\XINT_split_fromright_wenttoofar\W\XINT_split_fromright_endsplit_ #1\Z #2%
    { {}{#2}}%
%    \end{macrocode}
% \subsection{\csh{xintDouble}}
% \lverb|v1.08|
%    \begin{macrocode}
\def\xintDouble {\romannumeral0\xintdouble }%
\def\xintdouble #1%
{%
     \expandafter\XINT_dbl\romannumeral-`0#1%
     \R\R\R\R\R\R\R\Z \W\W\W\W\W\W\W 
}%
\def\XINT_dbl #1%
{%
    \xint_UDzerominusfork
      #1-\dummy  \XINT_dbl_zero
      0#1\dummy  \XINT_dbl_neg
       0-\dummy {\XINT_dbl_pos #1}%
    \krof
}%
\def\XINT_dbl_zero #1\Z \W\W\W\W\W\W\W { 0}%
\def\XINT_dbl_neg 
   {\expandafter\xint_minus_andstop\romannumeral0\XINT_dbl_pos }%
\def\XINT_dbl_pos 
{%
    \expandafter\XINT_dbl_a \expandafter{\expandafter}\expandafter 0%
    \romannumeral0\XINT_SQ {}% 
}%
\def\XINT_dbl_a #1#2#3#4#5#6#7#8#9%
{%
    \xint_gob_til_W #9\XINT_dbl_end_a\W
    \expandafter\XINT_dbl_b
    \the\numexpr \xint_c_x^viii+#2+\xint_c_ii*#9#8#7#6#5#4#3\relax {#1}%
}%
\def\XINT_dbl_b 1#1#2#3#4#5#6#7#8#9%
{%
    \XINT_dbl_a {#2#3#4#5#6#7#8#9}{#1}%
}%
\def\XINT_dbl_end_a #1+#2+#3\relax #4%
{%
    \expandafter\XINT_dbl_end_b #2#4%
}%
\def\XINT_dbl_end_b #1#2#3#4#5#6#7#8%
{%
    \expandafter\space\the\numexpr #1#2#3#4#5#6#7#8\relax
}%
%    \end{macrocode}
% \subsection{\csh{xintHalf}}
% \lverb!v1.08!
%    \begin{macrocode}
\def\xintHalf {\romannumeral0\xinthalf }%
\def\xinthalf #1%
{%
     \expandafter\XINT_half\romannumeral-`0#1%
     \R\R\R\R\R\R\R\Z \W\W\W\W\W\W\W 
}%
\def\XINT_half #1%
{%
    \xint_UDzerominusfork
      #1-\dummy  \XINT_half_zero
      0#1\dummy  \XINT_half_neg
       0-\dummy {\XINT_half_pos #1}%
    \krof
}%
\def\XINT_half_zero #1\Z \W\W\W\W\W\W\W { 0}%
\def\XINT_half_neg {\expandafter\XINT_opp\romannumeral0\XINT_half_pos }%
\def\XINT_half_pos {\expandafter\XINT_half_a\romannumeral0\XINT_SQ {}}%
\def\XINT_half_a #1#2#3#4#5#6#7#8%
{%
    \xint_gob_til_W #8\XINT_half_dont\W
    \expandafter\XINT_half_b
    \the\numexpr \xint_c_x^viii+\xint_c_v*#7#6#5#4#3#2#1\relax #8%
}%
\def\XINT_half_dont\W\expandafter\XINT_half_b
    \the\numexpr \xint_c_x^viii+\xint_c_v*#1#2#3#4#5#6#7\relax \W\W\W\W\W\W\W
{%
    \expandafter\space
    \the\numexpr (#1#2#3#4#5#6#7+\xint_c_i)/\xint_c_ii-\xint_c_i \relax
}%
\def\XINT_half_b 1#1#2#3#4#5#6#7#8%
{%
    \XINT_half_c {#2#3#4#5#6#7}{#1}%
}%
\def\XINT_half_c #1#2#3#4#5#6#7#8#9%
{%
    \xint_gob_til_W #3\XINT_half_end_a #2\W
    \expandafter\XINT_half_d
    \the\numexpr \xint_c_x^viii+\xint_c_v*#9#8#7#6#5#4#3+#2\relax {#1}%
}%
\def\XINT_half_d 1#1#2#3#4#5#6#7#8#9%
{%
    \XINT_half_c {#2#3#4#5#6#7#8#9}{#1}%
}%
\def\XINT_half_end_a #1\W #2\relax #3%
{%
    \xint_gob_til_zero #1\XINT_half_end_b 0\space #1#3%
}%
\def\XINT_half_end_b 0\space 0#1#2#3#4#5#6#7%
{%
    \expandafter\space\the\numexpr #1#2#3#4#5#6#7\relax
}%
%    \end{macrocode}
% \subsection{\csh{xintDec}}
% \lverb!v1.08!
%    \begin{macrocode}
\def\xintDec {\romannumeral0\xintdec }%
\def\xintdec #1%
{%
     \expandafter\XINT_dec\romannumeral-`0#1%
     \R\R\R\R\R\R\R\R\Z \W\W\W\W\W\W\W\W 
}%
\def\XINT_dec #1%
{%
    \xint_UDzerominusfork
      #1-\dummy  \XINT_dec_zero
      0#1\dummy  \XINT_dec_neg
       0-\dummy {\XINT_dec_pos #1}%
    \krof
}%
\def\XINT_dec_zero #1\W\W\W\W\W\W\W\W { -1}%
\def\XINT_dec_neg 
   {\expandafter\xint_minus_andstop\romannumeral0\XINT_inc_pos }%
\def\XINT_dec_pos
{%
    \expandafter\XINT_dec_a \expandafter{\expandafter}%
    \romannumeral0\XINT_OQ {}%
}%
\def\XINT_dec_a #1#2#3#4#5#6#7#8#9%
{%
    \expandafter\XINT_dec_b
    \the\numexpr 11#9#8#7#6#5#4#3#2-\xint_c_i\relax {#1}%
}%
\def\XINT_dec_b 1#1%
{%
    \xint_gob_til_one #1\XINT_dec_A 1\XINT_dec_c 
}%
\def\XINT_dec_c #1#2#3#4#5#6#7#8#9{\XINT_dec_a {#1#2#3#4#5#6#7#8#9}}%
\def\XINT_dec_A 1\XINT_dec_c #1#2#3#4#5#6#7#8#9%
   {\XINT_dec_B {#1#2#3#4#5#6#7#8#9}}%
\def\XINT_dec_B #1#2\W\W\W\W\W\W\W\W 
{% 
    \expandafter\XINT_dec_cleanup
    \romannumeral0\XINT_rord_main {}#2%
      \xint_relax
        \xint_undef\xint_undef\xint_undef\xint_undef
        \xint_undef\xint_undef\xint_undef\xint_undef
      \xint_relax
    #1%
}%
\def\XINT_dec_cleanup #1#2#3#4#5#6#7#8%
{\expandafter\space\the\numexpr #1#2#3#4#5#6#7#8\relax }%
%    \end{macrocode}
% \subsection{\csh{xintInc}}
% \lverb!v1.08!
%    \begin{macrocode}
\def\xintInc {\romannumeral0\xintinc }%
\def\xintinc #1%
{%
     \expandafter\XINT_inc\romannumeral-`0#1%
     \R\R\R\R\R\R\R\R\Z \W\W\W\W\W\W\W\W
}%
\def\XINT_inc #1%
{%
    \xint_UDzerominusfork
      #1-\dummy  \XINT_inc_zero
      0#1\dummy  \XINT_inc_neg
       0-\dummy {\XINT_inc_pos #1}%
    \krof
}%
\def\XINT_inc_zero #1\W\W\W\W\W\W\W\W { 1}%
\def\XINT_inc_neg {\expandafter\XINT_opp\romannumeral0\XINT_dec_pos }%
\def\XINT_inc_pos
{%
    \expandafter\XINT_inc_a \expandafter{\expandafter}%
    \romannumeral0\XINT_OQ {}%
}%
\def\XINT_inc_a #1#2#3#4#5#6#7#8#9%
{%
    \xint_gob_til_W #9\XINT_inc_end\W
    \expandafter\XINT_inc_b
    \the\numexpr 10#9#8#7#6#5#4#3#2+\xint_c_i\relax {#1}%
}%
\def\XINT_inc_b 1#1%
{%
    \xint_gob_til_zero #1\XINT_inc_A 0\XINT_inc_c 
}%
\def\XINT_inc_c #1#2#3#4#5#6#7#8#9{\XINT_inc_a {#1#2#3#4#5#6#7#8#9}}%
\def\XINT_inc_A 0\XINT_inc_c #1#2#3#4#5#6#7#8#9%
               {\XINT_dec_B {#1#2#3#4#5#6#7#8#9}}%
\def\XINT_inc_end\W #1\relax #2{ 1#2}%
%    \end{macrocode}
% \subsection{\csh{xintiSqrt}, \csh{xintiSquareRoot}}
% \lverb!v1.08. 1.09a uses \xintnum!
%    \begin{macrocode}
\def\XINT_dsx_addzerosnofuss #1{\XINT_dsx_zeroloop {#1}{}\Z }%
\def\xintiSqrt {\romannumeral0\xintisqrt }%
\def\xintisqrt
    {\expandafter\XINT_sqrt_post\romannumeral0\xintisquareroot }%
\def\XINT_sqrt_post #1#2{\XINT_dec_pos #1\R\R\R\R\R\R\R\R\Z
                                         \W\W\W\W\W\W\W\W }%
\def\xintiSquareRoot {\romannumeral0\xintisquareroot }%
\def\xintisquareroot #1%
    {\expandafter\XINT_sqrt_checkin\romannumeral0\xintnum{#1}\Z}%
\def\XINT_sqrt_checkin #1%
{%
    \xint_UDzerominusfork
     #1-\dummy  \XINT_sqrt_iszero
     0#1\dummy  \XINT_sqrt_isneg
      0-\dummy {\XINT_sqrt #1}%
    \krof
}%
\def\XINT_sqrt_iszero #1\Z { 0}%
\def\XINT_sqrt_isneg  #1\Z {\xintError:RootOfNegative\space 0}%
\def\XINT_sqrt #1\Z
{%
    \expandafter\XINT_sqrt_start\expandafter
    {\romannumeral0\XINT_length {#1}}{#1}%
}%
\def\XINT_sqrt_start #1%
{%
    \ifnum #1<\xint_c_x
       \expandafter\XINT_sqrt_small_a
    \else
       \expandafter\XINT_sqrt_big_a
    \fi
    {#1}%
}%
\def\XINT_sqrt_small_a #1{\XINT_sqrt_a {#1}\XINT_sqrt_small_d }%
\def\XINT_sqrt_big_a   #1{\XINT_sqrt_a {#1}\XINT_sqrt_big_d   }%
\def\XINT_sqrt_a #1%
{%
   \ifodd #1
     \expandafter\XINT_sqrt_bB
   \else
     \expandafter\XINT_sqrt_bA
   \fi
   {#1}%
}%
\def\XINT_sqrt_bA #1#2#3%
{%
    \XINT_sqrt_bA_b #3\Z #2{#1}{#3}%
}%
\def\XINT_sqrt_bA_b #1#2#3\Z 
{%
    \XINT_sqrt_c {#1#2}%
}%
\def\XINT_sqrt_bB #1#2#3%
{%
    \XINT_sqrt_bB_b #3\Z #2{#1}{#3}%
}%
\def\XINT_sqrt_bB_b #1#2\Z 
{%
    \XINT_sqrt_c #1%
}%
\def\XINT_sqrt_c #1#2%
{%
    \expandafter #2%
    \ifcase #1
    \or 2\or 2\or 2\or 3\or 3\or 3\or 3\or 3\or %3+5
    4\or 4\or 4\or 4\or 4\or 4\or 4\or           %+7
    5\or 5\or 5\or 5\or 5\or 5\or 5\or 5\or 5\or %+9
    6\or 6\or 6\or 6\or 6\or 6\or 6\or 6\or 6\or 6\or 6\or %+11
    7\or 7\or 7\or 7\or 7\or 7\or 7\or 7\or 7\or 7\or 7\or 7\or 7\or %+13
    8\or 8\or 8\or 8\or 8\or 8\or 8\or 
    8\or 8\or 8\or 8\or 8\or 8\or 8\or 8\or %+15
    9\or 9\or 9\or 9\or 9\or 9\or 9\or 9\or 
    9\or 9\or 9\or 9\or 9\or 9\or 9\or 9\or 9\or %+17
    10\or 10\or 10\or 10\or 10\or 10\or 10\or 10\or 10\or
    10\or 10\or 10\or 10\or 10\or 10\or 10\or 10\or 10\or 10\or\fi %+19
}%
\def\XINT_sqrt_small_d #1\or #2\fi #3%
{%
   \fi
   \expandafter\XINT_sqrt_small_de
   \ifcase \numexpr #3/\xint_c_ii-\xint_c_i\relax
      {}%
   \or
      0%
   \or 
      {00}%
   \or
      {000}%
   \or
      {0000}%
   \or
   \fi {#1}%
}%
\def\XINT_sqrt_small_de #1\or #2\fi #3%
{%
    \fi\XINT_sqrt_small_e {#3#1}%
}%
\def\XINT_sqrt_small_e #1#2%
{%
   \expandafter\XINT_sqrt_small_f\expandafter {\the\numexpr #1*#1-#2}{#1}%
}%
\def\XINT_sqrt_small_f #1#2%
{%
   \expandafter\XINT_sqrt_small_g\expandafter
   {\the\numexpr ((#1+#2)/(\xint_c_ii*#2))-\xint_c_i}{#1}{#2}%
}%
\def\XINT_sqrt_small_g #1%
{%
    \ifnum #1>\xint_c_
       \expandafter\XINT_sqrt_small_h
    \else
       \expandafter\XINT_sqrt_small_end
    \fi
    {#1}%
}%
\def\XINT_sqrt_small_h #1#2#3%
{%
    \expandafter\XINT_sqrt_small_f\expandafter
    {\the\numexpr #2-\xint_c_ii*#1*#3+#1*#1\expandafter}\expandafter
    {\the\numexpr #3-#1}%
}%
\def\XINT_sqrt_small_end #1#2#3{ {#3}{#2}}%
\def\XINT_sqrt_big_d #1\or #2\fi #3% 
{%
   \fi
   \ifodd #3
     \xint_afterfi{\expandafter\XINT_sqrt_big_eB}%
   \else
     \xint_afterfi{\expandafter\XINT_sqrt_big_eA}%
   \fi
   \expandafter{\the\numexpr #3/\xint_c_ii }{#1}% 
}%
\def\XINT_sqrt_big_eA  #1#2#3%
{%
    \XINT_sqrt_big_eA_a #3\Z {#2}{#1}{#3}%
}%
\def\XINT_sqrt_big_eA_a #1#2#3#4#5#6#7#8#9\Z 
{%
    \XINT_sqrt_big_eA_b {#1#2#3#4#5#6#7#8}%
}%
\def\XINT_sqrt_big_eA_b #1#2%
{%
    \expandafter\XINT_sqrt_big_f
    \romannumeral0\XINT_sqrt_small_e {#2000}{#1}{#1}%
}%
\def\XINT_sqrt_big_eB #1#2#3%
{%
    \XINT_sqrt_big_eB_a #3\Z {#2}{#1}{#3}%
}%
\def\XINT_sqrt_big_eB_a #1#2#3#4#5#6#7#8#9%
{%
    \XINT_sqrt_big_eB_b {#1#2#3#4#5#6#7#8#9}%
}%
\def\XINT_sqrt_big_eB_b #1#2\Z #3%
{%
    \expandafter\XINT_sqrt_big_f
    \romannumeral0\XINT_sqrt_small_e {#30000}{#1}{#1}%
}%
\def\XINT_sqrt_big_f #1#2#3#4%
{%
   \expandafter\XINT_sqrt_big_f_a\expandafter
   {\the\numexpr #2+#3\expandafter}\expandafter
   {\romannumeral0\XINT_dsx_addzerosnofuss 
                    {\numexpr #4-\xint_c_iv\relax}{#1}}{#4}%
}%
\def\XINT_sqrt_big_f_a #1#2#3#4%
{%
   \expandafter\XINT_sqrt_big_g\expandafter
   {\romannumeral0\xintiisub 
       {\XINT_dsx_addzerosnofuss 
        {\numexpr \xint_c_ii*#3-\xint_c_viii\relax}{#1}}{#4}}%
   {#2}{#3}% 
}%
\def\XINT_sqrt_big_g #1#2%
{%
    \expandafter\XINT_sqrt_big_j
    \romannumeral0\xintidivision{#1}
        {\romannumeral0\XINT_dbl_pos #2\R\R\R\R\R\R\R\Z \W\W\W\W\W\W\W }{#2}%
}%
\def\XINT_sqrt_big_j #1%
{%
    \ifcase\XINT_Sgn {#1}
        \expandafter \XINT_sqrt_big_end
    \or \expandafter \XINT_sqrt_big_k
    \fi {#1}%
}%
\def\XINT_sqrt_big_k #1#2#3%
{%
    \expandafter\XINT_sqrt_big_l\expandafter
    {\romannumeral0\xintiisub {#3}{#1}}%
    {\romannumeral0\xintiiadd {#2}{\xintiiSqr {#1}}}%
}%
\def\XINT_sqrt_big_l #1#2%
{%
   \expandafter\XINT_sqrt_big_g\expandafter
   {#2}{#1}%
}%
\def\XINT_sqrt_big_end #1#2#3#4{ {#3}{#2}}%
\XINT_restorecatcodes_endinput%
%    \end{macrocode}
%\catcode`\<=0 \catcode`\>=11 \catcode`\*=11 \catcode`\/=11
%\let</xint>\relax
%\def<*xintbinhex>{\catcode`\<=12 \catcode`\>=12 \catcode`\*=12 \catcode`\/=12 }
%</xint>
%<*xintbinhex>
%
% \StoreCodelineNo {xint}
%
% \section{Package \xintbinhexname implementation}
% 
% The commenting is currently (\docdate) very sparse.
% 
% \localtableofcontents
% \subsection{Catcodes, \protect\eTeX{} and reload detection}
%
% The code for reload detection is copied from \textsc{Heiko
% Oberdiek}'s packages, and adapted here to check for previous
% loading of the master \xintname package.
%
% The method for catcodes is slightly different, but still
% directly inspired by these packages.
%
%    \begin{macrocode}
\begingroup\catcode61\catcode48\catcode32=10\relax%
  \catcode13=5    % ^^M
  \endlinechar=13 %
  \catcode123=1   % {
  \catcode125=2   % }
  \catcode64=11   % @
  \catcode35=6    % #
  \catcode44=12   % ,
  \catcode45=12   % -
  \catcode46=12   % .
  \catcode58=12   % :
  \def\space { }%
  \let\z\endgroup
  \expandafter\let\expandafter\x\csname ver@xintbinhex.sty\endcsname
  \expandafter\let\expandafter\w\csname ver@xint.sty\endcsname
  \expandafter
    \ifx\csname PackageInfo\endcsname\relax
      \def\y#1#2{\immediate\write-1{Package #1 Info: #2.}}%
    \else
      \def\y#1#2{\PackageInfo{#1}{#2}}%
    \fi
  \expandafter
  \ifx\csname numexpr\endcsname\relax
     \y{xintbinhex}{\numexpr not available, aborting input}%
     \aftergroup\endinput
  \else
    \ifx\x\relax   % plain-TeX, first loading of xintbinhex.sty
      \ifx\w\relax % but xint.sty not yet loaded.
         \y{xintbinhex}{Package xint is required}%
         \y{xintbinhex}{Will try \string\input\space xint.sty}%
         \def\z{\endgroup\input xint.sty\relax}%
      \fi
    \else
      \def\empty {}%
      \ifx\x\empty % LaTeX, first loading,
      % variable is initialized, but \ProvidesPackage not yet seen
          \ifx\w\relax % xint.sty not yet loaded.
            \y{xintbinhex}{Package xint is required}%
            \y{xintbinhex}{Will try \string\RequirePackage{xint}}%
            \def\z{\endgroup\RequirePackage{xint}}%
          \fi
      \else
        \y{xintbinhex}{I was already loaded, aborting input}%
        \aftergroup\endinput
      \fi
    \fi
  \fi
\z%
%    \end{macrocode}
% \subsection{Confirmation of \xintname loading}
%    \begin{macrocode}
\begingroup\catcode61\catcode48\catcode32=10\relax%
  \catcode13=5    % ^^M
  \endlinechar=13 %
  \catcode123=1   % {
  \catcode125=2   % }
  \catcode64=11   % @
  \catcode35=6    % #
  \catcode44=12   % ,
  \catcode45=12   % -
  \catcode46=12   % .
  \catcode58=12   % :
  \expandafter
    \ifx\csname PackageInfo\endcsname\relax
      \def\y#1#2{\immediate\write-1{Package #1 Info: #2.}}%
    \else
      \def\y#1#2{\PackageInfo{#1}{#2}}%
    \fi
  \def\empty {}%
  \expandafter\let\expandafter\w\csname ver@xint.sty\endcsname
  \ifx\w\relax % Plain TeX, user gave a file name at the prompt
      \y{xintbinhex}{Loading of package xint failed, aborting input}%
      \aftergroup\endinput
  \fi
  \ifx\w\empty % LaTeX, user gave a file name at the prompt
      \y{xintbinhex}{Loading of package xint failed, aborting input}%
      \aftergroup\endinput
  \fi
\endgroup%
%    \end{macrocode}
% \subsection{Catcodes}
%
% Perhaps catcodes have changed after the loading of \xintname
% and prior to the current loading of \xintbinhexname, so we redefine
% the |\XINT_restorecatcodes_endinput| in this style file. 
%
%    \begin{macrocode}
\XINTsetupcatcodes%
%    \end{macrocode}
% \subsection{Package identification}
%    \begin{macrocode}
\XINT_providespackage
\ProvidesPackage{xintbinhex}%
  [2013/10/03 v1.09b Expandable binary and hexadecimal conversions (jfB)]%
%    \end{macrocode}
% \subsection{Constants, etc...}
% \lverb!v1.08!
%    \begin{macrocode}
\chardef\xint_c_xvi           16
\chardef\xint_c_ii^v          32
\chardef\xint_c_ii^vi         64
\chardef\xint_c_ii^vii       128
\mathchardef\xint_c_ii^viii  256
\mathchardef\xint_c_ii^xii  4096
\newcount\xint_c_ii^xv  \xint_c_ii^xv  32768
\newcount\xint_c_ii^xvi \xint_c_ii^xvi 65536
\newcount\xint_c_x^v    \xint_c_x^v    100000
\newcount\xint_c_x^ix   \xint_c_x^ix   1000000000
\def\XINT_tmp_def #1{%
  \expandafter\edef\csname XINT_sdth_#1\endcsname
  {\ifcase #1 0\or 1\or 2\or 3\or 4\or 5\or 6\or 7\or
              8\or 9\or A\or B\or C\or D\or E\or F\fi}}%
\xintApplyInline\XINT_tmp_def 
    {{0}{1}{2}{3}{4}{5}{6}{7}{8}{9}{10}{11}{12}{13}{14}{15}}%
\def\XINT_tmp_def #1{%
  \expandafter\edef\csname XINT_sdtb_#1\endcsname
  {\ifcase #1 
   0000\or 0001\or 0010\or 0011\or 0100\or 0101\or 0110\or 0111\or
   1000\or 1001\or 1010\or 1011\or 1100\or 1101\or 1110\or 1111\fi}}%
\xintApplyInline\XINT_tmp_def 
    {{0}{1}{2}{3}{4}{5}{6}{7}{8}{9}{10}{11}{12}{13}{14}{15}}%
\let\XINT_tmp_def\empty
\expandafter\def\csname XINT_sbtd_0000\endcsname {0}%
\expandafter\def\csname XINT_sbtd_0001\endcsname {1}%
\expandafter\def\csname XINT_sbtd_0010\endcsname {2}%
\expandafter\def\csname XINT_sbtd_0011\endcsname {3}%
\expandafter\def\csname XINT_sbtd_0100\endcsname {4}%
\expandafter\def\csname XINT_sbtd_0101\endcsname {5}%
\expandafter\def\csname XINT_sbtd_0110\endcsname {6}%
\expandafter\def\csname XINT_sbtd_0111\endcsname {7}%
\expandafter\def\csname XINT_sbtd_1000\endcsname {8}%
\expandafter\def\csname XINT_sbtd_1001\endcsname {9}%
\expandafter\def\csname XINT_sbtd_1010\endcsname {10}%
\expandafter\def\csname XINT_sbtd_1011\endcsname {11}%
\expandafter\def\csname XINT_sbtd_1100\endcsname {12}%
\expandafter\def\csname XINT_sbtd_1101\endcsname {13}%
\expandafter\def\csname XINT_sbtd_1110\endcsname {14}%
\expandafter\def\csname XINT_sbtd_1111\endcsname {15}%
\expandafter\let\csname XINT_sbth_0000\expandafter\endcsname
                \csname XINT_sbtd_0000\endcsname
\expandafter\let\csname XINT_sbth_0001\expandafter\endcsname
                \csname XINT_sbtd_0001\endcsname
\expandafter\let\csname XINT_sbth_0010\expandafter\endcsname
                \csname XINT_sbtd_0010\endcsname
\expandafter\let\csname XINT_sbth_0011\expandafter\endcsname
                \csname XINT_sbtd_0011\endcsname
\expandafter\let\csname XINT_sbth_0100\expandafter\endcsname
                \csname XINT_sbtd_0100\endcsname
\expandafter\let\csname XINT_sbth_0101\expandafter\endcsname
                \csname XINT_sbtd_0101\endcsname
\expandafter\let\csname XINT_sbth_0110\expandafter\endcsname
                \csname XINT_sbtd_0110\endcsname
\expandafter\let\csname XINT_sbth_0111\expandafter\endcsname
                \csname XINT_sbtd_0111\endcsname
\expandafter\let\csname XINT_sbth_1000\expandafter\endcsname
                \csname XINT_sbtd_1000\endcsname
\expandafter\let\csname XINT_sbth_1001\expandafter\endcsname
                \csname XINT_sbtd_1001\endcsname
\expandafter\def\csname XINT_sbth_1010\endcsname {A}%
\expandafter\def\csname XINT_sbth_1011\endcsname {B}%
\expandafter\def\csname XINT_sbth_1100\endcsname {C}%
\expandafter\def\csname XINT_sbth_1101\endcsname {D}%
\expandafter\def\csname XINT_sbth_1110\endcsname {E}%
\expandafter\def\csname XINT_sbth_1111\endcsname {F}%
\expandafter\def\csname XINT_shtb_0\endcsname {0000}%
\expandafter\def\csname XINT_shtb_1\endcsname {0001}%
\expandafter\def\csname XINT_shtb_2\endcsname {0010}%
\expandafter\def\csname XINT_shtb_3\endcsname {0011}%
\expandafter\def\csname XINT_shtb_4\endcsname {0100}%
\expandafter\def\csname XINT_shtb_5\endcsname {0101}%
\expandafter\def\csname XINT_shtb_6\endcsname {0110}%
\expandafter\def\csname XINT_shtb_7\endcsname {0111}%
\expandafter\def\csname XINT_shtb_8\endcsname {1000}%
\expandafter\def\csname XINT_shtb_9\endcsname {1001}%
\def\XINT_shtb_A {1010}%
\def\XINT_shtb_B {1011}%
\def\XINT_shtb_C {1100}%
\def\XINT_shtb_D {1101}%
\def\XINT_shtb_E {1110}%
\def\XINT_shtb_F {1111}%
\def\XINT_shtb_G {}%
\def\XINT_smallhex #1%
{%
    \expandafter\XINT_smallhex_a\expandafter
    {\the\numexpr (#1+\xint_c_viii)/\xint_c_xvi-\xint_c_i}{#1}%
}%
\def\XINT_smallhex_a #1#2%
{%
    \csname XINT_sdth_#1\expandafter\expandafter\expandafter\endcsname
    \csname XINT_sdth_\the\numexpr #2-\xint_c_xvi*#1\endcsname
}%
\def\XINT_smallbin #1%
{%
    \expandafter\XINT_smallbin_a\expandafter
    {\the\numexpr (#1+\xint_c_viii)/\xint_c_xvi-\xint_c_i}{#1}%
}%
\def\XINT_smallbin_a #1#2%
{%
    \csname XINT_sdtb_#1\expandafter\expandafter\expandafter\endcsname
    \csname XINT_sdtb_\the\numexpr #2-\xint_c_xvi*#1\endcsname
}%
%    \end{macrocode}
% \subsection{\csh{xintDecToHex}, \csh{xintDecToBin}}
% \lverb!v1.08!
%    \begin{macrocode}
\def\xintDecToHex {\romannumeral0\xintdectohex }%
\def\xintdectohex #1%
        {\expandafter\XINT_dth_checkin\romannumeral-`0#1\W\W\W\W \T}%
\def\XINT_dth_checkin #1%
{%
    \xint_UDsignfork
       #1\dummy \XINT_dth_N
        -\dummy {\XINT_dth_P #1}%
     \krof
}%
\def\XINT_dth_N {\expandafter\xint_minus_andstop\romannumeral0\XINT_dth_P }%
\def\XINT_dth_P {\expandafter\XINT_dth_III\romannumeral-`0\XINT_dtbh_I {0.}}%
\def\xintDecToBin {\romannumeral0\xintdectobin }%
\def\xintdectobin #1%
        {\expandafter\XINT_dtb_checkin\romannumeral-`0#1\W\W\W\W \T }%
\def\XINT_dtb_checkin #1%
{%
    \xint_UDsignfork
       #1\dummy \XINT_dtb_N
        -\dummy {\XINT_dtb_P #1}%
     \krof
}%
\def\XINT_dtb_N {\expandafter\xint_minus_andstop\romannumeral0\XINT_dtb_P }%
\def\XINT_dtb_P {\expandafter\XINT_dtb_III\romannumeral-`0\XINT_dtbh_I {0.}}%
\def\XINT_dtbh_I #1#2#3#4#5%
{%
    \xint_gob_til_W #5\XINT_dtbh_II_a\W\XINT_dtbh_I_a  {}{#2#3#4#5}#1\Z.%
}%
\def\XINT_dtbh_II_a\W\XINT_dtbh_I_a #1#2{\XINT_dtbh_II_b #2}%
\def\XINT_dtbh_II_b #1#2#3#4%
{%
    \xint_gob_til_W
      #1\XINT_dtbh_II_c
      #2\XINT_dtbh_II_ci
      #3\XINT_dtbh_II_cii
      \W\XINT_dtbh_II_ciii #1#2#3#4%
}%  
\def\XINT_dtbh_II_c \W\XINT_dtbh_II_ci
                    \W\XINT_dtbh_II_cii
                    \W\XINT_dtbh_II_ciii \W\W\W\W {{}}%
\def\XINT_dtbh_II_ci #1\XINT_dtbh_II_ciii #2\W\W\W 
   {\XINT_dtbh_II_d {}{#2}{0}}%
\def\XINT_dtbh_II_cii\W\XINT_dtbh_II_ciii #1#2\W\W 
   {\XINT_dtbh_II_d {}{#1#2}{00}}%
\def\XINT_dtbh_II_ciii #1#2#3\W
   {\XINT_dtbh_II_d {}{#1#2#3}{000}}%
\def\XINT_dtbh_I_a #1#2#3.%
{%
    \xint_gob_til_Z #3\XINT_dtbh_I_z\Z
    \expandafter\XINT_dtbh_I_b\the\numexpr #2+#30000.{#1}%    
}%
\def\XINT_dtbh_I_b #1.%
{%
    \expandafter\XINT_dtbh_I_c\the\numexpr 
    (#1+\xint_c_ii^xv)/\xint_c_ii^xvi-\xint_c_i.#1.%
}%
\def\XINT_dtbh_I_c #1.#2.%
{%
    \expandafter\XINT_dtbh_I_d\expandafter 
    {\the\numexpr #2-\xint_c_ii^xvi*#1}{#1}%   
}%
\def\XINT_dtbh_I_d #1#2#3{\XINT_dtbh_I_a {#3#1.}{#2}}%
\def\XINT_dtbh_I_z\Z\expandafter\XINT_dtbh_I_b\the\numexpr #1+#2.%
{%
    \ifnum #1=\xint_c_ \expandafter\XINT_dtbh_I_end_zb\fi
    \XINT_dtbh_I_end_za {#1}%
}%
\def\XINT_dtbh_I_end_za #1#2{\XINT_dtbh_I {#2#1.}}%
\def\XINT_dtbh_I_end_zb\XINT_dtbh_I_end_za #1#2{\XINT_dtbh_I {#2}}%
\def\XINT_dtbh_II_d #1#2#3#4.%
{%
    \xint_gob_til_Z #4\XINT_dtbh_II_z\Z
    \expandafter\XINT_dtbh_II_e\the\numexpr #2+#4#3.{#1}{#3}%    
}%
\def\XINT_dtbh_II_e #1.%
{%
    \expandafter\XINT_dtbh_II_f\the\numexpr 
        (#1+\xint_c_ii^xv)/\xint_c_ii^xvi-\xint_c_i.#1.%
}%
\def\XINT_dtbh_II_f #1.#2.%
{%
    \expandafter\XINT_dtbh_II_g\expandafter 
    {\the\numexpr #2-\xint_c_ii^xvi*#1}{#1}%   
}%
\def\XINT_dtbh_II_g #1#2#3{\XINT_dtbh_II_d {#3#1.}{#2}}%
\def\XINT_dtbh_II_z\Z\expandafter\XINT_dtbh_II_e\the\numexpr #1+#2.%
{%
    \ifnum #1=\xint_c_ \expandafter\XINT_dtbh_II_end_zb\fi
    \XINT_dtbh_II_end_za {#1}%
}%
\def\XINT_dtbh_II_end_za #1#2#3{{}#2#1.\Z.}%
\def\XINT_dtbh_II_end_zb\XINT_dtbh_II_end_za #1#2#3{{}#2\Z.}%
\def\XINT_dth_III #1#2.%
{%
    \xint_gob_til_Z #2\XINT_dth_end\Z
    \expandafter\XINT_dth_III\expandafter
    {\romannumeral-`0\XINT_dth_small #2.#1}%
}%
\def\XINT_dth_small #1.%
{%
    \expandafter\XINT_smallhex\expandafter
    {\the\numexpr (#1+\xint_c_ii^vii)/\xint_c_ii^viii-\xint_c_i\expandafter}%
    \romannumeral-`0\expandafter\XINT_smallhex\expandafter
    {\the\numexpr
    #1-((#1+\xint_c_ii^vii)/\xint_c_ii^viii-\xint_c_i)*\xint_c_ii^viii}% 
}%
\def\XINT_dth_end\Z\expandafter\XINT_dth_III\expandafter #1#2\T 
{%
    \XINT_dth_end_b #1%
}%
\def\XINT_dth_end_b #1.{\XINT_dth_end_c }%
\def\XINT_dth_end_c #1{\xint_gob_til_zero #1\XINT_dth_end_d 0\space #1}%
\def\XINT_dth_end_d 0\space 0#1%
{%  
    \xint_gob_til_zero #1\XINT_dth_end_e 0\space #1%
}%
\def\XINT_dth_end_e 0\space 0#1%
{%
    \xint_gob_til_zero #1\XINT_dth_end_f 0\space #1%
}%
\def\XINT_dth_end_f 0\space 0{ }%
\def\XINT_dtb_III #1#2.%
{%
    \xint_gob_til_Z #2\XINT_dtb_end\Z
    \expandafter\XINT_dtb_III\expandafter
    {\romannumeral-`0\XINT_dtb_small #2.#1}%
}%
\def\XINT_dtb_small #1.%
{%
    \expandafter\XINT_smallbin\expandafter
    {\the\numexpr (#1+\xint_c_ii^vii)/\xint_c_ii^viii-\xint_c_i\expandafter}%
    \romannumeral-`0\expandafter\XINT_smallbin\expandafter
    {\the\numexpr
    #1-((#1+\xint_c_ii^vii)/\xint_c_ii^viii-\xint_c_i)*\xint_c_ii^viii}% 
}%
\def\XINT_dtb_end\Z\expandafter\XINT_dtb_III\expandafter #1#2\T 
{%
    \XINT_dtb_end_b #1%
}%
\def\XINT_dtb_end_b #1.{\XINT_dtb_end_c }%
\def\XINT_dtb_end_c #1#2#3#4#5#6#7#8%
{%
    \expandafter\XINT_dtb_end_d\the\numexpr #1#2#3#4#5#6#7#8\relax
}%
\def\XINT_dtb_end_d #1#2#3#4#5#6#7#8#9%
{%
    \expandafter\space\the\numexpr #1#2#3#4#5#6#7#8#9\relax
}%
%    \end{macrocode}
% \subsection{\csh{xintHexToDec}}
% \lverb!v1.08!
%    \begin{macrocode}
\def\xintHexToDec {\romannumeral0\xinthextodec }%
\def\xinthextodec #1%
        {\expandafter\XINT_htd_checkin\romannumeral-`0#1\W\W\W\W \T }%
\def\XINT_htd_checkin #1%
{%
    \xint_UDsignfork
       #1\dummy \XINT_htd_neg
        -\dummy {\XINT_htd_I {0000}#1}%
     \krof
}%
\def\XINT_htd_neg {\expandafter\xint_minus_andstop
                   \romannumeral0\XINT_htd_I {0000}}%
\def\XINT_htd_I #1#2#3#4#5%
{%
    \xint_gob_til_W #5\XINT_htd_II_a\W
    \XINT_htd_I_a  {}{"#2#3#4#5}#1\Z\Z\Z\Z
}%
\def\XINT_htd_II_a \W\XINT_htd_I_a #1#2{\XINT_htd_II_b #2}%
\def\XINT_htd_II_b "#1#2#3#4%
{%
    \xint_gob_til_W
      #1\XINT_htd_II_c
      #2\XINT_htd_II_ci
      #3\XINT_htd_II_cii
      \W\XINT_htd_II_ciii #1#2#3#4%
}%  
\def\XINT_htd_II_c \W\XINT_htd_II_ci
                   \W\XINT_htd_II_cii
                   \W\XINT_htd_II_ciii \W\W\W\W #1\Z\Z\Z\Z\T 
{%
    \expandafter\xint_cleanupzeros_andstop
    \romannumeral0\XINT_rord_main {}#1%
      \xint_relax
        \xint_undef\xint_undef\xint_undef\xint_undef
        \xint_undef\xint_undef\xint_undef\xint_undef
      \xint_relax
}%
\def\XINT_htd_II_ci #1\XINT_htd_II_ciii 
                      #2\W\W\W {\XINT_htd_II_d {}{"#2}{\xint_c_xvi}}%
\def\XINT_htd_II_cii\W\XINT_htd_II_ciii 
                      #1#2\W\W {\XINT_htd_II_d {}{"#1#2}{\xint_c_ii^viii}}%
\def\XINT_htd_II_ciii #1#2#3\W {\XINT_htd_II_d {}{"#1#2#3}{\xint_c_ii^xii}}%
\def\XINT_htd_I_a #1#2#3#4#5#6%
{%
    \xint_gob_til_Z #3\XINT_htd_I_end_a\Z
    \expandafter\XINT_htd_I_b\the\numexpr
    #2+\xint_c_ii^xvi*#6#5#4#3+\xint_c_x^ix\relax {#1}%    
}%
\def\XINT_htd_I_b 1#1#2#3#4#5#6#7#8#9{\XINT_htd_I_c {#1#2#3#4#5}{#9#8#7#6}}%
\def\XINT_htd_I_c #1#2#3{\XINT_htd_I_a {#3#2}{#1}}%
\def\XINT_htd_I_end_a\Z\expandafter\XINT_htd_I_b\the\numexpr #1+#2\relax
{%  
    \expandafter\XINT_htd_I_end_b\the\numexpr \xint_c_x^v+#1\relax 
}%
\def\XINT_htd_I_end_b 1#1#2#3#4#5%
{%
    \xint_gob_til_zero #1\XINT_htd_I_end_bz0%
    \XINT_htd_I_end_c #1#2#3#4#5%
}%
\def\XINT_htd_I_end_c #1#2#3#4#5#6{\XINT_htd_I {#6#5#4#3#2#1000}}%
\def\XINT_htd_I_end_bz0\XINT_htd_I_end_c 0#1#2#3#4%
{%
    \xint_gob_til_zeros_iv #1#2#3#4\XINT_htd_I_end_bzz 0000%
    \XINT_htd_I_end_D {#4#3#2#1}%
}%
\def\XINT_htd_I_end_D  #1#2{\XINT_htd_I {#2#1}}%
\def\XINT_htd_I_end_bzz 0000\XINT_htd_I_end_D #1{\XINT_htd_I }%
\def\XINT_htd_II_d #1#2#3#4#5#6#7%
{%
    \xint_gob_til_Z #4\XINT_htd_II_end_a\Z
    \expandafter\XINT_htd_II_e\the\numexpr
    #2+#3*#7#6#5#4+\xint_c_x^viii\relax {#1}{#3}%    
}%
\def\XINT_htd_II_e 1#1#2#3#4#5#6#7#8{\XINT_htd_II_f {#1#2#3#4}{#5#6#7#8}}%
\def\XINT_htd_II_f #1#2#3{\XINT_htd_II_d {#2#3}{#1}}%
\def\XINT_htd_II_end_a\Z\expandafter\XINT_htd_II_e
    \the\numexpr #1+#2\relax #3#4\T
{%  
    \XINT_htd_II_end_b #1#3%
}%
\def\XINT_htd_II_end_b #1#2#3#4#5#6#7#8%
{%
    \expandafter\space\the\numexpr #1#2#3#4#5#6#7#8\relax
}%
%    \end{macrocode}
% \subsection{\csh{xintBinToDec}}
% \lverb!v1.08!
%    \begin{macrocode}
\def\xintBinToDec {\romannumeral0\xintbintodec }%
\def\xintbintodec #1{\expandafter\XINT_btd_checkin
                     \romannumeral-`0#1\W\W\W\W\W\W\W\W \T }%
\def\XINT_btd_checkin #1%
{%
    \xint_UDsignfork
       #1\dummy \XINT_btd_neg
        -\dummy {\XINT_btd_I {000000}#1}%
     \krof
}%
\def\XINT_btd_neg {\expandafter\xint_minus_andstop
                               \romannumeral0\XINT_btd_I {000000}}%
\def\XINT_btd_I #1#2#3#4#5#6#7#8#9%
{%
    \xint_gob_til_W #9\XINT_btd_II_a {#2#3#4#5#6#7#8#9}\W
    \XINT_btd_I_a {}{\csname XINT_sbtd_#2#3#4#5\endcsname*\xint_c_xvi+%
                     \csname XINT_sbtd_#6#7#8#9\endcsname}%
    #1\Z\Z\Z\Z\Z\Z
}%
\def\XINT_btd_II_a #1\W\XINT_btd_I_a #2#3{\XINT_btd_II_b #1}%
\def\XINT_btd_II_b #1#2#3#4#5#6#7#8%
{%
    \xint_gob_til_W 
      #1\XINT_btd_II_c
      #2\XINT_btd_II_ci
      #3\XINT_btd_II_cii
      #4\XINT_btd_II_ciii
      #5\XINT_btd_II_civ
      #6\XINT_btd_II_cv
      #7\XINT_btd_II_cvi
      \W\XINT_btd_II_cvii #1#2#3#4#5#6#7#8%
}%
\def\XINT_btd_II_c #1\XINT_btd_II_cvii \W\W\W\W\W\W\W\W #2\Z\Z\Z\Z\Z\Z\T
{%
    \expandafter\XINT_btd_II_c_end
    \romannumeral0\XINT_rord_main {}#2%
      \xint_relax
        \xint_undef\xint_undef\xint_undef\xint_undef
        \xint_undef\xint_undef\xint_undef\xint_undef
      \xint_relax
}%
\def\XINT_btd_II_c_end #1#2#3#4#5#6%
{%
    \expandafter\space\the\numexpr #1#2#3#4#5#6\relax
}%
\def\XINT_btd_II_ci  #1\XINT_btd_II_cvii #2\W\W\W\W\W\W\W
   {\XINT_btd_II_d {}{#2}{\xint_c_ii }}%
\def\XINT_btd_II_cii #1\XINT_btd_II_cvii #2\W\W\W\W\W\W
   {\XINT_btd_II_d {}{\csname XINT_sbtd_00#2\endcsname }{\xint_c_iv }}%
\def\XINT_btd_II_ciii #1\XINT_btd_II_cvii #2\W\W\W\W\W
   {\XINT_btd_II_d {}{\csname XINT_sbtd_0#2\endcsname }{\xint_c_viii }}%
\def\XINT_btd_II_civ #1\XINT_btd_II_cvii #2\W\W\W\W
   {\XINT_btd_II_d {}{\csname XINT_sbtd_#2\endcsname}{\xint_c_xvi }}%
\def\XINT_btd_II_cv #1\XINT_btd_II_cvii #2#3#4#5#6\W\W\W
{%
    \XINT_btd_II_d {}{\csname XINT_sbtd_#2#3#4#5\endcsname*\xint_c_ii+%
                          #6}{\xint_c_ii^v }%
}%
\def\XINT_btd_II_cvi #1\XINT_btd_II_cvii #2#3#4#5#6#7\W\W
{%
    \XINT_btd_II_d {}{\csname XINT_sbtd_#2#3#4#5\endcsname*\xint_c_iv+%
                      \csname XINT_sbtd_00#6#7\endcsname}{\xint_c_ii^vi }%
}%
\def\XINT_btd_II_cvii #1#2#3#4#5#6#7\W
{%
    \XINT_btd_II_d {}{\csname XINT_sbtd_#1#2#3#4\endcsname*\xint_c_viii+%
                      \csname XINT_sbtd_0#5#6#7\endcsname}{\xint_c_ii^vii }%
}%
\def\XINT_btd_II_d #1#2#3#4#5#6#7#8#9%
{%
    \xint_gob_til_Z #4\XINT_btd_II_end_a\Z
    \expandafter\XINT_btd_II_e\the\numexpr
    #2+(\xint_c_x^ix+#3*#9#8#7#6#5#4)\relax {#1}{#3}%    
}%
\def\XINT_btd_II_e 1#1#2#3#4#5#6#7#8#9{\XINT_btd_II_f {#1#2#3}{#4#5#6#7#8#9}}%
\def\XINT_btd_II_f #1#2#3{\XINT_btd_II_d {#2#3}{#1}}%
\def\XINT_btd_II_end_a\Z\expandafter\XINT_btd_II_e
    \the\numexpr #1+(#2\relax #3#4\T
{%  
    \XINT_btd_II_end_b #1#3%
}%
\def\XINT_btd_II_end_b #1#2#3#4#5#6#7#8#9%
{%
    \expandafter\space\the\numexpr #1#2#3#4#5#6#7#8#9\relax
}%
\def\XINT_btd_I_a #1#2#3#4#5#6#7#8%
{%
    \xint_gob_til_Z #3\XINT_btd_I_end_a\Z
    \expandafter\XINT_btd_I_b\the\numexpr
    #2+\xint_c_ii^viii*#8#7#6#5#4#3+\xint_c_x^ix\relax {#1}%    
}%
\def\XINT_btd_I_b 1#1#2#3#4#5#6#7#8#9{\XINT_btd_I_c {#1#2#3}{#9#8#7#6#5#4}}%
\def\XINT_btd_I_c #1#2#3{\XINT_btd_I_a {#3#2}{#1}}%
\def\XINT_btd_I_end_a\Z\expandafter\XINT_btd_I_b
    \the\numexpr #1+\xint_c_ii^viii #2\relax
{%  
    \expandafter\XINT_btd_I_end_b\the\numexpr 1000+#1\relax 
}%
\def\XINT_btd_I_end_b 1#1#2#3%
{%
    \xint_gob_til_zeros_iii #1#2#3\XINT_btd_I_end_bz 000%
    \XINT_btd_I_end_c #1#2#3%
}%
\def\XINT_btd_I_end_c #1#2#3#4{\XINT_btd_I {#4#3#2#1000}}%
\def\XINT_btd_I_end_bz 000\XINT_btd_I_end_c 000{\XINT_btd_I }%
%    \end{macrocode}
% \subsection{\csh{xintBinToHex}}
% \lverb!v1.08!
%    \begin{macrocode}
\def\xintBinToHex {\romannumeral0\xintbintohex }%
\def\xintbintohex #1%
{%
    \expandafter\XINT_bth_checkin
                     \romannumeral0\expandafter\XINT_num_loop
                     \romannumeral-`0#1\xint_relax\xint_relax
                                       \xint_relax\xint_relax
                     \xint_relax\xint_relax\xint_relax\xint_relax\Z
    \R\R\R\R\R\R\R\R\Z \W\W\W\W\W\W\W\W
}%
\def\XINT_bth_checkin #1%
{%
    \xint_UDsignfork
       #1\dummy  \XINT_bth_N
        -\dummy {\XINT_bth_P #1}%
     \krof
}%
\def\XINT_bth_N {\expandafter\xint_minus_andstop\romannumeral0\XINT_bth_P }%
\def\XINT_bth_P {\expandafter\XINT_bth_I\expandafter{\expandafter}%
                 \romannumeral0\XINT_OQ {}}%
\def\XINT_bth_I #1#2#3#4#5#6#7#8#9%
{%
    \xint_gob_til_W #9\XINT_bth_end_a\W
    \expandafter\expandafter\expandafter
    \XINT_bth_I
    \expandafter\expandafter\expandafter
    {\csname XINT_sbth_#9#8#7#6\expandafter\expandafter\expandafter\endcsname
     \csname XINT_sbth_#5#4#3#2\endcsname #1}%
}%
\def\XINT_bth_end_a\W \expandafter\expandafter\expandafter
    \XINT_bth_I       \expandafter\expandafter\expandafter #1%
{%
    \XINT_bth_end_b #1%
}%
\def\XINT_bth_end_b  #1\endcsname #2\endcsname #3%
{%
    \xint_gob_til_zero #3\XINT_bth_end_z 0\space #3%
}%
\def\XINT_bth_end_z0\space 0{ }%
%    \end{macrocode}
% \subsection{\csh{xintHexToBin}}
% \lverb!v1.08!
%    \begin{macrocode}
\def\xintHexToBin {\romannumeral0\xinthextobin }%
\def\xinthextobin #1%
{%
    \expandafter\XINT_htb_checkin\romannumeral-`0#1GGGGGGGG\T
}%
\def\XINT_htb_checkin #1%
{%
    \xint_UDsignfork
       #1\dummy  \XINT_htb_N
        -\dummy {\XINT_htb_P #1}%
     \krof
}%
\def\XINT_htb_N {\expandafter\xint_minus_andstop\romannumeral0\XINT_htb_P }%
\def\XINT_htb_P {\XINT_htb_I_a {}}%
\def\XINT_htb_I_a #1#2#3#4#5#6#7#8#9%
{%
    \xint_gob_til_G #9\XINT_htb_II_a G%
    \expandafter\expandafter\expandafter
    \XINT_htb_I_b
    \expandafter\expandafter\expandafter
    {\csname XINT_shtb_#2\expandafter\expandafter\expandafter\endcsname
     \csname XINT_shtb_#3\expandafter\expandafter\expandafter\endcsname
     \csname XINT_shtb_#4\expandafter\expandafter\expandafter\endcsname
     \csname XINT_shtb_#5\expandafter\expandafter\expandafter\endcsname
     \csname XINT_shtb_#6\expandafter\expandafter\expandafter\endcsname
     \csname XINT_shtb_#7\expandafter\expandafter\expandafter\endcsname
     \csname XINT_shtb_#8\expandafter\expandafter\expandafter\endcsname
     \csname XINT_shtb_#9\endcsname }{#1}%
}%
\def\XINT_htb_I_b #1#2{\XINT_htb_I_a {#2#1}}%
\def\XINT_htb_II_a G\expandafter\expandafter\expandafter\XINT_htb_I_b
{%
    \expandafter\expandafter\expandafter \XINT_htb_II_b
}%
\def\XINT_htb_II_b #1#2#3\T
{%
    \XINT_num_loop #2#1%
    \xint_relax\xint_relax\xint_relax\xint_relax
    \xint_relax\xint_relax\xint_relax\xint_relax\Z    
}%
%    \end{macrocode}
% \subsection{\csh{xintCHexToBin}}
% \lverb!v1.08!
%    \begin{macrocode}
\def\xintCHexToBin {\romannumeral0\xintchextobin }%
\def\xintchextobin #1%
{%
    \expandafter\XINT_chtb_checkin\romannumeral-`0#1%
    \R\R\R\R\R\R\R\R\Z \W\W\W\W\W\W\W\W
}%
\def\XINT_chtb_checkin #1%
{%
    \xint_UDsignfork
       #1\dummy  \XINT_chtb_N
        -\dummy {\XINT_chtb_P #1}%
     \krof
}%
\def\XINT_chtb_N {\expandafter\xint_minus_andstop\romannumeral0\XINT_chtb_P }%
\def\XINT_chtb_P {\expandafter\XINT_chtb_I\expandafter{\expandafter}%
                  \romannumeral0\XINT_OQ {}}%
\def\XINT_chtb_I #1#2#3#4#5#6#7#8#9%
{%
    \xint_gob_til_W #9\XINT_chtb_end_a\W
    \expandafter\expandafter\expandafter
    \XINT_chtb_I
    \expandafter\expandafter\expandafter
    {\csname XINT_shtb_#9\expandafter\expandafter\expandafter\endcsname
     \csname XINT_shtb_#8\expandafter\expandafter\expandafter\endcsname
     \csname XINT_shtb_#7\expandafter\expandafter\expandafter\endcsname
     \csname XINT_shtb_#6\expandafter\expandafter\expandafter\endcsname
     \csname XINT_shtb_#5\expandafter\expandafter\expandafter\endcsname
     \csname XINT_shtb_#4\expandafter\expandafter\expandafter\endcsname
     \csname XINT_shtb_#3\expandafter\expandafter\expandafter\endcsname
     \csname XINT_shtb_#2\endcsname
     #1}%
}%
\def\XINT_chtb_end_a\W\expandafter\expandafter\expandafter
    \XINT_chtb_I\expandafter\expandafter\expandafter #1%
{%
    \XINT_chtb_end_b #1%
    \xint_relax\xint_relax\xint_relax\xint_relax
    \xint_relax\xint_relax\xint_relax\xint_relax\Z    
}%
\def\XINT_chtb_end_b #1\W#2\W#3\W#4\W#5\W#6\W#7\W#8\W\endcsname 
{%
    \XINT_num_loop
}%
\XINT_restorecatcodes_endinput%
%    \end{macrocode}
%\catcode`\<=0 \catcode`\>=11 \catcode`\*=11 \catcode`\/=11
%\let</xintbinhex>\relax
%\def<*xintgcd>{\catcode`\<=12 \catcode`\>=12 \catcode`\*=12 \catcode`\/=12 }
%</xintbinhex>
%<*xintgcd>
%
% \StoreCodelineNo {xintbinhex}
%
% \section{Package \xintgcdname implementation}
% 
% The commenting is currently (\docdate) very sparse.
%
% \localtableofcontents
% \subsection{Catcodes, \protect\eTeX{} and reload detection}
%
% The code for reload detection is copied from \textsc{Heiko
% Oberdiek}'s packages, and adapted here to check for previous
% loading of the master \xintname package.
%
% The method for catcodes is slightly different, but still
% directly inspired by these packages.
%
%    \begin{macrocode}
\begingroup\catcode61\catcode48\catcode32=10\relax%
  \catcode13=5    % ^^M
  \endlinechar=13 %
  \catcode123=1   % {
  \catcode125=2   % }
  \catcode64=11   % @
  \catcode35=6    % #
  \catcode44=12   % ,
  \catcode45=12   % -
  \catcode46=12   % .
  \catcode58=12   % :
  \def\space { }%
  \let\z\endgroup
  \expandafter\let\expandafter\x\csname ver@xintgcd.sty\endcsname
  \expandafter\let\expandafter\w\csname ver@xint.sty\endcsname
  \expandafter
    \ifx\csname PackageInfo\endcsname\relax
      \def\y#1#2{\immediate\write-1{Package #1 Info: #2.}}%
    \else
      \def\y#1#2{\PackageInfo{#1}{#2}}%
    \fi
  \expandafter
  \ifx\csname numexpr\endcsname\relax
     \y{xintgcd}{\numexpr not available, aborting input}%
     \aftergroup\endinput
  \else
    \ifx\x\relax   % plain-TeX, first loading of xintgcd.sty
      \ifx\w\relax % but xint.sty not yet loaded.
         \y{xintgcd}{Package xint is required}%
         \y{xintgcd}{Will try \string\input\space xint.sty}%
         \def\z{\endgroup\input xint.sty\relax}%
      \fi
    \else
      \def\empty {}%
      \ifx\x\empty % LaTeX, first loading,
      % variable is initialized, but \ProvidesPackage not yet seen
          \ifx\w\relax % xint.sty not yet loaded.
            \y{xintgcd}{Package xint is required}%
            \y{xintgcd}{Will try \string\RequirePackage{xint}}%
            \def\z{\endgroup\RequirePackage{xint}}%
          \fi
      \else
        \y{xintgcd}{I was already loaded, aborting input}%
        \aftergroup\endinput
      \fi
    \fi
  \fi
\z%
%    \end{macrocode}
% \subsection{Confirmation of \xintname loading}
%    \begin{macrocode}
\begingroup\catcode61\catcode48\catcode32=10\relax%
  \catcode13=5    % ^^M
  \endlinechar=13 %
  \catcode123=1   % {
  \catcode125=2   % }
  \catcode64=11   % @
  \catcode35=6    % #
  \catcode44=12   % ,
  \catcode45=12   % -
  \catcode46=12   % .
  \catcode58=12   % :
  \expandafter
    \ifx\csname PackageInfo\endcsname\relax
      \def\y#1#2{\immediate\write-1{Package #1 Info: #2.}}%
    \else
      \def\y#1#2{\PackageInfo{#1}{#2}}%
    \fi
  \def\empty {}%
  \expandafter\let\expandafter\w\csname ver@xint.sty\endcsname
  \ifx\w\relax % Plain TeX, user gave a file name at the prompt
      \y{xintgcd}{Loading of package xint failed, aborting input}%
      \aftergroup\endinput
  \fi
  \ifx\w\empty % LaTeX, user gave a file name at the prompt
      \y{xintgcd}{Loading of package xint failed, aborting input}%
      \aftergroup\endinput
  \fi
\endgroup%
%    \end{macrocode}
% \subsection{Catcodes}
%    \begin{macrocode}
\XINTsetupcatcodes%
%    \end{macrocode}
% \subsection{Package identification}
%    \begin{macrocode}
\XINT_providespackage
\ProvidesPackage{xintgcd}%
  [2013/10/03 v1.09b Euclide algorithm with xint package (jfB)]%
%    \end{macrocode}
% \subsection{\csh{xintGCD}}
% The macros of |1.09a| benefits from the |\xintnum| which has been inserted
% inside |\xintiabs| in \xintname;
% this is a little overhead but is more convenient for the
% user and also makes it easier to use into |\xintexpr|essions.
%    \begin{macrocode}
\def\xintGCD {\romannumeral0\xintgcd }%
\def\xintgcd #1%
{%
    \expandafter\XINT_gcd\expandafter{\romannumeral0\xintiabs {#1}}%
}%
\def\XINT_gcd #1#2%
{%
    \expandafter\XINT_gcd_fork\romannumeral0\xintiabs {#2}\Z #1\Z
}%
%    \end{macrocode}
% \lverb|&
% Ici #3#4=A, #1#2=B|
%    \begin{macrocode}
\def\XINT_gcd_fork #1#2\Z #3#4\Z
{%
    \xint_UDzerofork
      #1\dummy \XINT_gcd_BisZero
      #3\dummy \XINT_gcd_AisZero
       0\dummy \XINT_gcd_loop
    \krof
    {#1#2}{#3#4}%
}%
\def\XINT_gcd_AisZero #1#2{ #1}%
\def\XINT_gcd_BisZero #1#2{ #2}%
\def\XINT_gcd_CheckRem #1#2\Z
{%
    \xint_gob_til_zero #1\xint_gcd_end0\XINT_gcd_loop {#1#2}%
}%
\def\xint_gcd_end0\XINT_gcd_loop #1#2{ #2}%
%    \end{macrocode}
% \lverb|#1=B, #2=A|
%    \begin{macrocode}
\def\XINT_gcd_loop #1#2%
{%
    \expandafter\expandafter\expandafter
        \XINT_gcd_CheckRem
    \expandafter\xint_secondoftwo
    \romannumeral0\XINT_div_prepare {#1}{#2}\Z 
    {#1}%
}%
%    \end{macrocode}
% \subsection{\csh{xintGCDof}}
% \lverb|New with 1.09a. I also tried an optimization (not working two by two)
% which I thought was clever but
% it seemed to be less efficient ...|
%    \begin{macrocode}
\def\xintGCDof      {\romannumeral0\xintgcdof }%
\def\xintgcdof    #1{\expandafter\XINT_gcdof_a\romannumeral-`0#1\relax }%
\def\XINT_gcdof_a #1{\expandafter\XINT_gcdof_b\romannumeral-`0#1\Z }%
\def\XINT_gcdof_b #1\Z #2{\expandafter\XINT_gcdof_c\romannumeral-`0#2\Z {#1}\Z}%
\def\XINT_gcdof_c #1{\xint_gob_til_relax #1\XINT_gcdof_e\relax\XINT_gcdof_d #1}%
\def\XINT_gcdof_d #1\Z {\expandafter\XINT_gcdof_b\romannumeral0\xintgcd {#1}}%
\def\XINT_gcdof_e #1\Z #2\Z { #2}%
%    \end{macrocode}
% \subsection{\csh{xintGCDof:csv}}
% \lverb|1.09a. For use by \xintexpr.|
%    \begin{macrocode}
\def\xintGCDof:csv #1{\expandafter\XINT_gcdof:_b\romannumeral-`0#1,,}%
\def\XINT_gcdof:_b #1,#2,{\expandafter\XINT_gcdof:_c\romannumeral-`0#2,{#1},}%
\def\XINT_gcdof:_c #1{\if #1,\expandafter\XINT_gcdof:_e
                       \else\expandafter\XINT_gcdof:_d\fi #1}%
\def\XINT_gcdof:_d #1,{\expandafter\XINT_gcdof:_b\romannumeral0\xintgcd {#1}}%
\def\XINT_gcdof:_e ,#1,{#1}%
%    \end{macrocode}
% \subsection{\csh{xintLCM}}
% \lverb|New with 1.09a|
%    \begin{macrocode}
\def\xintLCM {\romannumeral0\xintlcm}%
\def\xintlcm #1%
{%
    \expandafter\XINT_lcm\expandafter{\romannumeral0\xintiabs {#1}}%
}%
\def\XINT_lcm #1#2%
{%
    \expandafter\XINT_lcm_fork\romannumeral0\xintiabs {#2}\Z #1\Z
}%
\def\XINT_lcm_fork #1#2\Z #3#4\Z
{%
    \xint_UDzerofork
      #1\dummy \XINT_lcm_BisZero
      #3\dummy \XINT_lcm_AisZero
       0\dummy \expandafter
    \krof
    \XINT_lcm_notzero\expandafter{\romannumeral0\XINT_gcd_loop {#1#2}{#3#4}}%
    {#1#2}{#3#4}%
}%
\def\XINT_lcm_AisZero #1#2#3#4#5{ 0}%
\def\XINT_lcm_BisZero #1#2#3#4#5{ 0}%
\def\XINT_lcm_notzero #1#2#3{\xintiimul {#2}{\xintQuo{#3}{#1}}}%
%    \end{macrocode}
% \subsection{\csh{xintLCMof}}
% \lverb|New with 1.09a|
%    \begin{macrocode}
\def\xintLCMof      {\romannumeral0\xintlcmof }%
\def\xintlcmof    #1{\expandafter\XINT_lcmof_a\romannumeral-`0#1\relax }%
\def\XINT_lcmof_a #1{\expandafter\XINT_lcmof_b\romannumeral-`0#1\Z }%
\def\XINT_lcmof_b #1\Z #2{\expandafter\XINT_lcmof_c\romannumeral-`0#2\Z {#1}\Z}%
\def\XINT_lcmof_c #1{\xint_gob_til_relax #1\XINT_lcmof_e\relax\XINT_lcmof_d #1}%
\def\XINT_lcmof_d #1\Z {\expandafter\XINT_lcmof_b\romannumeral0\xintlcm {#1}}%
\def\XINT_lcmof_e #1\Z #2\Z { #2}%
%    \end{macrocode}
% \subsection{\csh{xintLCMof:csv}}
% \lverb|1.09a. For use by \xintexpr.|
%    \begin{macrocode}
\def\xintLCMof:csv #1{\expandafter\XINT_lcmof:_a\romannumeral-`0#1,,}%
\def\XINT_lcmof:_a #1,#2,{\expandafter\XINT_lcmof:_c\romannumeral-`0#2,{#1},}%
\def\XINT_lcmof:_c #1{\if#1,\expandafter\XINT_lcmof:_e
                       \else\expandafter\XINT_lcmof:_d\fi #1}%
\def\XINT_lcmof:_d #1,{\expandafter\XINT_lcmof:_a\romannumeral0\xintlcm {#1}}%
\def\XINT_lcmof:_e ,#1,{#1}%
%    \end{macrocode}
% \subsection{\csh{xintBezout}}
% \lverb|1.09a inserts use of \xintnum|
%    \begin{macrocode}
\def\xintBezout {\romannumeral0\xintbezout }%
\def\xintbezout #1%
{%
    \expandafter\xint_bezout\expandafter {\romannumeral0\xintnum{#1}}%
}%
\def\xint_bezout #1#2%
{%
    \expandafter\XINT_bezout_fork \romannumeral0\xintnum{#2}\Z #1\Z
}%
%    \end{macrocode}
% \lverb|#3#4 = A, #1#2=B|
%    \begin{macrocode}
\def\XINT_bezout_fork #1#2\Z #3#4\Z
{%
    \xint_UDzerosfork
     #1#3\dummy \XINT_bezout_botharezero
      #10\dummy \XINT_bezout_secondiszero
      #30\dummy \XINT_bezout_firstiszero
       00\dummy 
        {\xint_UDsignsfork
          #1#3\dummy \XINT_bezout_minusminus % A < 0, B < 0
           #1-\dummy \XINT_bezout_minusplus  % A > 0, B < 0
           #3-\dummy \XINT_bezout_plusminus  % A < 0, B > 0
            --\dummy \XINT_bezout_plusplus   % A > 0, B > 0
         \krof }%
    \krof
    {#2}{#4}#1#3{#3#4}{#1#2}% #1#2=B, #3#4=A
}%
\def\XINT_bezout_botharezero #1#2#3#4#5#6%
{%
    \xintError:NoBezoutForZeros
    \space {0}{0}{0}{0}{0}%
}%
%    \end{macrocode}
% \lverb|&
% attention première entrée doit être ici (-1)^n donc 1$\
% #4#2 = 0 = A, B = #3#1|
%    \begin{macrocode}
\def\XINT_bezout_firstiszero #1#2#3#4#5#6%
{%
    \xint_UDsignfork
      #3\dummy { {0}{#3#1}{0}{1}{#1}}%
       -\dummy { {0}{#3#1}{0}{-1}{#1}}%
    \krof
}%
%    \end{macrocode}
% \lverb|#4#2 = A, B = #3#1 = 0|
%    \begin{macrocode}
\def\XINT_bezout_secondiszero #1#2#3#4#5#6%
{%
    \xint_UDsignfork
       #4\dummy{ {#4#2}{0}{-1}{0}{#2}}%
        -\dummy{ {#4#2}{0}{1}{0}{#2}}%
    \krof
}%
%    \end{macrocode}
% \lverb|#4#2= A < 0, #3#1 = B < 0|
%    \begin{macrocode}
\def\XINT_bezout_minusminus #1#2#3#4%
{%
    \expandafter\XINT_bezout_mm_post
    \romannumeral0\XINT_bezout_loop_a 1{#1}{#2}1001%
}%
\def\XINT_bezout_mm_post #1#2%
{%
    \expandafter\XINT_bezout_mm_postb\expandafter
    {\romannumeral0\xintiiopp{#2}}{\romannumeral0\xintiiopp{#1}}%
}%
\def\XINT_bezout_mm_postb #1#2%
{%
    \expandafter\XINT_bezout_mm_postc\expandafter {#2}{#1}%
}%
\def\XINT_bezout_mm_postc #1#2#3#4#5%
{%
    \space {#4}{#5}{#1}{#2}{#3}%
}%
%    \end{macrocode}
% \lverb|minusplus  #4#2= A > 0, B < 0|
%    \begin{macrocode}
\def\XINT_bezout_minusplus #1#2#3#4%
{%
    \expandafter\XINT_bezout_mp_post
    \romannumeral0\XINT_bezout_loop_a 1{#1}{#4#2}1001%
}%
\def\XINT_bezout_mp_post #1#2%
{%
    \expandafter\XINT_bezout_mp_postb\expandafter
      {\romannumeral0\xintiiopp {#2}}{#1}%
}%
\def\XINT_bezout_mp_postb #1#2#3#4#5%
{%
    \space {#4}{#5}{#2}{#1}{#3}%
}%
%    \end{macrocode}
% \lverb|plusminus  A < 0, B > 0|
%    \begin{macrocode}
\def\XINT_bezout_plusminus #1#2#3#4%
{%
    \expandafter\XINT_bezout_pm_post
    \romannumeral0\XINT_bezout_loop_a 1{#3#1}{#2}1001%
}%
\def\XINT_bezout_pm_post #1%
{%
    \expandafter \XINT_bezout_pm_postb \expandafter
        {\romannumeral0\xintiopp{#1}}%
}%
\def\XINT_bezout_pm_postb #1#2#3#4#5%
{%
    \space {#4}{#5}{#1}{#2}{#3}%
}%
%    \end{macrocode}
% \lverb|plusplus|
%    \begin{macrocode}
\def\XINT_bezout_plusplus #1#2#3#4%
{%
    \expandafter\XINT_bezout_pp_post
    \romannumeral0\XINT_bezout_loop_a 1{#3#1}{#4#2}1001%
}%
%    \end{macrocode}
% \lverb|la parité (-1)^N est en #1, et on la jette ici.|
%    \begin{macrocode}
\def\XINT_bezout_pp_post #1#2#3#4#5%
{%
    \space {#4}{#5}{#1}{#2}{#3}%
}%
%    \end{macrocode}
% \lverb|&
% n = 0: 1BAalpha(0)beta(0)alpha(-1)beta(-1)$\
% n général:
% {(-1)^n}{r(n-1)}{r(n-2)}{alpha(n-1)}{beta(n-1)}{alpha(n-2)}{beta(n-2)}$\
% #2 = B, #3 = A|
%    \begin{macrocode}
\def\XINT_bezout_loop_a #1#2#3%
{%
    \expandafter\XINT_bezout_loop_b
    \expandafter{\the\numexpr -#1\expandafter }%
    \romannumeral0\XINT_div_prepare {#2}{#3}{#2}%
}%
%    \end{macrocode}
% \lverb|&
% Le q(n) a ici une existence éphémère, dans le version Bezout Algorithm
% il faudra le conserver. On voudra à la fin
% {{q(n)}{r(n)}{alpha(n)}{beta(n)}}.
% De plus ce n'est plus (-1)^n que l'on veut mais n. (ou dans un autre ordre)$\
% {-(-1)^n}{q(n)}{r(n)}{r(n-1)}{alpha(n-1)}{beta(n-1)}{alpha(n-2)}{beta(n-2)}|
%    \begin{macrocode}
\def\XINT_bezout_loop_b #1#2#3#4#5#6#7#8%
{%
    \expandafter \XINT_bezout_loop_c \expandafter
        {\romannumeral0\xintiiadd{\XINT_Mul{#5}{#2}}{#7}}%
        {\romannumeral0\xintiiadd{\XINT_Mul{#6}{#2}}{#8}}%
    {#1}{#3}{#4}{#5}{#6}%
}%
%    \end{macrocode}
% \lverb|{alpha(n)}{->beta(n)}{-(-1)^n}{r(n)}{r(n-1)}{alpha(n-1)}{beta(n-1)}|
%    \begin{macrocode}
\def\XINT_bezout_loop_c #1#2%
{%
    \expandafter \XINT_bezout_loop_d \expandafter
        {#2}{#1}%
}%
%    \end{macrocode}
% \lverb|{beta(n)}{alpha(n)}{(-1)^(n+1)}{r(n)}{r(n-1)}{alpha(n-1)}{beta(n-1)}|
%    \begin{macrocode}
\def\XINT_bezout_loop_d #1#2#3#4#5%
{%
    \XINT_bezout_loop_e #4\Z {#3}{#5}{#2}{#1}%
}%
%    \end{macrocode}
% \lverb|r(n)\Z {(-1)^(n+1)}{r(n-1)}{alpha(n)}{beta(n)}{alpha(n-1)}{beta(n-1)}|
%    \begin{macrocode}
\def\XINT_bezout_loop_e #1#2\Z 
{%
    \xint_gob_til_zero #1\xint_bezout_loop_exit0\XINT_bezout_loop_f
    {#1#2}%
}%
%    \end{macrocode}
% \lverb|{r(n)}{(-1)^(n+1)}{r(n-1)}{alpha(n)}{beta(n)}{alpha(n-1)}{beta(n-1)}|
%    \begin{macrocode}
\def\XINT_bezout_loop_f #1#2%
{%
    \XINT_bezout_loop_a {#2}{#1}%
}%
%    \end{macrocode}
% \lverb|{(-1)^(n+1)}{r(n)}{r(n-1)}{alpha(n)}{beta(n)}{alpha(n-1)}{beta(n-1)}
% et itération|
%    \begin{macrocode}
\def\xint_bezout_loop_exit0\XINT_bezout_loop_f #1#2%
{%
    \ifcase #2
    \or  \expandafter\XINT_bezout_exiteven
    \else\expandafter\XINT_bezout_exitodd
    \fi
}%
\def\XINT_bezout_exiteven #1#2#3#4#5%
{%
    \space {#5}{#4}{#1}%
}%
\def\XINT_bezout_exitodd #1#2#3#4#5%
{%
    \space {-#5}{-#4}{#1}%
}%
%    \end{macrocode}
% \subsection{\csh{xintEuclideAlgorithm}}
% \lverb|&
% Pour Euclide: 
% {N}{A}{D=r(n)}{B}{q1}{r1}{q2}{r2}{q3}{r3}....{qN}{rN=0}$\
% u<2n> = u<2n+3>u<2n+2> + u<2n+4> à la n ième étape|
%    \begin{macrocode}
\def\xintEuclideAlgorithm {\romannumeral0\xinteuclidealgorithm }%
\def\xinteuclidealgorithm #1%
{%
    \expandafter \XINT_euc \expandafter{\romannumeral0\xintiabs {#1}}%
}%
\def\XINT_euc #1#2%
{%
    \expandafter\XINT_euc_fork \romannumeral0\xintiabs {#2}\Z #1\Z
}%
%    \end{macrocode}
% \lverb|Ici #3#4=A, #1#2=B|
%    \begin{macrocode}
\def\XINT_euc_fork #1#2\Z #3#4\Z
{%
    \xint_UDzerofork
      #1\dummy \XINT_euc_BisZero
      #3\dummy \XINT_euc_AisZero
       0\dummy \XINT_euc_a
    \krof
    {0}{#1#2}{#3#4}{{#3#4}{#1#2}}{}\Z
}%
%    \end{macrocode}
% \lverb|&
% Le {} pour protéger {{A}{B}} si on s'arrête après une étape (B divise
% A).
% On va renvoyer:$\
% {N}{A}{D=r(n)}{B}{q1}{r1}{q2}{r2}{q3}{r3}....{qN}{rN=0}|
%    \begin{macrocode}
\def\XINT_euc_AisZero #1#2#3#4#5#6{ {1}{0}{#2}{#2}{0}{0}}%
\def\XINT_euc_BisZero #1#2#3#4#5#6{ {1}{0}{#3}{#3}{0}{0}}%
%    \end{macrocode}
% \lverb|&
% {n}{rn}{an}{{qn}{rn}}...{{A}{B}}{}\Z$\
%  a(n) = r(n-1). Pour n=0 on a juste {0}{B}{A}{{A}{B}}{}\Z$\
% \XINT_div_prepare {u}{v} divise v par u|
%    \begin{macrocode}
\def\XINT_euc_a #1#2#3%
{%
    \expandafter\XINT_euc_b
    \expandafter {\the\numexpr #1+1\expandafter }%
    \romannumeral0\XINT_div_prepare {#2}{#3}{#2}%
}%
%    \end{macrocode}
% \lverb|{n+1}{q(n+1)}{r(n+1)}{rn}{{qn}{rn}}...|
%    \begin{macrocode}
\def\XINT_euc_b #1#2#3#4%
{%
    \XINT_euc_c #3\Z {#1}{#3}{#4}{{#2}{#3}}%
}%
%    \end{macrocode}
% \lverb|r(n+1)\Z {n+1}{r(n+1)}{r(n)}{{q(n+1)}{r(n+1)}}{{qn}{rn}}...$\
% Test si r(n+1) est nul.|
%    \begin{macrocode}
\def\XINT_euc_c #1#2\Z 
{%
    \xint_gob_til_zero #1\xint_euc_end0\XINT_euc_a
}%
%    \end{macrocode}
% \lverb|&
% {n+1}{r(n+1)}{r(n)}{{q(n+1)}{r(n+1)}}...{}\Z
% Ici r(n+1) = 0. On arrête on se prépare à inverser
% {n+1}{0}{r(n)}{{q(n+1)}{r(n+1)}}.....{{q1}{r1}}{{A}{B}}{}\Z$\
% On veut renvoyer: {N=n+1}{A}{D=r(n)}{B}{q1}{r1}{q2}{r2}{q3}{r3}....{qN}{rN=0}|
%    \begin{macrocode}
\def\xint_euc_end0\XINT_euc_a #1#2#3#4\Z%
{%
    \expandafter\xint_euc_end_
    \romannumeral0%
    \XINT_rord_main {}#4{{#1}{#3}}%
    \xint_relax
      \xint_undef\xint_undef\xint_undef\xint_undef
      \xint_undef\xint_undef\xint_undef\xint_undef
    \xint_relax
}%
\def\xint_euc_end_ #1#2#3%
{%
    \space {#1}{#3}{#2}%
}%
%    \end{macrocode}
% \subsection{\csh{xintBezoutAlgorithm}}
% \lverb|&
% Pour Bezout: objectif, renvoyer$\
% {N}{A}{0}{1}{D=r(n)}{B}{1}{0}{q1}{r1}{alpha1=q1}{beta1=1}$\
%       {q2}{r2}{alpha2}{beta2}....{qN}{rN=0}{alphaN=A/D}{betaN=B/D}$\
% alpha0=1, beta0=0, alpha(-1)=0, beta(-1)=1|
%    \begin{macrocode}
\def\xintBezoutAlgorithm {\romannumeral0\xintbezoutalgorithm }%
\def\xintbezoutalgorithm #1%
{%
    \expandafter \XINT_bezalg \expandafter{\romannumeral0\xintiabs {#1}}%
}%
\def\XINT_bezalg #1#2%
{%
    \expandafter\XINT_bezalg_fork \romannumeral0\xintiabs {#2}\Z #1\Z
}%
%    \end{macrocode}
% \lverb|Ici #3#4=A, #1#2=B|
%    \begin{macrocode}
\def\XINT_bezalg_fork #1#2\Z #3#4\Z
{%
    \xint_UDzerofork
      #1\dummy \XINT_bezalg_BisZero
      #3\dummy \XINT_bezalg_AisZero
       0\dummy \XINT_bezalg_a
    \krof
    0{#1#2}{#3#4}1001{{#3#4}{#1#2}}{}\Z
}%
\def\XINT_bezalg_AisZero #1#2#3\Z{ {1}{0}{0}{1}{#2}{#2}{1}{0}{0}{0}{0}{1}}%
\def\XINT_bezalg_BisZero #1#2#3#4\Z{ {1}{0}{0}{1}{#3}{#3}{1}{0}{0}{0}{0}{1}}%
%    \end{macrocode}
% \lverb|&
% pour préparer l'étape n+1 il faut
% {n}{r(n)}{r(n-1)}{alpha(n)}{beta(n)}{alpha(n-1)}{beta(n-1)}&
%                    {{q(n)}{r(n)}{alpha(n)}{beta(n)}}...
% division de #3 par #2|
%    \begin{macrocode}
\def\XINT_bezalg_a #1#2#3%
{%
    \expandafter\XINT_bezalg_b
    \expandafter {\the\numexpr #1+1\expandafter }%
    \romannumeral0\XINT_div_prepare {#2}{#3}{#2}%
}%
%    \end{macrocode}
% \lverb|&
% {n+1}{q(n+1)}{r(n+1)}{r(n)}{alpha(n)}{beta(n)}{alpha(n-1)}{beta(n-1)}...|
%    \begin{macrocode}
\def\XINT_bezalg_b #1#2#3#4#5#6#7#8%
{%
    \expandafter\XINT_bezalg_c\expandafter
     {\romannumeral0\xintiiadd {\xintiiMul {#6}{#2}}{#8}}%
     {\romannumeral0\xintiiadd {\xintiiMul {#5}{#2}}{#7}}%
     {#1}{#2}{#3}{#4}{#5}{#6}%
}%
%    \end{macrocode}
% \lverb|&
% {beta(n+1)}{alpha(n+1)}{n+1}{q(n+1)}{r(n+1)}{r(n)}{alpha(n)}{beta(n}}|
%    \begin{macrocode}
\def\XINT_bezalg_c #1#2#3#4#5#6%
{%
    \expandafter\XINT_bezalg_d\expandafter {#2}{#3}{#4}{#5}{#6}{#1}%
}%
%    \end{macrocode}
% \lverb|{alpha(n+1)}{n+1}{q(n+1)}{r(n+1)}{r(n)}{beta(n+1)}|
%    \begin{macrocode}
\def\XINT_bezalg_d #1#2#3#4#5#6#7#8%
{%
    \XINT_bezalg_e #4\Z {#2}{#4}{#5}{#1}{#6}{#7}{#8}{{#3}{#4}{#1}{#6}}%
}%
%    \end{macrocode}
% \lverb|r(n+1)\Z {n+1}{r(n+1)}{r(n)}{alpha(n+1)}{beta(n+1)}$\
%                              {alpha(n)}{beta(n)}{q,r,alpha,beta(n+1)}$\
% Test si r(n+1) est nul.|
%    \begin{macrocode}
\def\XINT_bezalg_e #1#2\Z
{%
    \xint_gob_til_zero #1\xint_bezalg_end0\XINT_bezalg_a
}%
%    \end{macrocode}
% \lverb|&
% Ici r(n+1) = 0. On arrête on se prépare à inverser.$\
% {n+1}{r(n+1)}{r(n)}{alpha(n+1)}{beta(n+1)}{alpha(n)}{beta(n)}$\
%                     {q,r,alpha,beta(n+1)}...{{A}{B}}{}\Z$\
% On veut renvoyer$\
% {N}{A}{0}{1}{D=r(n)}{B}{1}{0}{q1}{r1}{alpha1=q1}{beta1=1}$\
%       {q2}{r2}{alpha2}{beta2}....{qN}{rN=0}{alphaN=A/D}{betaN=B/D}|
%    \begin{macrocode}
\def\xint_bezalg_end0\XINT_bezalg_a #1#2#3#4#5#6#7#8\Z 
{%
    \expandafter\xint_bezalg_end_
    \romannumeral0%
    \XINT_rord_main {}#8{{#1}{#3}}%
    \xint_relax
      \xint_undef\xint_undef\xint_undef\xint_undef
      \xint_undef\xint_undef\xint_undef\xint_undef
    \xint_relax
}%
%    \end{macrocode}
% \lverb|&
% {N}{D}{A}{B}{q1}{r1}{alpha1=q1}{beta1=1}{q2}{r2}{alpha2}{beta2}$\
%      ....{qN}{rN=0}{alphaN=A/D}{betaN=B/D}$\
% On veut renvoyer$\
% {N}{A}{0}{1}{D=r(n)}{B}{1}{0}{q1}{r1}{alpha1=q1}{beta1=1}$\
%        {q2}{r2}{alpha2}{beta2}....{qN}{rN=0}{alphaN=A/D}{betaN=B/D}|
%    \begin{macrocode}
\def\xint_bezalg_end_ #1#2#3#4%
{%
    \space {#1}{#3}{0}{1}{#2}{#4}{1}{0}%
}%
%    \end{macrocode}
% \subsection{\csh{xintTypesetEuclideAlgorithm}}
% \lverb|&
% TYPESETTING
%
% Organisation: 
%
% {N}{A}{D}{B}{q1}{r1}{q2}{r2}{q3}{r3}....{qN}{rN=0}$\
% \U1 = N = nombre d'étapes, \U3 = PGCD, \U2 = A, \U4=B
% q1 = \U5, q2 = \U7 --> qn = \U<2n+3>, rn = \U<2n+4>
% bn = rn. B = r0. A=r(-1)
%
% r(n-2) = q(n)r(n-1)+r(n) (n e étape) 
%
% \U{2n} = \U{2n+3} \times \U{2n+2} + \U{2n+4}, n e étape.
% (avec n entre 1 et N)|
%    \begin{macrocode}
\def\xintTypesetEuclideAlgorithm #1#2%
{% l'algo remplace #1 et #2 par |#1| et |#2|
  \par
  \begingroup
    \xintAssignArray\xintEuclideAlgorithm {#1}{#2}\to\U
    \edef\A{\U2}\edef\B{\U4}\edef\N{\U1}%
    \setbox 0 \vbox{\halign {$##$\cr \A\cr \B \cr}}%
    \noindent
    \count 255 1
    \loop
      \hbox to \wd 0 {\hfil$\U{\numexpr 2*\count 255\relax}$}%
      ${} =  \U{\numexpr 2*\count 255 + 3\relax}
      \times \U{\numexpr 2*\count 255 + 2\relax}
          +  \U{\numexpr 2*\count 255 + 4\relax}$%
    \ifnum \count 255 < \N
      \hfill\break
      \advance \count 255 1
    \repeat
  \par
  \endgroup
}%
%    \end{macrocode}
% \subsection{\csh{xintTypesetBezoutAlgorithm}}
% \lverb|&
% Pour Bezout on a: 
% {N}{A}{0}{1}{D=r(n)}{B}{1}{0}{q1}{r1}{alpha1=q1}{beta1=1}$\
%             {q2}{r2}{alpha2}{beta2}....{qN}{rN=0}{alphaN=A/D}{betaN=B/D}%
% Donc 4N+8 termes:
% U1 = N, U2= A, U5=D, U6=B, q1 = U9, qn = U{4n+5}, n au moins 1$\
% rn = U{4n+6}, n au moins -1$\
% alpha(n) = U{4n+7}, n au moins -1$\
% beta(n)  = U{4n+8}, n au moins -1|
%    \begin{macrocode}
\def\xintTypesetBezoutAlgorithm #1#2%
{%
  \par
  \begingroup
    \parindent0pt
    \xintAssignArray\xintBezoutAlgorithm {#1}{#2}\to\BEZ
    \edef\A{\BEZ2}\edef\B{\BEZ6}\edef\N{\BEZ1}% A = |#1|, B = |#2|
    \setbox 0 \vbox{\halign {$##$\cr \A\cr \B \cr}}%
    \count 255 1
    \loop
      \noindent
      \hbox to \wd 0 {\hfil$\BEZ{4*\count 255 - 2}$}%
      ${} =  \BEZ{4*\count 255 + 5}
      \times \BEZ{4*\count 255 + 2}
          +  \BEZ{4*\count 255 + 6}$\hfill\break
      \hbox to \wd 0 {\hfil$\BEZ{4*\count 255 +7}$}%
      ${} = \BEZ{4*\count 255 + 5}
      \times \BEZ{4*\count 255 + 3}
          +  \BEZ{4*\count 255 - 1}$\hfill\break
      \hbox to \wd 0 {\hfil$\BEZ{4*\count 255 +8}$}% 
      ${} =  \BEZ{4*\count 255 + 5}
      \times \BEZ{4*\count 255 + 4}
          +  \BEZ{4*\count 255 }$
      \endgraf
    \ifnum \count 255 < \N
    \advance \count 255 1
  \repeat
  \par
    \edef\U{\BEZ{4*\N + 4}}%
    \edef\V{\BEZ{4*\N + 3}}%
    \edef\D{\BEZ5}%
    \ifodd\N
       $\U\times\A  - \V\times \B = -\D$%
    \else
       $\U\times\A - \V\times\B = \D$%
    \fi
  \par
  \endgroup
}%
\XINT_restorecatcodes_endinput%
%    \end{macrocode}
%\catcode`\<=0 \catcode`\>=11 \catcode`\*=11 \catcode`\/=11
%\let</xintgcd>\relax
%\def<*xintfrac>{\catcode`\<=12 \catcode`\>=12 \catcode`\*=12 \catcode`\/=12 }
%</xintgcd>
%<*xintfrac>
%
% \StoreCodelineNo {xintgcd}
%
% \section{Package \xintfracname implementation}
% 
% The commenting is currently (\docdate) very sparse.
%
% \localtableofcontents
% \subsection{Catcodes, \protect\eTeX{} and reload detection}
%
% The code for reload detection is copied from \textsc{Heiko
% Oberdiek}'s packages, and adapted here to check for previous
% loading of the master \xintname package.
%
% The method for catcodes is slightly different, but still
% directly inspired by these packages.
%
%    \begin{macrocode}
\begingroup\catcode61\catcode48\catcode32=10\relax%
  \catcode13=5    % ^^M
  \endlinechar=13 %
  \catcode123=1   % {
  \catcode125=2   % }
  \catcode64=11   % @
  \catcode35=6    % #
  \catcode44=12   % ,
  \catcode45=12   % -
  \catcode46=12   % .
  \catcode58=12   % :
  \def\space { }%
  \let\z\endgroup
  \expandafter\let\expandafter\x\csname ver@xintfrac.sty\endcsname
  \expandafter\let\expandafter\w\csname ver@xint.sty\endcsname
  \expandafter
    \ifx\csname PackageInfo\endcsname\relax
      \def\y#1#2{\immediate\write-1{Package #1 Info: #2.}}%
    \else
      \def\y#1#2{\PackageInfo{#1}{#2}}%
    \fi
  \expandafter
  \ifx\csname numexpr\endcsname\relax
     \y{xintfrac}{\numexpr not available, aborting input}%
     \aftergroup\endinput
  \else
    \ifx\x\relax   % plain-TeX, first loading of xintfrac.sty
      \ifx\w\relax % but xint.sty not yet loaded.
         \y{xintfrac}{Package xint is required}%
         \y{xintfrac}{Will try \string\input\space xint.sty}%
         \def\z{\endgroup\input xint.sty\relax}%
      \fi
    \else
      \def\empty {}%
      \ifx\x\empty % LaTeX, first loading,
      % variable is initialized, but \ProvidesPackage not yet seen
          \ifx\w\relax % xint.sty not yet loaded.
            \y{xintfrac}{Package xint is required}%
            \y{xintfrac}{Will try \string\RequirePackage{xint}}%
            \def\z{\endgroup\RequirePackage{xint}}%
          \fi
      \else
        \y{xintfrac}{I was already loaded, aborting input}%
        \aftergroup\endinput
      \fi
    \fi
  \fi
\z%
%    \end{macrocode}
% \subsection{Confirmation of \xintname loading}
%    \begin{macrocode}
\begingroup\catcode61\catcode48\catcode32=10\relax%
  \catcode13=5    % ^^M
  \endlinechar=13 %
  \catcode123=1   % {
  \catcode125=2   % }
  \catcode64=11   % @
  \catcode35=6    % #
  \catcode44=12   % ,
  \catcode45=12   % -
  \catcode46=12   % .
  \catcode58=12   % :
  \expandafter
    \ifx\csname PackageInfo\endcsname\relax
      \def\y#1#2{\immediate\write-1{Package #1 Info: #2.}}%
    \else
      \def\y#1#2{\PackageInfo{#1}{#2}}%
    \fi
  \def\empty {}%
  \expandafter\let\expandafter\w\csname ver@xint.sty\endcsname
  \ifx\w\relax % Plain TeX, user gave a file name at the prompt
      \y{xintfrac}{Loading of package xint failed, aborting input}%
      \aftergroup\endinput
  \fi
  \ifx\w\empty % LaTeX, user gave a file name at the prompt
      \y{xintfrac}{Loading of package xint failed, aborting input}%
      \aftergroup\endinput
  \fi
\endgroup%
%    \end{macrocode}
% \subsection{Catcodes}
%    \begin{macrocode}
\XINTsetupcatcodes%    
%    \end{macrocode}
% \subsection{Package identification}
%    \begin{macrocode}
\XINT_providespackage
\ProvidesPackage{xintfrac}%
  [2013/10/03 v1.09b Expandable operations on fractions (jfB)]%
\chardef\xint_c_vi     6
\chardef\xint_c_vii    7
\chardef\xint_c_xviii 18
\mathchardef\xint_c_x^iv 10000
%    \end{macrocode}
% \subsection{\csh{xintLen}}
%    \begin{macrocode}
\def\xintLen {\romannumeral0\xintlen }%
\def\xintlen #1%
{%
    \expandafter\XINT_flen\romannumeral0\XINT_infrac {#1}%
}%
\def\XINT_flen #1#2#3%
{%
    \expandafter\space
    \the\numexpr -1+\XINT_Abs {#1}+\XINT_Len {#2}+\XINT_Len {#3}\relax
}%
%    \end{macrocode}
% \subsection{\csh{XINT\_lenrord\_loop}}
%    \begin{macrocode}
\def\XINT_lenrord_loop #1#2#3#4#5#6#7#8#9% 
{%  faire \romannumeral-`0\XINT_lenrord_loop 0{}#1\Z\W\W\W\W\W\W\W\Z
    \xint_gob_til_W #9\XINT_lenrord_W\W
    \expandafter\XINT_lenrord_loop\expandafter 
    {\the\numexpr #1+7}{#9#8#7#6#5#4#3#2}%
}%
\def\XINT_lenrord_W\W\expandafter\XINT_lenrord_loop\expandafter #1#2#3\Z
{%
    \expandafter\XINT_lenrord_X\expandafter {#1}#2\Z
}%
\def\XINT_lenrord_X #1#2\Z
{%
    \XINT_lenrord_Y #2\R\R\R\R\R\R\T {#1}%
}%
\def\XINT_lenrord_Y #1#2#3#4#5#6#7#8\T
{%
    \xint_gob_til_W 
            #7\XINT_lenrord_Z \xint_c_viii
            #6\XINT_lenrord_Z \xint_c_vii
            #5\XINT_lenrord_Z \xint_c_vi
            #4\XINT_lenrord_Z \xint_c_v
            #3\XINT_lenrord_Z \xint_c_iv
            #2\XINT_lenrord_Z \xint_c_iii
            \W\XINT_lenrord_Z \xint_c_ii   \Z
}%
\def\XINT_lenrord_Z #1#2\Z #3% retourne: {longueur}renverse\Z
{%
    \expandafter{\the\numexpr #3-#1\relax}%
}%
%    \end{macrocode}
% \subsection{\csh{XINT\_outfrac}}
% \lverb|&
% 1.06a version now outputs 0/1[0] and not 0[0] in case of zero. More generally
% all macros have been checked in xintfrac, xintseries, xintcfrac, to make sure
% the output format for fractions was always A/B[n]. (except of course \xintIrr,
% \xintJrr, \xintRawWithZeros)|
%    \begin{macrocode}
\def\XINT_outfrac #1#2#3%
{%
    \ifcase\XINT_Sgn{#3}
        \expandafter \XINT_outfrac_divisionbyzero
    \or
        \expandafter \XINT_outfrac_P
    \else
        \expandafter \XINT_outfrac_N 
    \fi
    {#2}{#3}[#1]%
}%
\def\XINT_outfrac_divisionbyzero #1#2{\xintError:DivisionByZero\space #1/0}%
\def\XINT_outfrac_P #1#2%
{%
    \ifcase\XINT_Sgn{#1}
        \expandafter\XINT_outfrac_Zero
    \fi
    \space #1/#2%
}%
\def\XINT_outfrac_Zero #1[#2]{ 0/1[0]}%
\def\XINT_outfrac_N #1#2%
{%
    \expandafter\XINT_outfrac_N_a\expandafter
    {\romannumeral0\XINT_opp #2}{\romannumeral0\XINT_opp #1}%
}%
\def\XINT_outfrac_N_a #1#2%
{%
    \expandafter\XINT_outfrac_P\expandafter {#2}{#1}%
}%
%    \end{macrocode}
% \subsection{\csh{XINT\_inFrac}}
% \lverb|Extended in 1.07 to accept scientific notation on input. With lowercase
% e only. The \xintexpr parser does accept uppercase E also.|
%    \begin{macrocode}
\def\XINT_inFrac {\romannumeral0\XINT_infrac }%
\def\XINT_infrac #1%
{%
    \expandafter\XINT_infrac_ \romannumeral-`0#1[\W]\Z\T
}%
\def\XINT_infrac_ #1[#2#3]#4\Z
{%
    \xint_UDwfork
      #2\dummy \XINT_infrac_A
      \W\dummy \XINT_infrac_B
    \krof
    #1[#2#3]#4%
}%
\def\XINT_infrac_A #1[\W]\T 
{%
    \XINT_frac #1/\W\Z 
}%
\def\XINT_infrac_B #1%
{%
    \xint_gob_til_zero #1\XINT_infrac_Zero0\XINT_infrac_BB #1%
}%
\def\XINT_infrac_BB #1[\W]\T {\XINT_infrac_BC #1/\W\Z }%
\def\XINT_infrac_BC #1/#2#3\Z 
{%
    \xint_UDwfork
     #2\dummy \XINT_infrac_BCa
     \W\dummy {\expandafter\XINT_infrac_BCb \romannumeral-`0#2}%
    \krof
    #3\Z #1\Z
}%
\def\XINT_infrac_BCa \Z #1[#2]#3\Z { {#2}{#1}{1}}%
\def\XINT_infrac_BCb #1[#2]/\W\Z #3\Z { {#2}{#3}{#1}}%
\def\XINT_infrac_Zero #1\T { {0}{0}{1}}%
%    \end{macrocode}
% \subsection{\csh{XINT\_frac}}
% \lverb|Extended in 1.07 to recognize and accept scientific notation both at
% the numerator and (possible) denominator. Only a lowercase e will do here, but
% uppercase E is possible within an \xintexpr..\relax |
%    \begin{macrocode}
\def\XINT_frac #1/#2#3\Z
{%
    \xint_UDwfork
     #2\dummy \XINT_frac_A
     \W\dummy {\expandafter\XINT_frac_U \romannumeral-`0#2}%
    \krof
    #3e\W\Z #1e\W\Z
}%
\def\XINT_frac_U #1e#2#3\Z
{%
    \xint_UDwfork
      #2\dummy  \XINT_frac_Ua
      \W\dummy {\XINT_frac_Ub #2}%
    \krof
    #3\Z #1\Z
}%
\def\XINT_frac_Ua      \Z #1/\W\Z  {\XINT_frac_B #1.\W\Z {0}}%
\def\XINT_frac_Ub #1/\W e\W\Z #2\Z {\XINT_frac_B #2.\W\Z {#1}}%
\def\XINT_frac_B #1.#2#3\Z
{%
    \xint_UDwfork
      #2\dummy  \XINT_frac_Ba
      \W\dummy {\XINT_frac_Bb #2}%
    \krof
    #3\Z #1\Z
}%
\def\XINT_frac_Ba \Z #1\Z {\XINT_frac_T {0}{#1}}%
\def\XINT_frac_Bb #1.\W\Z #2\Z
{%
    \expandafter \XINT_frac_T \expandafter
    {\romannumeral0\XINT_length {#1}}{#2#1}%
}%
\def\XINT_frac_A e\W\Z {\XINT_frac_T {0}{1}{0}}%
\def\XINT_frac_T #1#2#3#4e#5#6\Z
{%
    \xint_UDwfork
      #5\dummy  \XINT_frac_Ta
      \W\dummy {\XINT_frac_Tb #5}%
    \krof
    #6\Z #4\Z {#1}{#2}{#3}%
}%
\def\XINT_frac_Ta \Z #1\Z      {\XINT_frac_C #1.\W\Z {0}}%
\def\XINT_frac_Tb #1e\W\Z #2\Z {\XINT_frac_C #2.\W\Z {#1}}%
\def\XINT_frac_C #1.#2#3\Z
{%
    \xint_UDwfork
      #2\dummy \XINT_frac_Ca
      \W\dummy {\XINT_frac_Cb #2}%
    \krof
    #3\Z #1\Z
}%
\def\XINT_frac_Ca \Z #1\Z {\XINT_frac_D {0}{#1}}%
\def\XINT_frac_Cb #1.\W\Z #2\Z 
{%
    \expandafter\XINT_frac_D\expandafter
    {\romannumeral0\XINT_length {#1}}{#2#1}%
}%
\def\XINT_frac_D #1#2#3#4#5#6%
{%
    \expandafter \XINT_frac_E \expandafter
    {\the\numexpr -#1+#3+#4-#6\expandafter}\expandafter
    {\romannumeral0\XINT_num_loop #2%
     \xint_relax\xint_relax\xint_relax\xint_relax
     \xint_relax\xint_relax\xint_relax\xint_relax\Z }%
    {\romannumeral0\XINT_num_loop #5%
     \xint_relax\xint_relax\xint_relax\xint_relax
     \xint_relax\xint_relax\xint_relax\xint_relax\Z }%
}%
\def\XINT_frac_E #1#2#3%
{%
   \expandafter \XINT_frac_F  #3\Z {#2}{#1}%
}%
\def\XINT_frac_F #1%
{%
    \xint_UDzerominusfork
      #1-\dummy  \XINT_frac_Gdivisionbyzero
      0#1\dummy  \XINT_frac_Gneg
       0-\dummy  {\XINT_frac_Gpos #1}%
    \krof
}%
\def\XINT_frac_Gdivisionbyzero #1\Z #2#3%
{%
   \xintError:DivisionByZero\space {0}{#2}{0}%
}%
\def\XINT_frac_Gneg #1\Z #2#3%
{%
    \expandafter\XINT_frac_H \expandafter{\romannumeral0\XINT_opp #2}{#3}{#1}%
}%
\def\XINT_frac_H #1#2{ {#2}{#1}}%
\def\XINT_frac_Gpos #1\Z #2#3{ {#3}{#2}{#1}}%
%    \end{macrocode}
% \subsection{\csh{XINT\_factortens},~\csh{XINT\_cuz\_cnt}}
%    \begin{macrocode}
\def\XINT_factortens #1%
{%
    \expandafter\XINT_cuz_cnt_loop\expandafter
    {\expandafter}\romannumeral0\XINT_rord_main {}#1%
      \xint_relax
        \xint_undef\xint_undef\xint_undef\xint_undef
        \xint_undef\xint_undef\xint_undef\xint_undef
      \xint_relax
    \R\R\R\R\R\R\R\R\Z
}%
\def\XINT_cuz_cnt #1%
{%
    \XINT_cuz_cnt_loop {}#1\R\R\R\R\R\R\R\R\Z
}%
\def\XINT_cuz_cnt_loop #1#2#3#4#5#6#7#8#9%
{%
    \xint_gob_til_R #9\XINT_cuz_cnt_toofara \R
    \expandafter\XINT_cuz_cnt_checka\expandafter
    {\the\numexpr #1+8\relax}{#2#3#4#5#6#7#8#9}%
}%
\def\XINT_cuz_cnt_toofara\R
    \expandafter\XINT_cuz_cnt_checka\expandafter #1#2%
{%
    \XINT_cuz_cnt_toofarb {#1}#2%
}%
\def\XINT_cuz_cnt_toofarb #1#2\Z {\XINT_cuz_cnt_toofarc #2\Z {#1}}%
\def\XINT_cuz_cnt_toofarc #1#2#3#4#5#6#7#8%
{%
    \xint_gob_til_R #2\XINT_cuz_cnt_toofard 7%
            #3\XINT_cuz_cnt_toofard 6%
            #4\XINT_cuz_cnt_toofard 5%
            #5\XINT_cuz_cnt_toofard 4%
            #6\XINT_cuz_cnt_toofard 3%
            #7\XINT_cuz_cnt_toofard 2%
            #8\XINT_cuz_cnt_toofard 1%
            \Z #1#2#3#4#5#6#7#8%
}%
\def\XINT_cuz_cnt_toofard #1#2\Z #3\R #4\Z #5%
{%
    \expandafter\XINT_cuz_cnt_toofare
    \the\numexpr #3\relax \R\R\R\R\R\R\R\R\Z
    {\the\numexpr #5-#1\relax}\R\Z
}%
\def\XINT_cuz_cnt_toofare #1#2#3#4#5#6#7#8%
{%
    \xint_gob_til_R #2\XINT_cuz_cnt_stopc 1%
            #3\XINT_cuz_cnt_stopc 2%
            #4\XINT_cuz_cnt_stopc 3%
            #5\XINT_cuz_cnt_stopc 4%
            #6\XINT_cuz_cnt_stopc 5%
            #7\XINT_cuz_cnt_stopc 6%
            #8\XINT_cuz_cnt_stopc 7%
            \Z #1#2#3#4#5#6#7#8%
}%
\def\XINT_cuz_cnt_checka #1#2%
{%
    \expandafter\XINT_cuz_cnt_checkb\the\numexpr #2\relax \Z {#1}%
}%
\def\XINT_cuz_cnt_checkb #1%
{%
    \xint_gob_til_zero #1\expandafter\XINT_cuz_cnt_loop\xint_gob_til_Z
    0\XINT_cuz_cnt_stopa #1%
}%
\def\XINT_cuz_cnt_stopa #1\Z 
{%
    \XINT_cuz_cnt_stopb #1\R\R\R\R\R\R\R\R\Z %
}%
\def\XINT_cuz_cnt_stopb #1#2#3#4#5#6#7#8#9%
{%
    \xint_gob_til_R #2\XINT_cuz_cnt_stopc 1%
            #3\XINT_cuz_cnt_stopc 2%
            #4\XINT_cuz_cnt_stopc 3%
            #5\XINT_cuz_cnt_stopc 4%
            #6\XINT_cuz_cnt_stopc 5%
            #7\XINT_cuz_cnt_stopc 6%
            #8\XINT_cuz_cnt_stopc 7%
            #9\XINT_cuz_cnt_stopc 8%
            \Z #1#2#3#4#5#6#7#8#9%
}%
\def\XINT_cuz_cnt_stopc #1#2\Z #3\R #4\Z #5%
{%
    \expandafter\XINT_cuz_cnt_stopd\expandafter
    {\the\numexpr #5-#1}#3%
}%
\def\XINT_cuz_cnt_stopd #1#2\R #3\Z
{%
    \expandafter\space\expandafter
     {\romannumeral0\XINT_rord_main {}#2%
      \xint_relax
        \xint_undef\xint_undef\xint_undef\xint_undef
        \xint_undef\xint_undef\xint_undef\xint_undef
      \xint_relax }{#1}%
}%
%    \end{macrocode}
% \subsection{\csh{xintRaw}}
% \lverb|&
% 1.07: this macro simply prints in a user readable form the fraction after its 
% initial scanning. Useful when put inside braces in an \xintexpr, when the
% input is not yet in the A/B[n] form.|
%    \begin{macrocode}
\def\xintRaw {\romannumeral0\xintraw }%
\def\xintraw
{%
    \expandafter\XINT_raw\romannumeral0\XINT_infrac
}%
\def\XINT_raw #1#2#3{ #2/#3[#1]}%
%    \end{macrocode}
% \subsection{\csh{xintPRaw}}
% \lverb|&
% 1.09b: these [n]'s and especially the possible /1 are truly annoying at
% times.| 
%    \begin{macrocode}
\def\xintPRaw {\romannumeral0\xintpraw }%
\def\xintpraw
{%
    \expandafter\XINT_praw\romannumeral0\XINT_infrac
}%
\def\XINT_praw #1%
{%
    \ifnum #1=\xint_c_ \expandafter\XINT_praw_a\fi \XINT_praw_A {#1}%
}%
\def\XINT_praw_A #1#2#3%
{%
    \if\XINT_isOne{#3}1\expandafter\xint_firstoftwo
                  \else\expandafter\xint_secondoftwo
    \fi { #2[#1]}{ #2/#3[#1]}%
}%
\def\XINT_praw_a\XINT_praw_A #1#2#3%
{%
    \if\XINT_isOne{#3}1\expandafter\xint_firstoftwo
                  \else\expandafter\xint_secondoftwo
    \fi { #2}{ #2/#3}%
}%
%    \end{macrocode}
% \subsection{\csh{xintRawWithZeros}}
% \lverb|&
% This was called \xintRaw in versions earlier than 1.07|
%    \begin{macrocode}
\def\xintRawWithZeros {\romannumeral0\xintrawwithzeros }%
\def\xintrawwithzeros
{%
    \expandafter\XINT_rawz\romannumeral0\XINT_infrac
}%
\def\XINT_rawz #1%
{%
    \ifcase\XINT_Sgn {#1}
      \expandafter\XINT_rawz_Ba
    \or
      \expandafter\XINT_rawz_A
    \else
      \expandafter\XINT_rawz_Ba
    \fi 
    {#1}%
}%
\def\XINT_rawz_A  #1#2#3{\xint_dsh {#2}{-#1}/#3}%
\def\XINT_rawz_Ba #1#2#3{\expandafter\XINT_rawz_Bb
                        \expandafter{\romannumeral0\xint_dsh {#3}{#1}}{#2}}%
\def\XINT_rawz_Bb #1#2{ #2/#1}%
%    \end{macrocode}
% \subsection{\csh{xintFloor}}
% \lverb|1.09a|
%    \begin{macrocode}
\def\xintFloor {\romannumeral0\xintfloor }%
\def\xintfloor #1{\expandafter\XINT_floor
                  \romannumeral0\xintrawwithzeros {#1}.}%
\def\XINT_floor #1/#2.{\xintiquo {#1}{#2}}%
%    \end{macrocode}
% \subsection{\csh{xintCeil}}
% \lverb|1.09a|
%    \begin{macrocode}
\def\xintCeil {\romannumeral0\xintceil }%
\def\xintceil #1{\xintiiopp {\xintFloor {\xintOpp{#1}}}}%
%    \end{macrocode}
% \subsection{\csh{xintNumerator}}
%    \begin{macrocode}
\def\xintNumerator {\romannumeral0\xintnumerator }%
\def\xintnumerator 
{%
    \expandafter\XINT_numer\romannumeral0\XINT_infrac
}%
\def\XINT_numer #1%
{%
    \ifcase\XINT_Sgn {#1}
      \expandafter\XINT_numer_B
    \or
      \expandafter\XINT_numer_A
    \else
      \expandafter\XINT_numer_B
    \fi 
    {#1}%
}%
\def\XINT_numer_A #1#2#3{\xint_dsh {#2}{-#1}}%
\def\XINT_numer_B #1#2#3{ #2}%
%    \end{macrocode}
% \subsection{\csh{xintDenominator}}
%    \begin{macrocode}
\def\xintDenominator {\romannumeral0\xintdenominator }%
\def\xintdenominator 
{%
    \expandafter\XINT_denom\romannumeral0\XINT_infrac
}%
\def\XINT_denom #1%
{%
    \ifcase\XINT_Sgn {#1}
      \expandafter\XINT_denom_B
    \or
      \expandafter\XINT_denom_A
    \else
      \expandafter\XINT_denom_B
    \fi 
    {#1}%
}%
\def\XINT_denom_A #1#2#3{ #3}%
\def\XINT_denom_B #1#2#3{\xint_dsh {#3}{#1}}%
%    \end{macrocode}
% \subsection{\csh{xintFrac}}
%    \begin{macrocode}
\def\xintFrac {\romannumeral0\xintfrac }%
\def\xintfrac #1%
{%
    \expandafter\XINT_fracfrac_A\romannumeral0\XINT_infrac {#1}%
}%
\def\XINT_fracfrac_A #1{\XINT_fracfrac_B #1\Z }%
\catcode`^=7
\def\XINT_fracfrac_B #1#2\Z 
{%
    \xint_gob_til_zero #1\XINT_fracfrac_C 0\XINT_fracfrac_D {10^{#1#2}}%
}%
\def\XINT_fracfrac_C #1#2#3#4#5% 
{%
    \ifcase\XINT_isOne {#5}
    \or \xint_afterfi {\expandafter\xint_firstoftwo_andstop\xint_gobble_ii }%
    \fi
    \space
    \frac {#4}{#5}%
}%
\def\XINT_fracfrac_D #1#2#3%
{%
    \ifcase\XINT_isOne {#3}
    \or \XINT_fracfrac_E
    \fi
    \space
    \frac {#2}{#3}#1%
}%
\def\XINT_fracfrac_E \fi #1#2#3#4{\fi \space #3\cdot }%
%    \end{macrocode}
% \subsection{\csh{xintSignedFrac}}
%    \begin{macrocode}
\def\xintSignedFrac {\romannumeral0\xintsignedfrac }%
\def\xintsignedfrac #1%
{%
    \expandafter\XINT_sgnfrac_a\romannumeral0\XINT_infrac {#1}%
}%
\def\XINT_sgnfrac_a #1#2%
{%
    \XINT_sgnfrac_b #2\Z {#1}%
}%
\def\XINT_sgnfrac_b #1%
{%
    \xint_UDsignfork
      #1\dummy \XINT_sgnfrac_N
       -\dummy {\XINT_sgnfrac_P #1}%
    \krof
}%
\def\XINT_sgnfrac_P #1\Z #2%
{%
    \XINT_fracfrac_A {#2}{#1}%
}%
\def\XINT_sgnfrac_N
{%
    \expandafter\xint_minus_andstop\romannumeral0\XINT_sgnfrac_P 
}%
%    \end{macrocode}
% \subsection{\csh{xintFwOver}}
%    \begin{macrocode}
\def\xintFwOver {\romannumeral0\xintfwover }%
\def\xintfwover #1%
{%
    \expandafter\XINT_fwover_A\romannumeral0\XINT_infrac {#1}%
}%
\def\XINT_fwover_A #1{\XINT_fwover_B #1\Z }%
\def\XINT_fwover_B #1#2\Z 
{%
    \xint_gob_til_zero #1\XINT_fwover_C 0\XINT_fwover_D {10^{#1#2}}%
}%
\catcode`^=11
\def\XINT_fwover_C #1#2#3#4#5% 
{%
    \ifcase\XINT_isOne {#5}
       \xint_afterfi { {#4\over #5}}%
    \or 
       \xint_afterfi { #4}%
    \fi
}%
\def\XINT_fwover_D #1#2#3%
{%
    \ifcase\XINT_isOne {#3}
      \xint_afterfi { {#2\over #3}}%
    \or 
      \xint_afterfi { #2\cdot }%
    \fi
    #1%
}%
%    \end{macrocode}
% \subsection{\csh{xintSignedFwOver}}
%    \begin{macrocode}
\def\xintSignedFwOver {\romannumeral0\xintsignedfwover }%
\def\xintsignedfwover #1%
{%
    \expandafter\XINT_sgnfwover_a\romannumeral0\XINT_infrac {#1}%
}%
\def\XINT_sgnfwover_a #1#2%
{%
    \XINT_sgnfwover_b #2\Z {#1}%
}%
\def\XINT_sgnfwover_b #1%
{%
    \xint_UDsignfork
      #1\dummy \XINT_sgnfwover_N
       -\dummy {\XINT_sgnfwover_P #1}%
    \krof
}%
\def\XINT_sgnfwover_P #1\Z #2%
{%
    \XINT_fwover_A {#2}{#1}%
}%
\def\XINT_sgnfwover_N
{%
    \expandafter\xint_minus_andstop\romannumeral0\XINT_sgnfwover_P 
}%
%    \end{macrocode}
% \subsection{\csh{xintREZ}}
%    \begin{macrocode}
\def\xintREZ {\romannumeral0\xintrez }%
\def\xintrez
{%
    \expandafter\XINT_rez_A\romannumeral0\XINT_infrac
}%
\def\XINT_rez_A #1#2%
{%
    \XINT_rez_AB #2\Z {#1}%
}%
\def\XINT_rez_AB #1%
{%
    \xint_UDzerominusfork
      #1-\dummy \XINT_rez_zero
      0#1\dummy \XINT_rez_neg
       0-\dummy {\XINT_rez_B #1}%
    \krof
}%
\def\XINT_rez_zero #1\Z #2#3{ 0/1[0]}%
\def\XINT_rez_neg {\expandafter\xint_minus_andstop\romannumeral0\XINT_rez_B }%
\def\XINT_rez_B #1\Z 
{%
    \expandafter\XINT_rez_C\romannumeral0\XINT_factortens {#1}%
}%
\def\XINT_rez_C #1#2#3#4%
{%
    \expandafter\XINT_rez_D\romannumeral0\XINT_factortens {#4}{#3}{#2}{#1}%
}%
\def\XINT_rez_D #1#2#3#4#5%
{%
    \expandafter\XINT_rez_E\expandafter
    {\the\numexpr #3+#4-#2}{#1}{#5}%
}%
\def\XINT_rez_E #1#2#3{ #3/#2[#1]}%
%    \end{macrocode}
% \subsection{\csh{xintE}}
% \lverb|added with with 1.07, together with support for `floats'. The fraction
% comes first here, contrarily to \xintTrunc and \xintRound.|
%    \begin{macrocode}
\def\xintE {\romannumeral0\xinte }%
\def\xinte #1%
{%
    \expandafter\XINT_e \romannumeral0\XINT_infrac {#1}%
}%
\def\XINT_e #1#2#3#4%
{%
    \expandafter\XINT_e_end\expandafter{\the\numexpr #1+#4}{#2}{#3}%
}%
\def\xintfE {\romannumeral0\xintfe }%
\def\xintfe #1%
{%
    \expandafter\XINT_fe \romannumeral0\XINT_infrac {#1}%
}%
\def\XINT_fe #1#2#3#4%
{%
    \expandafter\XINT_e_end\expandafter{\the\numexpr #1+\xintNum{#4}}{#2}{#3}%
}%
\def\XINT_e_end #1#2#3{ #2/#3[#1]}%
\let\XINTinFloatfE\xintfE
%    \end{macrocode}
% \subsection{\csh{xintIrr}}
% \lverb|&
% 1.04 fixes a buggy \xintIrr {0}. 
% 1.05 modifies the initial parsing and post-processing to use \xintrawwithzeros
% and to 
% more quickly deal with an input denominator equal to 1. 1.08 version does
% not remove a /1 denominator.|
%    \begin{macrocode}
\def\xintIrr {\romannumeral0\xintirr }%
\def\xintirr #1%
{%
    \expandafter\XINT_irr_start\romannumeral0\xintrawwithzeros {#1}\Z
}%
\def\XINT_irr_start #1#2/#3\Z
{%
    \ifcase\XINT_isOne {#3}
      \xint_afterfi
          {\xint_UDsignfork
               #1\dummy \XINT_irr_negative    
                -\dummy {\XINT_irr_nonneg #1}%       
           \krof}%
    \or
      \xint_afterfi{\XINT_irr_denomisone #1}%
    \fi 
    #2\Z {#3}%
}%
\def\XINT_irr_denomisone #1\Z #2{ #1/1}% changed in 1.08
\def\XINT_irr_negative   #1\Z #2{\XINT_irr_D #1\Z #2\Z \xint_minus_andstop}%
\def\XINT_irr_nonneg     #1\Z #2{\XINT_irr_D #1\Z #2\Z \space}%
\def\XINT_irr_D #1#2\Z #3#4\Z
{%
    \xint_UDzerosfork
       #3#1\dummy \XINT_irr_indeterminate      
       #30\dummy  \XINT_irr_divisionbyzero        
       #10\dummy  \XINT_irr_zero        
        00\dummy  \XINT_irr_loop_a
    \krof      
    {#3#4}{#1#2}{#3#4}{#1#2}%
}%
\def\XINT_irr_indeterminate #1#2#3#4#5{\xintError:NaN\space 0/0}%
\def\XINT_irr_divisionbyzero #1#2#3#4#5{\xintError:DivisionByZero #5#2/0}%
\def\XINT_irr_zero #1#2#3#4#5{ 0/1}% changed in 1.08
\def\XINT_irr_loop_a #1#2%
{%
    \expandafter\XINT_irr_loop_d
    \romannumeral0\XINT_div_prepare {#1}{#2}{#1}%
}%
\def\XINT_irr_loop_d #1#2%
{%
    \XINT_irr_loop_e #2\Z 
}%
\def\XINT_irr_loop_e #1#2\Z
{%
    \xint_gob_til_zero #1\xint_irr_loop_exit0\XINT_irr_loop_a {#1#2}%
}%
\def\xint_irr_loop_exit0\XINT_irr_loop_a #1#2#3#4%
{%
    \expandafter\XINT_irr_loop_exitb\expandafter
    {\romannumeral0\xintiquo {#3}{#2}}%
    {\romannumeral0\xintiquo {#4}{#2}}%
}%
\def\XINT_irr_loop_exitb #1#2%
{%
   \expandafter\XINT_irr_finish\expandafter {#2}{#1}%
}%
\def\XINT_irr_finish #1#2#3{#3#1/#2}% changed in 1.08
%    \end{macrocode}
% \subsection{\csh{xintNum}}
% \lverb|&
% This extension of the xint original xintNum is added in 1.05, as a
% synonym to 
% \xintIrr, but raising an error when the input does not evaluate to an integer.
% Usable with not too much overhead on integer input as \xintIrr 
% checks quickly for a denominator equal to 1 (which will be put there by the
% \XINT_infrac called by \xintrawwithzeros). This way, macros such as \xintQuo
% can be 
% modified with minimal overhead to accept fractional input as long as it
% evaluates to an integer. |
%    \begin{macrocode}
\def\xintNum {\romannumeral0\xintnum }%
\def\xintnum #1{\expandafter\XINT_intcheck\romannumeral0\xintirr {#1}\Z }%
\def\XINT_intcheck #1/#2\Z
{%
    \ifcase\XINT_isOne {#2}
      \xintError:NotAnInteger
    \fi\space #1%
}%
%    \end{macrocode}
% \subsection{\csh{xintJrr}}
% \lverb|&
% Modified similarly as \xintIrr in release 1.05. 1.08 version does
% not remove a /1 denominator.|
%    \begin{macrocode}
\def\xintJrr {\romannumeral0\xintjrr }%
\def\xintjrr #1%
{%
    \expandafter\XINT_jrr_start\romannumeral0\xintrawwithzeros {#1}\Z
}%
\def\XINT_jrr_start #1#2/#3\Z
{%
    \ifcase\XINT_isOne {#3}
      \xint_afterfi
          {\xint_UDsignfork
               #1\dummy \XINT_jrr_negative    
                -\dummy {\XINT_jrr_nonneg #1}%       
           \krof}%
    \or
      \xint_afterfi{\XINT_jrr_denomisone #1}%
    \fi 
    #2\Z {#3}%
}%
\def\XINT_jrr_denomisone #1\Z #2{ #1/1}% changed in 1.08
\def\XINT_jrr_negative   #1\Z #2{\XINT_jrr_D #1\Z #2\Z \xint_minus_andstop }%
\def\XINT_jrr_nonneg     #1\Z #2{\XINT_jrr_D #1\Z #2\Z \space}%
\def\XINT_jrr_D #1#2\Z #3#4\Z
{%
    \xint_UDzerosfork
       #3#1\dummy \XINT_jrr_indeterminate      
       #30\dummy  \XINT_jrr_divisionbyzero        
       #10\dummy  \XINT_jrr_zero        
        00\dummy  \XINT_jrr_loop_a
    \krof      
    {#3#4}{#1#2}1001%
}%
\def\XINT_jrr_indeterminate #1#2#3#4#5#6#7{\xintError:NaN\space 0/0}%
\def\XINT_jrr_divisionbyzero #1#2#3#4#5#6#7{\xintError:DivisionByZero #7#2/0}%
\def\XINT_jrr_zero #1#2#3#4#5#6#7{ 0/1}% changed in 1.08
\def\XINT_jrr_loop_a #1#2%
{%
    \expandafter\XINT_jrr_loop_b
    \romannumeral0\XINT_div_prepare {#1}{#2}{#1}%
}%
\def\XINT_jrr_loop_b #1#2#3#4#5#6#7%
{%
    \expandafter \XINT_jrr_loop_c \expandafter
        {\romannumeral0\xintiiadd{\XINT_Mul{#4}{#1}}{#6}}%
        {\romannumeral0\xintiiadd{\XINT_Mul{#5}{#1}}{#7}}%
    {#2}{#3}{#4}{#5}%
}%
\def\XINT_jrr_loop_c #1#2%
{%
    \expandafter \XINT_jrr_loop_d \expandafter{#2}{#1}%
}%
\def\XINT_jrr_loop_d #1#2#3#4%
{%
    \XINT_jrr_loop_e #3\Z {#4}{#2}{#1}%
}%
\def\XINT_jrr_loop_e #1#2\Z
{%
    \xint_gob_til_zero #1\xint_jrr_loop_exit0\XINT_jrr_loop_a {#1#2}%
}%
\def\xint_jrr_loop_exit0\XINT_jrr_loop_a #1#2#3#4#5#6%
{%
    \XINT_irr_finish {#3}{#4}%
}%
%    \end{macrocode}
% \subsection{\csh{xintTrunc}, \csh{xintiTrunc}}
% \lverb|&
% Modified in 1.06 to give the first argument to a \numexpr.|
%    \begin{macrocode}
\def\xintTrunc {\romannumeral0\xinttrunc }%
\def\xintiTrunc {\romannumeral0\xintitrunc }%
\def\xinttrunc #1%
{%
    \expandafter\XINT_trunc\expandafter {\the\numexpr #1}%
}%
\def\XINT_trunc #1#2%
{%
    \expandafter\XINT_trunc_G
    \romannumeral0\expandafter\XINT_trunc_A
    \romannumeral0\XINT_infrac {#2}{#1}{#1}%
}%
\def\xintitrunc #1%
{%
    \expandafter\XINT_itrunc\expandafter {\the\numexpr #1}%
}%
\def\XINT_itrunc #1#2%
{%
    \expandafter\XINT_itrunc_G
    \romannumeral0\expandafter\XINT_trunc_A
    \romannumeral0\XINT_infrac {#2}{#1}{#1}%
}%
\def\XINT_trunc_A #1#2#3#4%
{%
    \expandafter\XINT_trunc_checkifzero
    \expandafter{\the\numexpr #1+#4}#2\Z {#3}%
}%
\def\XINT_trunc_checkifzero #1#2#3\Z 
{%
    \xint_gob_til_zero #2\XINT_trunc_iszero0\XINT_trunc_B {#1}{#2#3}%
}%
\def\XINT_trunc_iszero #1#2#3#4#5{ 0\Z 0}%
\def\XINT_trunc_B #1%
{%
    \ifcase\XINT_Sgn {#1}
      \expandafter\XINT_trunc_D
    \or
      \expandafter\XINT_trunc_D
    \else
      \expandafter\XINT_trunc_C
    \fi 
    {#1}%
}%
\def\XINT_trunc_C #1#2#3%
{%
    \expandafter \XINT_trunc_E
    \romannumeral0\xint_dsh {#3}{#1}\Z #2\Z
}%
\def\XINT_trunc_D #1#2%
{%
    \expandafter \XINT_trunc_DE \expandafter
    {\romannumeral0\xint_dsh {#2}{-#1}}%
}%
\def\XINT_trunc_DE #1#2{\XINT_trunc_E #2\Z #1\Z }%
\def\XINT_trunc_E #1#2\Z #3#4\Z
{%
    \xint_UDsignsfork
          #1#3\dummy \XINT_trunc_minusminus          
           #1-\dummy {\XINT_trunc_minusplus #3}%
           #3-\dummy {\XINT_trunc_plusminus #1}%
            --\dummy {\XINT_trunc_plusplus  #3#1}%
    \krof
    {#4}{#2}%
}%
\def\XINT_trunc_minusminus #1#2{\xintiquo {#1}{#2}\Z \space}%
\def\XINT_trunc_minusplus #1#2#3{\xintiquo {#1#2}{#3}\Z \xint_minus_andstop}%
\def\XINT_trunc_plusminus #1#2#3{\xintiquo {#2}{#1#3}\Z \xint_minus_andstop}%
\def\XINT_trunc_plusplus  #1#2#3#4{\xintiquo {#1#3}{#2#4}\Z \space}%
\def\XINT_itrunc_G #1#2\Z #3#4%
{%
    \xint_gob_til_zero #1\XINT_trunc_zero 0\xint_firstoftwo {#3#1#2}0%
}%
\def\XINT_trunc_G #1\Z #2#3%
{%
    \xint_gob_til_zero #2\XINT_trunc_zero 0%
    \expandafter\XINT_trunc_H\expandafter
    {\the\numexpr\romannumeral0\XINT_length {#1}-#3}{#3}{#1}#2%
}%
\def\XINT_trunc_zero 0#10{ 0}%
\def\XINT_trunc_H #1#2%
{%
    \ifnum #1 > 0
        \xint_afterfi {\XINT_trunc_Ha {#2}}%
    \else
        \xint_afterfi {\XINT_trunc_Hb {-#1}}% -0,--1,--2, ....
    \fi
}%
\def\XINT_trunc_Ha
{%
  \expandafter\XINT_trunc_Haa\romannumeral0\xintdecsplit
}%
\def\XINT_trunc_Haa #1#2#3%
{%
    #3#1.#2%
}%
\def\XINT_trunc_Hb #1#2#3%
{%
    \expandafter #3\expandafter0\expandafter.%
    \romannumeral0\XINT_dsx_zeroloop {#1}{}\Z {}#2% #1=-0 possible! 
}%
%    \end{macrocode}
% \subsection{\csh{xintRound}, \csh{xintiRound}}
% \lverb|&
% Modified in 1.06 to give the first argument to a \numexpr.|
%    \begin{macrocode}
\def\xintRound {\romannumeral0\xintround }%
\def\xintiRound {\romannumeral0\xintiround }%
\def\xintround #1%
{%
    \expandafter\XINT_round\expandafter {\the\numexpr #1}%
}%
\def\XINT_round
{%
    \expandafter\XINT_trunc_G\romannumeral0\XINT_round_A
}%
\def\xintiround #1%
{%
    \expandafter\XINT_iround\expandafter {\the\numexpr #1}%
}%
\def\XINT_iround
{%
    \expandafter\XINT_itrunc_G\romannumeral0\XINT_round_A
}%
\def\XINT_round_A #1#2%
{%
    \expandafter\XINT_round_B
    \romannumeral0\expandafter\XINT_trunc_A
    \romannumeral0\XINT_infrac {#2}{\the\numexpr #1+1\relax}{#1}%
}%
\def\XINT_round_B #1\Z
{%
    \expandafter\XINT_round_C
    \romannumeral0\XINT_rord_main {}#1%
      \xint_relax
        \xint_undef\xint_undef\xint_undef\xint_undef
        \xint_undef\xint_undef\xint_undef\xint_undef
      \xint_relax 
    \Z 
}%
\def\XINT_round_C #1%
{%
    \ifnum #1<5
        \expandafter\XINT_round_Daa
    \else
        \expandafter\XINT_round_Dba
    \fi
}%
\def\XINT_round_Daa #1%
{%
    \xint_gob_til_Z #1\XINT_round_Daz\Z \XINT_round_Da #1%
}%
\def\XINT_round_Daz\Z \XINT_round_Da \Z { 0\Z }%
\def\XINT_round_Da #1\Z 
{%
    \XINT_rord_main {}#1%
      \xint_relax
        \xint_undef\xint_undef\xint_undef\xint_undef
        \xint_undef\xint_undef\xint_undef\xint_undef
      \xint_relax  \Z  
}%
\def\XINT_round_Dba #1%
{%
    \xint_gob_til_Z #1\XINT_round_Dbz\Z \XINT_round_Db #1%
}%
\def\XINT_round_Dbz\Z \XINT_round_Db \Z { 1\Z }%
\def\XINT_round_Db #1\Z
{%
    \XINT_addm_A 0{}1000\W\X\Y\Z #1000\W\X\Y\Z \Z
}%
%    \end{macrocode}
% \subsection{\csh{xintRound:csv}}
% \lverb|1.09a. For use by \xintthenumexpr.|
%    \begin{macrocode}
\def\xintRound:csv #1{\expandafter\XINT_round:_a\romannumeral-`0#1,,^}%
\def\XINT_round:_a {\XINT_round:_b {}}%
\def\XINT_round:_b #1#2,%
             {\expandafter\XINT_round:_c\romannumeral-`0#2,{#1}}%
\def\XINT_round:_c #1{\if #1,\expandafter\XINT_round:_f
                      \else\expandafter\XINT_round:_d\fi #1}%
\def\XINT_round:_d #1,%
         {\expandafter\XINT_round:_e\romannumeral0\xintiround 0{#1},}%
\def\XINT_round:_e #1,#2{\XINT_round:_b {#2,#1}}%
\def\XINT_round:_f ,#1#2^{\xint_gobble_i #1}% 
%    \end{macrocode}
% \subsection{\csh{xintDigits}}
% \lverb|&
% The mathchardef used to be called \XINT_digits, but for reasons originating in
% \xintNewExpr, release 1.09a uses \XINTdigits without underscore.|
%    \begin{macrocode}
\mathchardef\XINTdigits 16
\def\xintDigits #1#2%
   {\afterassignment \xint_gobble_i \mathchardef\XINTdigits=}%
\def\xinttheDigits {\number\XINTdigits }%
%    \end{macrocode}
% \subsection{\csh{xintFloat}}
% \lverb|1.07. Completely re-written in 1.08a, with spectacular speed
% gains. The earlier version was seriously silly when dealing with
% inputs having a big power of ten. Again some modifications in 1.08b
% for a better treatment of cases with long explicit numerators or
% denominators. Macro \xintFloat:csv added in 1.09 for use by xintexpr.|
%    \begin{macrocode}
\def\xintFloat   {\romannumeral0\xintfloat }%
\def\xintfloat #1{\XINT_float_chkopt #1\Z }%
\def\XINT_float_chkopt #1%
{%
    \ifx [#1\expandafter\XINT_float_opt
       \else\expandafter\XINT_float_noopt
    \fi  #1%
}%
\def\XINT_float_noopt #1\Z
{%
    \expandafter\XINT_float_a\expandafter\XINTdigits
    \romannumeral0\XINT_infrac {#1}\XINT_float_Q
}%
\def\XINT_float_opt [\Z #1]#2%
{%
    \expandafter\XINT_float_a\expandafter 
    {\the\numexpr #1\expandafter}%
    \romannumeral0\XINT_infrac {#2}\XINT_float_Q
}%
\def\XINT_float_a #1#2#3% #1=P, #2=n, #3=A, #4=B
{%
    \XINT_float_fork #3\Z {#1}{#2}% #1 = precision, #2=n
}%
\def\XINT_float_fork #1%
{%
    \xint_UDzerominusfork
     #1-\dummy  \XINT_float_zero
     0#1\dummy  \XINT_float_J
      0-\dummy  {\XINT_float_K #1}%
    \krof
}%
\def\XINT_float_zero #1\Z #2#3#4#5{ 0.e0}%
\def\XINT_float_J {\expandafter\xint_minus_andstop\romannumeral0\XINT_float_K }%
\def\XINT_float_K #1\Z #2% #1=A, #2=P, #3=n, #4=B
{%
    \expandafter\XINT_float_L\expandafter
    {\the\numexpr\xintLength{#1}\expandafter}\expandafter
    {\the\numexpr #2+\xint_c_ii}{#1}{#2}%
}%
\def\XINT_float_L #1#2%
{%
    \ifnum #1>#2
      \expandafter\XINT_float_Ma
    \else
      \expandafter\XINT_float_Mc
    \fi {#1}{#2}%
}%
\def\XINT_float_Ma #1#2#3%
{%
    \expandafter\XINT_float_Mb\expandafter
    {\the\numexpr #1-#2\expandafter\expandafter\expandafter}%
    \expandafter\expandafter\expandafter
    {\expandafter\xint_firstoftwo
     \romannumeral0\XINT_split_fromleft_loop {#2}{}#3\W\W\W\W\W\W\W\W\Z
     }{#2}%
}%
\def\XINT_float_Mb #1#2#3#4#5#6% #2=A', #3=P+2, #4=P, #5=n, #6=B
{%
   \expandafter\XINT_float_N\expandafter
   {\the\numexpr\xintLength{#6}\expandafter}\expandafter
   {\the\numexpr #3\expandafter}\expandafter
   {\the\numexpr #1+#5}%
   {#6}{#3}{#2}{#4}%
}% long de B, P+2, n', B, |A'|=P+2, A', P
\def\XINT_float_Mc #1#2#3#4#5#6%
{%
   \expandafter\XINT_float_N\expandafter
   {\romannumeral0\XINT_length{#6}}{#2}{#5}{#6}{#1}{#3}{#4}%
}% long de B, P+2, n, B, |A|, A, P
\def\XINT_float_N #1#2%
{%
    \ifnum #1>#2
      \expandafter\XINT_float_O
    \else
      \expandafter\XINT_float_P
    \fi {#1}{#2}%
}%
\def\XINT_float_O #1#2#3#4%
{%
    \expandafter\XINT_float_P\expandafter
    {\the\numexpr #2\expandafter}\expandafter
    {\the\numexpr #2\expandafter}\expandafter
    {\the\numexpr #3-#1+#2\expandafter\expandafter\expandafter}%
    \expandafter\expandafter\expandafter
    {\expandafter\xint_firstoftwo
     \romannumeral0\XINT_split_fromleft_loop {#2}{}#4\W\W\W\W\W\W\W\W\Z
     }%
}% |B|,P+2,n,B,|A|,A,P
\def\XINT_float_P #1#2#3#4#5#6#7#8%
{%
    \expandafter #8\expandafter {\the\numexpr #1-#5+#2-\xint_c_i}%
    {#6}{#4}{#7}{#3}%
}% |B|-|A|+P+1,A,B,P,n
\def\XINT_float_Q #1%
{%
    \ifnum #1<\xint_c_
      \expandafter\XINT_float_Ri
    \else
      \expandafter\XINT_float_Rii
    \fi {#1}%
}%
\def\XINT_float_Ri #1#2#3%
{%
    \expandafter\XINT_float_Sa
    \romannumeral0\xintiquo {#2}%
         {\XINT_dsx_addzerosnofuss {-#1}{#3}}\Z {#1}%
}%
\def\XINT_float_Rii #1#2#3%
{%
    \expandafter\XINT_float_Sa
    \romannumeral0\xintiquo
         {\XINT_dsx_addzerosnofuss {#1}{#2}}{#3}\Z {#1}%
}%
\def\XINT_float_Sa #1%
{%
    \if #19%
        \xint_afterfi {\XINT_float_Sb\XINT_float_Wb }%
    \else
        \xint_afterfi {\XINT_float_Sb\XINT_float_Wa }%
    \fi #1%
}%
\def\XINT_float_Sb #1#2\Z #3#4%
{%
    \expandafter\XINT_float_T\expandafter
    {\the\numexpr #4+\xint_c_i\expandafter}%
    \romannumeral-`0\XINT_lenrord_loop 0{}#2\Z\W\W\W\W\W\W\W\Z #1{#3}{#4}%
}%
\def\XINT_float_T #1#2#3%
{%
    \ifnum #2>#1
      \xint_afterfi{\XINT_float_U\XINT_float_Xb}%
    \else
      \xint_afterfi{\XINT_float_U\XINT_float_Xa #3}%
    \fi
}%
\def\XINT_float_U #1#2%
{%
    \ifnum #2<\xint_c_v
      \expandafter\XINT_float_Va
    \else
      \expandafter\XINT_float_Vb
    \fi #1%
}%
\def\XINT_float_Va #1#2\Z #3%
{%
    \expandafter#1%
    \romannumeral0\expandafter\XINT_float_Wa
    \romannumeral0\XINT_rord_main {}#2%
      \xint_relax
        \xint_undef\xint_undef\xint_undef\xint_undef
        \xint_undef\xint_undef\xint_undef\xint_undef
      \xint_relax \Z
}%
\def\XINT_float_Vb #1#2\Z #3%
{%
    \expandafter #1%
    \romannumeral0\expandafter #3%
    \romannumeral0\XINT_addm_A 0{}1000\W\X\Y\Z #2000\W\X\Y\Z \Z
}%
\def\XINT_float_Wa #1{ #1.}%
\def\XINT_float_Wb #1#2%
    {\if #11\xint_afterfi{ 10.}\else\xint_afterfi{ #1.#2}\fi }%
\def\XINT_float_Xa #1\Z #2#3#4%
{%
    \expandafter\XINT_float_Y\expandafter
    {\the\numexpr #3+#4-#2}{#1}%
}%
\def\XINT_float_Xb #1\Z #2#3#4%
{%
    \expandafter\XINT_float_Y\expandafter
    {\the\numexpr #3+#4+\xint_c_i-#2}{#1}%
}%
\def\XINT_float_Y #1#2{ #2e#1}%
%    \end{macrocode}
% \subsection{\csh{xintFloat:csv}}
% \lverb|1.09a. For use by \xintthefloatexpr.|
%    \begin{macrocode}
\def\xintFloat:csv #1{\expandafter\XINT_float:_a\romannumeral-`0#1,,^}%
\def\XINT_float:_a {\XINT_float:_b {}}%
\def\XINT_float:_b #1#2,%
             {\expandafter\XINT_float:_c\romannumeral-`0#2,{#1}}%
\def\XINT_float:_c #1{\if #1,\expandafter\XINT_float:_f
                      \else\expandafter\XINT_float:_d\fi #1}%
\def\XINT_float:_d #1,%
         {\expandafter\XINT_float:_e\romannumeral0\xintfloat {#1},}%
\def\XINT_float:_e #1,#2{\XINT_float:_b {#2,#1}}%
\def\XINT_float:_f ,#1#2^{\xint_gobble_i #1}% 
%    \end{macrocode}
% \subsection{\csh{XINT\_inFloat}}
% \lverb|1.07. Completely rewritten in 1.08a for immensely greater efficiency
% when the 
% power of ten is big: previous version had some very serious bottlenecks
% arising from the creation of long strings of zeros, which made things such as
% 2^999999 completely impossible, but now even 2^999999999 with 24 significant
% digits is no problem! Again (slightly) improved in 1.08b. 
%
% For convenience in xintexpr.sty (special r\^ole of the underscore in
% \xintNewExpr)  1.09a adds \XINTinFloat. I also decide in 1.09a not to use
% anymore \romannumeral`-0 mais \romannumeral0 in the float routines, for
% consistency of style.
% | 
%    \begin{macrocode}
\def\XINTinFloat {\romannumeral0\XINT_inFloat }%
\def\XINT_inFloat [#1]#2%
{%
    \expandafter\XINT_infloat_a\expandafter 
    {\the\numexpr #1\expandafter}%
    \romannumeral0\XINT_infrac {#2}\XINT_infloat_Q
}%
\def\XINT_infloat_a #1#2#3% #1=P, #2=n, #3=A, #4=B
{%
    \XINT_infloat_fork #3\Z {#1}{#2}% #1 = precision, #2=n
}%
\def\XINT_infloat_fork #1%
{%
    \xint_UDzerominusfork
     #1-\dummy  \XINT_infloat_zero
     0#1\dummy  \XINT_infloat_J
      0-\dummy  {\XINT_float_K #1}%
    \krof
}%
\def\XINT_infloat_zero #1\Z #2#3#4#5{ 0[0]}%
\def\XINT_infloat_J {\expandafter-\romannumeral0\XINT_float_K }%
\def\XINT_infloat_Q #1%
{%
    \ifnum #1<\xint_c_
      \expandafter\XINT_infloat_Ri
    \else
      \expandafter\XINT_infloat_Rii
    \fi {#1}%
}%
\def\XINT_infloat_Ri #1#2#3%
{%
    \expandafter\XINT_infloat_S\expandafter
    {\romannumeral0\xintiquo {#2}%
         {\XINT_dsx_addzerosnofuss {-#1}{#3}}}{#1}%
}%
\def\XINT_infloat_Rii #1#2#3%
{%
    \expandafter\XINT_infloat_S\expandafter
    {\romannumeral0\xintiquo
         {\XINT_dsx_addzerosnofuss {#1}{#2}}{#3}}{#1}%
}%
\def\XINT_infloat_S #1#2#3%
{%
    \expandafter\XINT_infloat_T\expandafter
    {\the\numexpr #3+\xint_c_i\expandafter}%
    \romannumeral-`0\XINT_lenrord_loop 0{}#1\Z\W\W\W\W\W\W\W\Z
    {#2}%
}%
\def\XINT_infloat_T #1#2#3%
{%
    \ifnum #2>#1
      \xint_afterfi{\XINT_infloat_U\XINT_infloat_Wb}%
    \else
      \xint_afterfi{\XINT_infloat_U\XINT_infloat_Wa #3}%
    \fi
}%
\def\XINT_infloat_U #1#2%
{%
    \ifnum #2<\xint_c_v
      \expandafter\XINT_infloat_Va
    \else
      \expandafter\XINT_infloat_Vb
    \fi #1%
}%
\def\XINT_infloat_Va #1#2\Z
{%
    \expandafter#1%
    \romannumeral0\XINT_rord_main {}#2%
      \xint_relax
        \xint_undef\xint_undef\xint_undef\xint_undef
        \xint_undef\xint_undef\xint_undef\xint_undef
      \xint_relax \Z
}%
\def\XINT_infloat_Vb #1#2\Z
{%
    \expandafter #1%
    \romannumeral0\XINT_addm_A 0{}1000\W\X\Y\Z #2000\W\X\Y\Z \Z
}%
\def\XINT_infloat_Wa #1\Z #2#3%
{%
    \expandafter\XINT_infloat_X\expandafter
    {\the\numexpr #3+\xint_c_i-#2}{#1}%
}%
\def\XINT_infloat_Wb #1\Z #2#3%
{%
    \expandafter\XINT_infloat_X\expandafter
    {\the\numexpr #3+\xint_c_ii-#2}{#1}%
}%
\def\XINT_infloat_X #1#2{ #2[#1]}%
%    \end{macrocode}
% \subsection{\csh{xintAdd}}
%    \begin{macrocode}
\def\xintAdd {\romannumeral0\xintadd }%
\def\xintadd #1%
{%
    \expandafter\xint_fadd\expandafter {\romannumeral0\XINT_infrac {#1}}%
}%
\def\xint_fadd #1#2{\expandafter\XINT_fadd_A\romannumeral0\XINT_infrac{#2}#1}%
\def\XINT_fadd_A #1#2#3#4%
{%
    \ifnum #4 > #1
       \xint_afterfi {\XINT_fadd_B {#1}}%
    \else
       \xint_afterfi {\XINT_fadd_B {#4}}%
    \fi
    {#1}{#4}{#2}{#3}%
}%
\def\XINT_fadd_B #1#2#3#4#5#6#7%
{%
    \expandafter\XINT_fadd_C\expandafter
    {\romannumeral0\xintiimul {#7}{#5}}%
    {\romannumeral0\xintiiadd
    {\romannumeral0\xintiimul {\xintDSH {\the\numexpr -#3+#1\relax}{#6}}{#5}}%
    {\romannumeral0\xintiimul {#7}{\xintDSH {\the\numexpr -#2+#1\relax}{#4}}}%
    }%
    {#1}%
}%
\def\XINT_fadd_C #1#2#3%
{%
    \expandafter\XINT_fadd_D\expandafter {#2}{#3}{#1}%
}%
\def\XINT_fadd_D #1#2{\XINT_outfrac {#2}{#1}}%
%    \end{macrocode}
% \subsection{\csh{xintSub}}
%    \begin{macrocode}
\def\xintSub {\romannumeral0\xintsub }%
\def\xintsub #1%
{%
    \expandafter\xint_fsub\expandafter {\romannumeral0\XINT_infrac {#1}}%
}%
\def\xint_fsub #1#2%
   {\expandafter\XINT_fsub_A\romannumeral0\XINT_infrac {#2}#1}%
\def\XINT_fsub_A #1#2#3#4%
{%
    \ifnum #4 > #1
       \xint_afterfi {\XINT_fsub_B {#1}}%
    \else
       \xint_afterfi {\XINT_fsub_B {#4}}%
    \fi
    {#1}{#4}{#2}{#3}%
}%
\def\XINT_fsub_B #1#2#3#4#5#6#7%
{%
    \expandafter\XINT_fsub_C\expandafter
    {\romannumeral0\xintiimul {#7}{#5}}%
    {\romannumeral0\xintiisub
    {\romannumeral0\xintiimul {\xintDSH {\the\numexpr -#3+#1\relax}{#6}}{#5}}%
    {\romannumeral0\xintiimul {#7}{\xintDSH {\the\numexpr -#2+#1\relax}{#4}}}%
    }%
    {#1}%
}%
\def\XINT_fsub_C #1#2#3%
{%
    \expandafter\XINT_fsub_D\expandafter {#2}{#3}{#1}%
}%
\def\XINT_fsub_D #1#2{\XINT_outfrac {#2}{#1}}%
%    \end{macrocode}
% \subsection{\csh{xintSum}, \csh{xintSumExpr}}
%    \begin{macrocode}
\def\xintSum {\romannumeral0\xintsum }%
\def\xintsum #1{\xintsumexpr #1\relax }%
\def\xintSumExpr {\romannumeral0\xintsumexpr }%
\def\xintsumexpr {\expandafter\XINT_fsumexpr\romannumeral-`0}%
\def\XINT_fsumexpr {\XINT_fsum_loop_a {0/1[0]}}%
\def\XINT_fsum_loop_a #1#2%
{%
    \expandafter\XINT_fsum_loop_b \romannumeral-`0#2\Z {#1}%
}%
\def\XINT_fsum_loop_b #1%
{%
    \xint_gob_til_relax #1\XINT_fsum_finished\relax
    \XINT_fsum_loop_c #1%
}%
\def\XINT_fsum_loop_c #1\Z #2%
{%
    \expandafter\XINT_fsum_loop_a\expandafter{\romannumeral0\xintadd {#2}{#1}}%
}%
\def\XINT_fsum_finished #1\Z #2{ #2}%
%    \end{macrocode}
% \subsection{\csh{xintSum:csv}}
% \lverb|1.09a. For use by \xintexpr.|
%    \begin{macrocode}
\def\xintSum:csv #1{\expandafter\XINT_sum:_a\romannumeral-`0#1,,^}%
\def\XINT_sum:_a {\XINT_sum:_b {0/1[0]}}%
\def\XINT_sum:_b #1#2,{\expandafter\XINT_sum:_c\romannumeral-`0#2,{#1}}%
\def\XINT_sum:_c #1{\if #1,\expandafter\XINT_sum:_e
                      \else\expandafter\XINT_sum:_d\fi #1}%
\def\XINT_sum:_d #1,#2{\expandafter\XINT_sum:_b\expandafter
                        {\romannumeral0\xintadd {#2}{#1}}}%
\def\XINT_sum:_e  ,#1#2^{#1}% allows empty list
%    \end{macrocode}
% \subsection{\csh{xintMul}}
%    \begin{macrocode}
\def\xintMul {\romannumeral0\xintmul }%
\def\xintmul #1%
{%
    \expandafter\xint_fmul\expandafter {\romannumeral0\XINT_infrac {#1}}%
}%
\def\xint_fmul #1#2%
   {\expandafter\XINT_fmul_A\romannumeral0\XINT_infrac {#2}#1}%
\def\XINT_fmul_A #1#2#3#4#5#6%
{%
    \expandafter\XINT_fmul_B
    \expandafter{\the\numexpr #1+#4\expandafter}%
    \expandafter{\romannumeral0\xintiimul {#6}{#3}}%
    {\romannumeral0\xintiimul {#5}{#2}}%
}%
\def\XINT_fmul_B #1#2#3%
{%
    \expandafter \XINT_fmul_C \expandafter{#3}{#1}{#2}%
}%
\def\XINT_fmul_C #1#2{\XINT_outfrac {#2}{#1}}%
%    \end{macrocode}
% \subsection{\csh{xintSqr}}
%    \begin{macrocode}
\def\xintSqr {\romannumeral0\xintsqr }%
\def\xintsqr #1%
{%
    \expandafter\xint_fsqr\expandafter{\romannumeral0\XINT_infrac {#1}}%
}%
\def\xint_fsqr #1{\XINT_fmul_A #1#1}%
%    \end{macrocode}
% \subsection{\csh{xintPow}}
% \lverb|&
% Modified in 1.06 to give the exponent to a \numexpr.$\
% With 1.07 and for use within the \xintexpr parser, we must allow
% fractions (which are integers in disguise) as input to the exponent, so we
% must have a variant which uses \xintNum and not only \numexpr
% for normalizing the input. Hence the \xintfPow here. 1.08b: well actually I
% think that with xintfrac.sty loaded the exponent should always be allowed to
% be a fraction giving an integer. So I do as for \xintFac, and remove here the
% duplicated. The \xintexpr can thus use directly \xintPow.| 
%    \begin{macrocode}
\def\xintPow {\romannumeral0\xintpow }%
\def\xintpow #1%
{%
    \expandafter\xint_fpow\expandafter {\romannumeral0\XINT_infrac {#1}}%
}%
\def\xint_fpow #1#2%
{%
    \expandafter\XINT_fpow_fork\the\numexpr \xintNum{#2}\relax\Z #1%
}%
\def\XINT_fpow_fork #1#2\Z
{%
    \xint_UDzerominusfork
      #1-\dummy  \XINT_fpow_zero
      0#1\dummy  \XINT_fpow_neg
       0-\dummy  {\XINT_fpow_pos #1}%
    \krof
    {#2}%
}%
\def\XINT_fpow_zero #1#2#3#4%
{%
    \space 1/1[0]%
}%
\def\XINT_fpow_pos #1#2#3#4#5%
{%
    \expandafter\XINT_fpow_pos_A\expandafter
    {\the\numexpr #1#2*#3\expandafter}\expandafter
    {\romannumeral0\xintipow {#5}{#1#2}}%
    {\romannumeral0\xintipow {#4}{#1#2}}%
}%
\def\XINT_fpow_neg #1#2#3#4%
{%
    \expandafter\XINT_fpow_pos_A\expandafter
    {\the\numexpr -#1*#2\expandafter}\expandafter
    {\romannumeral0\xintipow {#3}{#1}}%
    {\romannumeral0\xintipow {#4}{#1}}%
}%
\def\XINT_fpow_pos_A #1#2#3%
{%
    \expandafter\XINT_fpow_pos_B\expandafter {#3}{#1}{#2}%
}%
\def\XINT_fpow_pos_B #1#2{\XINT_outfrac {#2}{#1}}%
%    \end{macrocode}
% \subsection{\csh{xintFac}}
% \lverb|1.07: to be used by the \xintexpr scanner which needs to be able to
% apply \xintFac
% to a fraction which is an integer in disguise; so we use \xintNum and not only
% \numexpr. Je modifie cela dans 1.08b, au lieu d'avoir un \xintfFac
% spécialement pour \xintexpr, tout simplement j'étends \xintFac comme les
% autres macros, pour qu'elle utilise \xintNum. | 
%    \begin{macrocode}
\def\xintFac {\romannumeral0\xintfac }%
\def\xintfac #1%
{%
    \expandafter\XINT_fac_fork\expandafter{\the\numexpr \xintNum{#1}}%
}%
%    \end{macrocode}
% \subsection{\csh{xintPrd}, \csh{xintPrdExpr}}
%    \begin{macrocode}
\def\xintPrd {\romannumeral0\xintprd }%
\def\xintprd #1{\xintprdexpr #1\relax }%
\def\xintPrdExpr {\romannumeral0\xintprdexpr }%
\def\xintprdexpr {\expandafter\XINT_fprdexpr \romannumeral-`0}%
\def\XINT_fprdexpr {\XINT_fprod_loop_a {1/1[0]}}%
\def\XINT_fprod_loop_a #1#2%
{%
    \expandafter\XINT_fprod_loop_b \romannumeral-`0#2\Z {#1}%
}%
\def\XINT_fprod_loop_b #1%
{%
    \xint_gob_til_relax #1\XINT_fprod_finished\relax
    \XINT_fprod_loop_c #1%
}%
\def\XINT_fprod_loop_c #1\Z #2%
{%
  \expandafter\XINT_fprod_loop_a\expandafter{\romannumeral0\xintmul {#1}{#2}}%
}%
\def\XINT_fprod_finished #1\Z #2{ #2}%
%    \end{macrocode}
% \subsection{\csh{xintPrd:csv}}
% \lverb|1.09a. For use by \xintexpr.|
%    \begin{macrocode}
\def\xintPrd:csv #1{\expandafter\XINT_prd:_a\romannumeral-`0#1,,^}%
\def\XINT_prd:_a {\XINT_prd:_b {1/1[0]}}%
\def\XINT_prd:_b #1#2,{\expandafter\XINT_prd:_c\romannumeral-`0#2,{#1}}%
\def\XINT_prd:_c #1{\if #1,\expandafter\XINT_prd:_e
                      \else\expandafter\XINT_prd:_d\fi #1}%
\def\XINT_prd:_d #1,#2{\expandafter\XINT_prd:_b\expandafter
                        {\romannumeral0\xintmul {#2}{#1}}}%
\def\XINT_prd:_e  ,#1#2^{#1}% allows empty list
%    \end{macrocode}
% \subsection{\csh{xintDiv}}
%    \begin{macrocode}
\def\xintDiv {\romannumeral0\xintdiv }%
\def\xintdiv #1%
{%
    \expandafter\xint_fdiv\expandafter {\romannumeral0\XINT_infrac {#1}}%
}%
\def\xint_fdiv #1#2%
   {\expandafter\XINT_fdiv_A\romannumeral0\XINT_infrac {#2}#1}%
\def\XINT_fdiv_A #1#2#3#4#5#6%
{%
    \expandafter\XINT_fdiv_B
    \expandafter{\the\numexpr #4-#1\expandafter}%
    \expandafter{\romannumeral0\xintiimul {#2}{#6}}%
    {\romannumeral0\xintiimul {#3}{#5}}%
}%
\def\XINT_fdiv_B #1#2#3%
{%
    \expandafter\XINT_fdiv_C
    \expandafter{#3}{#1}{#2}%
}%
\def\XINT_fdiv_C #1#2{\XINT_outfrac {#2}{#1}}%
%    \end{macrocode}
% \subsection{\csh{xintIsOne}}
% \lverb|&
% New with 1.09a. Could be more efficient. For fractions with big powers of
% tens, it is better to use \xintCmp{f}{1}.| 
%    \begin{macrocode}
\def\xintIsOne {\romannumeral0\xintisone }%
\def\xintisone #1{\expandafter\XINT_fracisone
                \romannumeral0\xintrawwithzeros{#1}\Z }%
\def\XINT_fracisone #1/#2\Z{\xintsgnfork{\XINT_Cmp {#1}{#2}}{0}{1}{0}}%
%    \end{macrocode}
% \subsection{\csh{xintGeq}}
% \lverb|&
% Rewritten completely in 1.08a to be less dumb when comparing fractions having
% big powers of tens.|
%    \begin{macrocode}
\def\xintGeq {\romannumeral0\xintgeq }%
\def\xintgeq #1%
{%
    \expandafter\xint_fgeq\expandafter {\romannumeral0\xintabs {#1}}%
}%
\def\xint_fgeq #1#2%
{%
    \expandafter\XINT_fgeq_A \romannumeral0\xintabs {#2}#1%
}%
\def\XINT_fgeq_A #1%
{%
    \xint_gob_til_zero #1\XINT_fgeq_Zii 0%
    \XINT_fgeq_B #1%
}%
\def\XINT_fgeq_Zii 0\XINT_fgeq_B #1[#2]#3[#4]{ 1}%
\def\XINT_fgeq_B #1/#2[#3]#4#5/#6[#7]%
{%
    \xint_gob_til_zero #4\XINT_fgeq_Zi 0%
    \expandafter\XINT_fgeq_C\expandafter
    {\the\numexpr #7-#3\expandafter}\expandafter
    {\romannumeral0\xintiimul {#4#5}{#2}}%
    {\romannumeral0\xintiimul {#6}{#1}}%
}%
\def\XINT_fgeq_Zi 0#1#2#3#4#5#6#7{ 0}%
\def\XINT_fgeq_C #1#2#3%
{%
    \expandafter\XINT_fgeq_D\expandafter
    {#3}{#1}{#2}%
}%
\def\XINT_fgeq_D #1#2#3%
{%
    \xintSgnFork
    {\xintiSgn{\the\numexpr #2+\xintLength{#3}-\xintLength{#1}\relax}}%
    { 0}{\XINT_fgeq_E #2\Z {#3}{#1}}{ 1}%
}%
\def\XINT_fgeq_E #1%
{%
    \xint_UDsignfork
        #1\dummy  \XINT_fgeq_Fd
         -\dummy {\XINT_fgeq_Fn #1}%
    \krof
}%
\def\XINT_fgeq_Fd #1\Z #2#3%
{%
    \expandafter\XINT_fgeq_Fe\expandafter
    {\romannumeral0\XINT_dsx_addzerosnofuss {#1}{#3}}{#2}%
}%
\def\XINT_fgeq_Fe #1#2{\XINT_geq_pre {#2}{#1}}%
\def\XINT_fgeq_Fn #1\Z #2#3%
{%
    \expandafter\XINT_geq_pre\expandafter 
    {\romannumeral0\XINT_dsx_addzerosnofuss {#1}{#2}}{#3}%
}%
%    \end{macrocode}
% \subsection{\csh{xintMax}}
% \lverb|&
% Rewritten completely in 1.08a.|
%    \begin{macrocode}
\def\xintMax {\romannumeral0\xintmax }%
\def\xintmax #1%
{%
    \expandafter\xint_fmax\expandafter {\romannumeral0\xintraw {#1}}%
}%
\def\xint_fmax #1#2%
{%
    \expandafter\XINT_fmax_A\romannumeral0\xintraw {#2}#1%
}%
\def\XINT_fmax_A #1#2/#3[#4]#5#6/#7[#8]%
{%
    \xint_UDsignsfork
      #1#5\dummy \XINT_fmax_minusminus
       -#5\dummy \XINT_fmax_firstneg
       #1-\dummy \XINT_fmax_secondneg
        --\dummy \XINT_fmax_nonneg_a
    \krof
    #1#5{#2/#3[#4]}{#6/#7[#8]}%
}%
\def\XINT_fmax_minusminus --%
   {\expandafter\xint_minus_andstop\romannumeral0\XINT_fmin_nonneg_b }%
\def\XINT_fmax_firstneg #1-#2#3{ #1#2}%
\def\XINT_fmax_secondneg -#1#2#3{ #1#3}%
\def\XINT_fmax_nonneg_a #1#2#3#4%
{%
    \XINT_fmax_nonneg_b {#1#3}{#2#4}%
}%
\def\XINT_fmax_nonneg_b #1#2%
{%
    \ifcase\romannumeral0\XINT_fgeq_A #1#2
        \xint_afterfi{ #1}%
    \or \xint_afterfi{ #2}%
    \fi
}%
%    \end{macrocode}
% \subsection{\csh{xintMaxof}}
% \lverb|\xintMaxof:csv is for private use in \xintexpr. Even with only one
% argument, there does not seem to be really a motive for using \xintraw.|
%    \begin{macrocode}
\def\xintMaxof      {\romannumeral0\xintmaxof }%
\def\xintmaxof    #1{\expandafter\XINT_maxof_a\romannumeral-`0#1\relax }%
\def\XINT_maxof_a #1{\expandafter\XINT_maxof_b\romannumeral0\xintraw{#1}\Z }%
\def\XINT_maxof_b #1\Z #2%
           {\expandafter\XINT_maxof_c\romannumeral-`0#2\Z {#1}\Z}%
\def\XINT_maxof_c #1%
           {\xint_gob_til_relax #1\XINT_maxof_e\relax\XINT_maxof_d #1}%
\def\XINT_maxof_d #1\Z 
           {\expandafter\XINT_maxof_b\romannumeral0\xintmax {#1}}%
\def\XINT_maxof_e #1\Z #2\Z { #2}%
%    \end{macrocode}
% \subsection{\csh{xintMaxof:csv}}
% \lverb|1.09a. For use by \xintexpr.|
%    \begin{macrocode}
\def\xintMaxof:csv #1{\expandafter\XINT_maxof:_b\romannumeral-`0#1,,}%
\def\XINT_maxof:_b #1,#2,{\expandafter\XINT_maxof:_c\romannumeral-`0#2,{#1},}%
\def\XINT_maxof:_c #1{\if #1,\expandafter\XINT_maxof:_e
                       \else\expandafter\XINT_maxof:_d\fi #1}%
\def\XINT_maxof:_d #1,{\expandafter\XINT_maxof:_b\romannumeral0\xintmax {#1}}%
\def\XINT_maxof:_e ,#1,{#1}%
%    \end{macrocode}
% \subsection{\csh{xintFloatMaxof}}
% \lverb|1.09a, for use by \xintNewFloatExpr.|
%    \begin{macrocode}
\def\xintFloatMaxof      {\romannumeral0\xintflmaxof }%
\def\xintflmaxof    #1{\expandafter\XINT_flmaxof_a\romannumeral-`0#1\relax }%
\def\XINT_flmaxof_a #1{\expandafter\XINT_flmaxof_b
                       \romannumeral0\XINT_inFloat [\XINTdigits]{#1}\Z }%
\def\XINT_flmaxof_b #1\Z #2%
           {\expandafter\XINT_flmaxof_c\romannumeral-`0#2\Z {#1}\Z}%
\def\XINT_flmaxof_c #1%
           {\xint_gob_til_relax #1\XINT_flmaxof_e\relax\XINT_flmaxof_d #1}%
\def\XINT_flmaxof_d #1\Z 
           {\expandafter\XINT_flmaxof_b\romannumeral0\xintmax
                         {\XINTinFloat [\XINTdigits]{#1}}}%
\def\XINT_flmaxof_e #1\Z #2\Z { #2}%
%    \end{macrocode}
% \subsection{\csh{xintFloatMaxof:csv}}
% \lverb|1.09a. For use by \xintfloatexpr.|
%    \begin{macrocode}
\def\xintFloatMaxof:csv #1{\expandafter\XINT_flmaxof:_a\romannumeral-`0#1,,}%
\def\XINT_flmaxof:_a #1,{\expandafter\XINT_flmaxof:_b
                         \romannumeral0\XINT_inFloat [\XINTdigits]{#1},}%
\def\XINT_flmaxof:_b #1,#2,%
      {\expandafter\XINT_flmaxof:_c\romannumeral-`0#2,{#1},}%
\def\XINT_flmaxof:_c #1{\if #1,\expandafter\XINT_flmaxof:_e
                       \else\expandafter\XINT_flmaxof:_d\fi #1}%
\def\XINT_flmaxof:_d #1,%
      {\expandafter\XINT_flmaxof:_b\romannumeral0\xintmax 
                   {\XINTinFloat [\XINTdigits]{#1}}}%
\def\XINT_flmaxof:_e ,#1,{#1}%
%    \end{macrocode}
% \subsection{\csh{xintMin}}
% \lverb|&
% Rewritten completely in 1.08a.|
%    \begin{macrocode}
\def\xintMin {\romannumeral0\xintmin }%
\def\xintmin #1%
{%
    \expandafter\xint_fmin\expandafter {\romannumeral0\xintraw {#1}}%
}%
\def\xint_fmin #1#2%
{%
    \expandafter\XINT_fmin_A\romannumeral0\xintraw {#2}#1%
}%
\def\XINT_fmin_A #1#2/#3[#4]#5#6/#7[#8]%
{%
    \xint_UDsignsfork
      #1#5\dummy \XINT_fmin_minusminus
       -#5\dummy \XINT_fmin_firstneg
       #1-\dummy \XINT_fmin_secondneg
        --\dummy \XINT_fmin_nonneg_a
    \krof
    #1#5{#2/#3[#4]}{#6/#7[#8]}%
}%
\def\XINT_fmin_minusminus --%
   {\expandafter\xint_minus_andstop\romannumeral0\XINT_fmax_nonneg_b }%
\def\XINT_fmin_firstneg #1-#2#3{ -#3}%
\def\XINT_fmin_secondneg -#1#2#3{ -#2}%
\def\XINT_fmin_nonneg_a #1#2#3#4%
{%
    \XINT_fmin_nonneg_b {#1#3}{#2#4}%
}%
\def\XINT_fmin_nonneg_b #1#2%
{%
    \ifcase\romannumeral0\XINT_fgeq_A #1#2
        \xint_afterfi{ #2}%
    \or \xint_afterfi{ #1}%
    \fi
}%
%    \end{macrocode}
% \subsection{\csh{xintMinof}}
%    \begin{macrocode}
\def\xintMinof      {\romannumeral0\xintminof }%
\def\xintminof    #1{\expandafter\XINT_minof_a\romannumeral-`0#1\relax }%
\def\XINT_minof_a #1{\expandafter\XINT_minof_b\romannumeral0\xintraw{#1}\Z }%
\def\XINT_minof_b #1\Z #2%
           {\expandafter\XINT_minof_c\romannumeral-`0#2\Z {#1}\Z}%
\def\XINT_minof_c #1%
           {\xint_gob_til_relax #1\XINT_minof_e\relax\XINT_minof_d #1}%
\def\XINT_minof_d #1\Z 
           {\expandafter\XINT_minof_b\romannumeral0\xintmin {#1}}%
\def\XINT_minof_e #1\Z #2\Z { #2}%
%    \end{macrocode}
% \subsection{\csh{xintMinof:csv}}
% \lverb|1.09a. For use by \xintexpr.|
%    \begin{macrocode}
\def\xintMinof:csv #1{\expandafter\XINT_minof:_b\romannumeral-`0#1,,}%
\def\XINT_minof:_b #1,#2,{\expandafter\XINT_minof:_c\romannumeral-`0#2,{#1},}%
\def\XINT_minof:_c #1{\if #1,\expandafter\XINT_minof:_e
                       \else\expandafter\XINT_minof:_d\fi #1}%
\def\XINT_minof:_d #1,{\expandafter\XINT_minof:_b\romannumeral0\xintmin {#1}}%
\def\XINT_minof:_e ,#1,{#1}%
%    \end{macrocode}
% \subsection{\csh{xintFloatMinof}}
% \lverb|1.09a, for use by \xintNewFloatExpr.|
%    \begin{macrocode}
\def\xintFloatMinof      {\romannumeral0\xintflminof }%
\def\xintflminof    #1{\expandafter\XINT_flminof_a\romannumeral-`0#1\relax }%
\def\XINT_flminof_a #1{\expandafter\XINT_flminof_b
                       \romannumeral0\XINT_inFloat [\XINTdigits]{#1}\Z }%
\def\XINT_flminof_b #1\Z #2%
           {\expandafter\XINT_flminof_c\romannumeral-`0#2\Z {#1}\Z}%
\def\XINT_flminof_c #1%
           {\xint_gob_til_relax #1\XINT_flminof_e\relax\XINT_flminof_d #1}%
\def\XINT_flminof_d #1\Z 
           {\expandafter\XINT_flminof_b\romannumeral0\xintmin
                         {\XINTinFloat [\XINTdigits]{#1}}}%
\def\XINT_flminof_e #1\Z #2\Z { #2}%
%    \end{macrocode}
% \subsection{\csh{xintFloatMinof:csv}}
% \lverb|1.09a. For use by \xintfloatexpr.|
%    \begin{macrocode}
\def\xintFloatMinof:csv #1{\expandafter\XINT_flminof:_a\romannumeral-`0#1,,}%
\def\XINT_flminof:_a #1,{\expandafter\XINT_flminof:_b
                         \romannumeral0\XINT_inFloat [\XINTdigits]{#1},}%
\def\XINT_flminof:_b #1,#2,%
      {\expandafter\XINT_flminof:_c\romannumeral-`0#2,{#1},}%
\def\XINT_flminof:_c #1{\if #1,\expandafter\XINT_flminof:_e
                       \else\expandafter\XINT_flminof:_d\fi #1}%
\def\XINT_flminof:_d #1,%
      {\expandafter\XINT_flminof:_b\romannumeral0\xintmin 
                   {\XINTinFloat [\XINTdigits]{#1}}}%
\def\XINT_flminof:_e ,#1,{#1}%
%    \end{macrocode}
% \subsection{\csh{xintCmp}}
% \lverb|&
% Rewritten completely in 1.08a to be less dumb when comparing fractions having
% big powers of tens. Incredibly, it seems that 1.08b introduced a bug in
% delimited arguments making the macro just non-functional when one of the input
% was zero! I
% did not detect this until working on release 1.09a, somehow I had not tested
% that 
% \xintCmp just did NOT work! I must have done some last minute change... |
%    \begin{macrocode}
\def\xintCmp {\romannumeral0\xintcmp }%
\def\xintcmp #1%
{%
    \expandafter\xint_fcmp\expandafter {\romannumeral0\xintraw {#1}}%
}%
\def\xint_fcmp #1#2%
{%
    \expandafter\XINT_fcmp_A\romannumeral0\xintraw {#2}#1%
}%
\def\XINT_fcmp_A #1#2/#3[#4]#5#6/#7[#8]%
{%
    \xint_UDsignsfork
      #1#5\dummy \XINT_fcmp_minusminus
       -#5\dummy \XINT_fcmp_firstneg
       #1-\dummy \XINT_fcmp_secondneg
        --\dummy \XINT_fcmp_nonneg_a
    \krof
    #1#5{#2/#3[#4]}{#6/#7[#8]}%
}%
\def\XINT_fcmp_minusminus --#1#2{\XINT_fcmp_B #2#1}%
\def\XINT_fcmp_firstneg #1-#2#3{ -1}%
\def\XINT_fcmp_secondneg -#1#2#3{ 1}%
\def\XINT_fcmp_nonneg_a #1#2%
{%
    \xint_UDzerosfork
      #1#2\dummy \XINT_fcmp_zerozero
       0#2\dummy \XINT_fcmp_firstzero
       #10\dummy \XINT_fcmp_secondzero
        00\dummy \XINT_fcmp_pos
    \krof
    #1#2%
}%
\def\XINT_fcmp_zerozero   #1#2#3#4{ 0}%  1.08b had some [ and ] here!!!
\def\XINT_fcmp_firstzero  #1#2#3#4{ -1}% incredibly I never saw that until
\def\XINT_fcmp_secondzero #1#2#3#4{ 1}%  preparing 1.09a. 
\def\XINT_fcmp_pos #1#2#3#4%
{%
    \XINT_fcmp_B #1#3#2#4%
}%
\def\XINT_fcmp_B #1/#2[#3]#4/#5[#6]%
{%
    \expandafter\XINT_fcmp_C\expandafter
    {\the\numexpr #6-#3\expandafter}\expandafter
    {\romannumeral0\xintiimul {#4}{#2}}%
    {\romannumeral0\xintiimul {#5}{#1}}%
}%
\def\XINT_fcmp_C #1#2#3%
{%
    \expandafter\XINT_fcmp_D\expandafter
    {#3}{#1}{#2}%
}%
\def\XINT_fcmp_D #1#2#3%
{%
    \xintSgnFork
    {\xintiSgn{\the\numexpr #2+\xintLength{#3}-\xintLength{#1}\relax}}%
    { -1}{\XINT_fcmp_E #2\Z {#3}{#1}}{ 1}%
}%
\def\XINT_fcmp_E #1%
{%
    \xint_UDsignfork
        #1\dummy  \XINT_fcmp_Fd
         -\dummy {\XINT_fcmp_Fn #1}%
    \krof
}%
\def\XINT_fcmp_Fd #1\Z #2#3%
{%
    \expandafter\XINT_fcmp_Fe\expandafter
    {\romannumeral0\XINT_dsx_addzerosnofuss {#1}{#3}}{#2}%
}%
\def\XINT_fcmp_Fe #1#2{\XINT_cmp_pre {#2}{#1}}%
\def\XINT_fcmp_Fn #1\Z #2#3%
{%
    \expandafter\XINT_cmp_pre\expandafter 
    {\romannumeral0\XINT_dsx_addzerosnofuss {#1}{#2}}{#3}%
}%
%    \end{macrocode}
% \subsection{\csh{xintAbs}}
%    \begin{macrocode}
\def\xintAbs {\romannumeral0\xintabs }%
\def\xintabs #1%
{%
    \expandafter\xint_fabs\romannumeral0\XINT_infrac {#1}%
}%
\def\xint_fabs #1#2%
{%
    \expandafter\XINT_outfrac\expandafter 
    {\the\numexpr #1\expandafter}\expandafter
    {\romannumeral0\XINT_abs #2}%
}%
%    \end{macrocode}
% \subsection{\csh{xintOpp}}
%    \begin{macrocode}
\def\xintOpp {\romannumeral0\xintopp }%
\def\xintopp #1%
{%
    \expandafter\xint_fopp\romannumeral0\XINT_infrac {#1}%
}%
\def\xint_fopp #1#2%
{%
    \expandafter\XINT_outfrac\expandafter 
    {\the\numexpr #1\expandafter}\expandafter
    {\romannumeral0\XINT_opp #2}%
}%
%    \end{macrocode}
% \subsection{\csh{xintSgn}}
%    \begin{macrocode}
\def\xintSgn {\romannumeral0\xintsgn }%
\def\xintsgn #1%
{%
    \expandafter\xint_fsgn\romannumeral0\XINT_infrac {#1}%
}%
\def\xint_fsgn #1#2#3{\xintisgn {#2}}%
%    \end{macrocode}
% \subsection{\csh{xintDivision},~\csh{xintQuo},~\csh{xintRem}}
%    \begin{macrocode}
\def\xintDivision {\romannumeral0\xintdivision }%
\def\xintdivision #1%
{%
    \expandafter\xint_xdivision\expandafter{\romannumeral0\xintnum {#1}}%
}%
\def\xint_xdivision #1#2%
{%
    \expandafter\XINT_div_fork\romannumeral0\xintnum {#2}\Z #1\Z 
}%
\def\xintQuo {\romannumeral0\xintquo }%
\def\xintRem {\romannumeral0\xintrem }%
\def\xintquo {\expandafter\xint_firstoftwo_andstop
               \romannumeral0\xintdivision }%
\def\xintrem {\expandafter\xint_secondoftwo_andstop
               \romannumeral0\xintdivision }%
%    \end{macrocode}
% \subsection{\csh{xintFDg},~\csh{xintLDg},~\csh{xintMON},~\csh{xint\-MMON},~\csh{xintOdd}}
%    \begin{macrocode}
\def\xintFDg {\romannumeral0\xintfdg }%
\def\xintfdg #1%
{%
    \expandafter\XINT_fdg\romannumeral0\xintnum {#1}\W\Z
}%
\def\xintLDg {\romannumeral0\xintldg }%
\def\xintldg #1%
{%
    \expandafter\XINT_ldg\expandafter{\romannumeral0\xintnum {#1}}%
}%
\def\xintMON {\romannumeral0\xintmon }%
\def\xintmon #1%
{%
    \ifodd\xintLDg {#1}
        \xint_afterfi{ -1}%
    \else
        \xint_afterfi{ 1}%
    \fi
}%
\def\xintMMON {\romannumeral0\xintmmon }%
\def\xintmmon #1%
{%
    \ifodd\xintLDg {#1}
        \xint_afterfi{ 1}%
    \else
        \xint_afterfi{ -1}%
    \fi
}%
\def\xintOdd {\romannumeral0\xintodd }%
\def\xintodd #1%
{%
    \ifodd\xintLDg{#1}
        \xint_afterfi{ 1}%
    \else
        \xint_afterfi{ 0}%
    \fi
}%
%    \end{macrocode}
% \subsection{\csh{xintFloatAdd}}
% \lverb|1.07|
%    \begin{macrocode}
\def\xintFloatAdd      {\romannumeral0\xintfloatadd }%
\def\xintfloatadd    #1{\XINT_fladd_chkopt \xintfloat #1\Z }%
\def\XINTinFloatAdd   {\romannumeral0\XINTinfloatadd }%
\def\XINTinfloatadd #1{\XINT_fladd_chkopt \XINT_inFloat #1\Z }%
\def\XINT_fladd_chkopt #1#2%
{%
    \ifx [#2\expandafter\XINT_fladd_opt
       \else\expandafter\XINT_fladd_noopt
    \fi  #1#2%
}%
\def\XINT_fladd_noopt #1#2\Z #3%
{%
    #1[\XINTdigits]{\XINT_FL_Add {\XINTdigits+2}{#2}{#3}}%
}%
\def\XINT_fladd_opt #1[\Z #2]#3#4%
{%
    #1[#2]{\XINT_FL_Add {#2+2}{#3}{#4}}%
}%
\def\XINT_FL_Add #1#2%
{%
    \expandafter\XINT_FL_Add_a\expandafter{\the\numexpr #1\expandafter}%
    \expandafter{\romannumeral0\XINT_inFloat [#1]{#2}}%
}%
\def\XINT_FL_Add_a #1#2#3%
{%
    \expandafter\XINT_FL_Add_b\romannumeral0\XINT_inFloat [#1]{#3}#2{#1}%
}%
\def\XINT_FL_Add_b #1%
{%
    \xint_gob_til_zero #1\XINT_FL_Add_zero 0\XINT_FL_Add_c #1%
}%
\def\XINT_FL_Add_c #1[#2]#3%
{%
    \xint_gob_til_zero #3\XINT_FL_Add_zerobis 0\XINT_FL_Add_d #1[#2]#3%
}%
\def\XINT_FL_Add_d #1[#2]#3[#4]#5%
{%
    \xintSgnFork {\ifnum \numexpr #2-#4-#5>1 \expandafter 1%
                  \else\ifnum \numexpr #4-#2-#5>1 
                       \xint_afterfi {\expandafter-\expandafter1}%
                       \else \expandafter\expandafter\expandafter0%
                       \fi
                  \fi}%
    {#3[#4]}{\xintAdd {#1[#2]}{#3[#4]}}{#1[#2]}%
}%
\def\XINT_FL_Add_zero 0\XINT_FL_Add_c 0[0]#1[#2]#3{#1[#2]}%
\def\XINT_FL_Add_zerobis 0\XINT_FL_Add_d #1[#2]0[0]#3{#1[#2]}%
%    \end{macrocode}
% \subsection{\csh{xintFloatSub}}
% \lverb|1.07|
%    \begin{macrocode}
\def\xintFloatSub {\romannumeral0\xintfloatsub }%
\def\xintfloatsub    #1{\XINT_flsub_chkopt \xintfloat #1\Z }%
\def\XINTinFloatSub {\romannumeral0\XINTinfloatsub }%
\def\XINTinfloatsub #1{\XINT_flsub_chkopt \XINT_inFloat #1\Z }%
\def\XINT_flsub_chkopt #1#2%
{%
    \ifx [#2\expandafter\XINT_flsub_opt
       \else\expandafter\XINT_flsub_noopt
    \fi  #1#2%
}%
\def\XINT_flsub_noopt #1#2\Z #3%
{%
    #1[\XINTdigits]{\XINT_FL_Add {\XINTdigits+2}{#2}{\xintOpp{#3}}}%
}%
\def\XINT_flsub_opt #1[\Z #2]#3#4%
{%
    #1[#2]{\XINT_FL_Add {#2+2}{#3}{\xintOpp{#4}}}%
}%
%    \end{macrocode}
% \subsection{\csh{xintFloatMul}}
% \lverb|1.07|
%    \begin{macrocode}
\def\xintFloatMul    {\romannumeral0\xintfloatmul}%
\def\xintfloatmul    #1{\XINT_flmul_chkopt \xintfloat #1\Z }%
\def\XINTinFloatMul {\romannumeral0\XINTinfloatmul }%
\def\XINTinfloatmul #1{\XINT_flmul_chkopt \XINT_inFloat #1\Z }%
\def\XINT_flmul_chkopt #1#2%
{%
    \ifx [#2\expandafter\XINT_flmul_opt
       \else\expandafter\XINT_flmul_noopt
    \fi  #1#2%
}%
\def\XINT_flmul_noopt #1#2\Z #3%
{%
    #1[\XINTdigits]{\XINT_FL_Mul {\XINTdigits+2}{#2}{#3}}%
}%
\def\XINT_flmul_opt #1[\Z #2]#3#4%
{%
    #1[#2]{\XINT_FL_Mul {#2+2}{#3}{#4}}%
}%
\def\XINT_FL_Mul #1#2%
{%
    \expandafter\XINT_FL_Mul_a\expandafter{\the\numexpr #1\expandafter}%
    \expandafter{\romannumeral0\XINT_inFloat [#1]{#2}}%
}%
\def\XINT_FL_Mul_a #1#2#3%
{%
    \expandafter\XINT_FL_Mul_b\romannumeral0\XINT_inFloat [#1]{#3}#2%
}%
\def\XINT_FL_Mul_b #1[#2]#3[#4]{\xintE{\xintiiMul {#1}{#3}}{#2+#4}}%
%    \end{macrocode}
% \subsection{\csh{xintFloatDiv}}
% \lverb|1.07|
%    \begin{macrocode}
\def\xintFloatDiv    {\romannumeral0\xintfloatdiv}%
\def\xintfloatdiv    #1{\XINT_fldiv_chkopt \xintfloat #1\Z }%
\def\XINTinFloatDiv  {\romannumeral0\XINTinfloatdiv }%
\def\XINTinfloatdiv  #1{\XINT_fldiv_chkopt \XINT_inFloat #1\Z }%
\def\XINT_fldiv_chkopt #1#2%
{%
    \ifx [#2\expandafter\XINT_fldiv_opt
       \else\expandafter\XINT_fldiv_noopt
    \fi  #1#2%
}%
\def\XINT_fldiv_noopt #1#2\Z #3%
{%
    #1[\XINTdigits]{\XINT_FL_Div {\XINTdigits+2}{#2}{#3}}%
}%
\def\XINT_fldiv_opt #1[\Z #2]#3#4%
{%
    #1[#2]{\XINT_FL_Div {#2+2}{#3}{#4}}%
}%
\def\XINT_FL_Div #1#2%
{%
    \expandafter\XINT_FL_Div_a\expandafter{\the\numexpr #1\expandafter}%
    \expandafter{\romannumeral0\XINT_inFloat [#1]{#2}}%
}%
\def\XINT_FL_Div_a #1#2#3%
{%
    \expandafter\XINT_FL_Div_b\romannumeral0\XINT_inFloat [#1]{#3}#2%
}%
\def\XINT_FL_Div_b #1[#2]#3[#4]{\xintE{#3/#1}{#4-#2}}%
%    \end{macrocode}
% \subsection{\csh{xintFloatSum}}
% \lverb|1.09a: quick write-up, for use by \xintfloatexpr, will need to be
% thought through  again.|
%    \begin{macrocode}
\def\xintFloatSum      {\romannumeral0\xintfloatsum }%
\def\xintfloatsum    #1{\expandafter\XINT_floatsum_a\romannumeral-`0#1\relax }%
\def\XINT_floatsum_a #1{\expandafter\XINT_floatsum_b
                         \romannumeral0\xintraw{#1}\Z }% normalizes if only 1
\def\XINT_floatsum_b #1\Z #2%            but a bit wasteful
           {\expandafter\XINT_floatsum_c\romannumeral-`0#2\Z {#1}\Z}%
\def\XINT_floatsum_c #1%
           {\xint_gob_til_relax #1\XINT_floatsum_e\relax\XINT_floatsum_d #1}%
\def\XINT_floatsum_d #1\Z 
           {\expandafter\XINT_floatsum_b\romannumeral0\XINTinfloatadd {#1}}%
\def\XINT_floatsum_e #1\Z #2\Z { #2}%
%    \end{macrocode}
% \subsection{\csh{xintFloatSum:csv}}
% \lverb|1.09a. For use by \xintfloatexpr.|
%    \begin{macrocode}
\def\xintFloatSum:csv #1{\expandafter\XINT_floatsum:_a\romannumeral-`0#1,,^}%
\def\XINT_floatsum:_a {\XINT_floatsum:_b {0/1[0]}}%
\def\XINT_floatsum:_b #1#2,%
             {\expandafter\XINT_floatsum:_c\romannumeral-`0#2,{#1}}%
\def\XINT_floatsum:_c #1{\if #1,\expandafter\XINT_floatsum:_e
                      \else\expandafter\XINT_floatsum:_d\fi #1}%
\def\XINT_floatsum:_d #1,#2{\expandafter\XINT_floatsum:_b\expandafter
                        {\romannumeral0\XINTinfloatadd {#2}{#1}}}%
\def\XINT_floatsum:_e  ,#1#2^{#1}% allows empty list
%    \end{macrocode}
% \subsection{\csh{xintFloatPrd}}
% \lverb|1.09a: quick write-up, for use by \xintfloatexpr, will need to be
% thought through  again.|
%    \begin{macrocode}
\def\xintFloatPrd      {\romannumeral0\xintfloatprd }%
\def\xintfloatprd    #1{\expandafter\XINT_floatprd_a\romannumeral-`0#1\relax }%
\def\XINT_floatprd_a #1{\expandafter\XINT_floatprd_b
                         \romannumeral0\xintraw{#1}\Z }%
\def\XINT_floatprd_b #1\Z #2%
           {\expandafter\XINT_floatprd_c\romannumeral-`0#2\Z {#1}\Z}%
\def\XINT_floatprd_c #1%
           {\xint_gob_til_relax #1\XINT_floatprd_e\relax\XINT_floatprd_d #1}%
\def\XINT_floatprd_d #1\Z 
           {\expandafter\XINT_floatprd_b\romannumeral0\XINTinfloatmul {#1}}%
\def\XINT_floatprd_e #1\Z #2\Z { #2}%
%    \end{macrocode}
% \subsection{\csh{xintFloatPrd:csv}}
% \lverb|1.09a. For use by \xintfloatexpr.|
%    \begin{macrocode}
\def\xintFloatPrd:csv #1{\expandafter\XINT_floatprd:_a\romannumeral-`0#1,,^}%
\def\XINT_floatprd:_a {\XINT_floatprd:_b {1/1[0]}}%
\def\XINT_floatprd:_b #1#2,%
             {\expandafter\XINT_floatprd:_c\romannumeral-`0#2,{#1}}%
\def\XINT_floatprd:_c #1{\if #1,\expandafter\XINT_floatprd:_e
                      \else\expandafter\XINT_floatprd:_d\fi #1}%
\def\XINT_floatprd:_d #1,#2{\expandafter\XINT_floatprd:_b\expandafter
                        {\romannumeral0\XINTinfloatmul {#2}{#1}}}%
\def\XINT_floatprd:_e  ,#1#2^{#1}% allows empty list
%    \end{macrocode}
% \subsection{\csh{xintFloatPow}}
% \lverb|1.07|
%    \begin{macrocode}
\def\xintFloatPow {\romannumeral0\xintfloatpow}%
\def\xintfloatpow #1{\XINT_flpow_chkopt \xintfloat #1\Z }%
\def\XINTinFloatPow {\romannumeral0\XINTinfloatpow }%
\def\XINTinfloatpow #1{\XINT_flpow_chkopt \XINT_inFloat #1\Z }%
\def\XINT_flpow_chkopt #1#2%
{%
    \ifx [#2\expandafter\XINT_flpow_opt
       \else\expandafter\XINT_flpow_noopt
    \fi
     #1#2%
}%
\def\XINT_flpow_noopt  #1#2\Z #3%
{%
   \expandafter\XINT_flpow_checkB_start\expandafter
                {\the\numexpr #3\expandafter}\expandafter
                {\the\numexpr \XINTdigits}{#2}{#1[\XINTdigits]}%
}%
\def\XINT_flpow_opt #1[\Z #2]#3#4%
{%
   \expandafter\XINT_flpow_checkB_start\expandafter
               {\the\numexpr #4\expandafter}\expandafter
               {\the\numexpr #2}{#3}{#1[#2]}%
}%
\def\XINT_flpow_checkB_start #1{\XINT_flpow_checkB_a #1\Z }%
\def\XINT_flpow_checkB_a #1%
{%
    \xint_UDzerominusfork
      #1-\dummy  \XINT_flpow_BisZero
      0#1\dummy  {\XINT_flpow_checkB_b 1}%
       0-\dummy  {\XINT_flpow_checkB_b 0#1}%
    \krof
}%
\def\XINT_flpow_BisZero \Z #1#2#3{#3{1/1[0]}}%
\def\XINT_flpow_checkB_b #1#2\Z #3%
{%
    \expandafter\XINT_flpow_checkB_c \expandafter
    {\romannumeral0\XINT_length{#2}}{#3}{#2}#1%
}%
\def\XINT_flpow_checkB_c #1#2%
{%
    \expandafter\XINT_flpow_checkB_d \expandafter
    {\the\numexpr \expandafter\XINT_Length\expandafter
                  {\the\numexpr #1*20/3}+#1+#2+1}%
}%
\def\XINT_flpow_checkB_d #1#2#3#4%
{%
    \expandafter \XINT_flpow_a
    \romannumeral0\XINT_inFloat [#1]{#4}{#1}{#2}#3%
}%
\def\XINT_flpow_a #1%
{%
    \xint_UDzerominusfork
      #1-\dummy \XINT_flpow_zero
      0#1\dummy {\XINT_flpow_b 1}%
       0-\dummy {\XINT_flpow_b 0#1}%
    \krof
}%
\def\XINT_flpow_zero [#1]#2#3#4#5%
{%
    \if #41 \xint_afterfi {\xintError:DivisionByZero\space 1.e2147483647}%
    \else \xint_afterfi { 0.e0}\fi
}%
\def\XINT_flpow_b #1#2[#3]#4#5%
{%
    \XINT_flpow_c {#4}{#5}{#2[#3]}{#1*\ifodd #5 1\else 0\fi}%
}%
\def\XINT_flpow_c #1#2#3#4%
{%
    \XINT_flpow_loop {#1}{#2}{#3}{{#1}}\XINT_flpow_prd
      \xint_relax
        \xint_undef\xint_undef\xint_undef\xint_undef
        \xint_undef\xint_undef\xint_undef\xint_undef
      \xint_relax {#4}%
}%
\def\XINT_flpow_loop #1#2#3%
{%
    \ifnum #2 = 1
        \expandafter\XINT_flpow_loop_end 
    \else
        \xint_afterfi{\expandafter\XINT_flpow_loop_a
            \expandafter{\the\numexpr 2*(#2/2)-#2\expandafter }% b mod 2
            \expandafter{\the\numexpr #2-#2/2\expandafter }%     [b/2]
            \expandafter{\romannumeral0\XINTinfloatmul [#1]{#3}{#3}}}%
    \fi
    {#1}{{#3}}%
}%
\def\XINT_flpow_loop_a #1#2#3#4%
{%
    \ifnum #1 = 1
        \expandafter\XINT_flpow_loop
    \else
        \expandafter\XINT_flpow_loop_throwaway
    \fi
    {#4}{#2}{#3}%
}%
\def\XINT_flpow_loop_throwaway #1#2#3#4%
{%
   \XINT_flpow_loop {#1}{#2}{#3}% 
}%
\def\XINT_flpow_loop_end #1{\romannumeral0\XINT_rord_main {}\relax }%
\def\XINT_flpow_prd #1#2%
{%
    \XINT_flpow_prd_getnext {#2}{#1}%
}%
\def\XINT_flpow_prd_getnext #1#2#3%
{%
    \XINT_flpow_prd_checkiffinished #3\Z {#1}{#2}%
}%
\def\XINT_flpow_prd_checkiffinished #1%
{%
    \xint_gob_til_relax #1\XINT_flpow_prd_end\relax 
    \XINT_flpow_prd_compute #1%
}%
\def\XINT_flpow_prd_compute #1\Z #2#3%
{%
    \expandafter\XINT_flpow_prd_getnext\expandafter
    {\romannumeral0\XINTinfloatmul [#3]{#1}{#2}}{#3}%
}%
\def\XINT_flpow_prd_end\relax\XINT_flpow_prd_compute 
    \relax\Z #1#2#3%
{%
    \expandafter\XINT_flpow_conclude \the\numexpr #3\relax #1%
}%
\def\XINT_flpow_conclude #1#2[#3]#4%
{%
    \expandafter\XINT_flpow_conclude_really\expandafter
    {\the\numexpr\if #41 -\fi#3\expandafter}%
    \xint_UDzerofork
        #4\dummy {{#2}}%
         0\dummy {{1/#2}}%
    \krof #1%
}%
\def\XINT_flpow_conclude_really #1#2#3#4%
{%
    \xint_UDzerofork
    #3\dummy {#4{#2[#1]}}%
     0\dummy {#4{-#2[#1]}}%
    \krof
}%
%    \end{macrocode}
% \subsection{\csh{xintFloatPower}}
% \lverb|1.07|
%    \begin{macrocode}
\def\xintFloatPower {\romannumeral0\xintfloatpower}%
\def\xintfloatpower #1{\XINT_flpower_chkopt \xintfloat #1\Z }%
\def\XINTinFloatPower {\romannumeral0\XINTinfloatpower}%
\def\XINTinfloatpower #1{\XINT_flpower_chkopt \XINT_inFloat #1\Z }%
\def\XINT_flpower_chkopt #1#2%
{%
    \ifx [#2\expandafter\XINT_flpower_opt
       \else\expandafter\XINT_flpower_noopt
    \fi
     #1#2%
}%
\def\XINT_flpower_noopt  #1#2\Z #3%
{%
   \expandafter\XINT_flpower_checkB_start\expandafter
                {\the\numexpr \XINTdigits\expandafter}\expandafter
                {\romannumeral0\xintnum{#3}}{#2}{#1[\XINTdigits]}%
}%
\def\XINT_flpower_opt #1[\Z #2]#3#4%
{%
   \expandafter\XINT_flpower_checkB_start\expandafter
               {\the\numexpr #2\expandafter}\expandafter
               {\romannumeral0\xintnum{#4}}{#3}{#1[#2]}%
}%
\def\XINT_flpower_checkB_start #1#2{\XINT_flpower_checkB_a #2\Z {#1}}%
\def\XINT_flpower_checkB_a #1%
{%
    \xint_UDzerominusfork
      #1-\dummy  \XINT_flpower_BisZero
      0#1\dummy  {\XINT_flpower_checkB_b 1}%
       0-\dummy  {\XINT_flpower_checkB_b 0#1}%
    \krof
}%
\def\XINT_flpower_BisZero \Z #1#2#3{#3{1/1[0]}}%
\def\XINT_flpower_checkB_b #1#2\Z #3%
{%
    \expandafter\XINT_flpower_checkB_c \expandafter
    {\romannumeral0\XINT_length{#2}}{#3}{#2}#1%
}%
\def\XINT_flpower_checkB_c #1#2%
{%
    \expandafter\XINT_flpower_checkB_d \expandafter
    {\the\numexpr \expandafter\XINT_Length\expandafter
                  {\the\numexpr #1*20/3}+#1+#2+1}%
}%
\def\XINT_flpower_checkB_d #1#2#3#4%
{%
    \expandafter \XINT_flpower_a
    \romannumeral0\XINT_inFloat [#1]{#4}{#1}{#2}#3%
}%
\def\XINT_flpower_a #1%
{%
    \xint_UDzerominusfork
      #1-\dummy \XINT_flpower_zero
      0#1\dummy {\XINT_flpower_b 1}%
       0-\dummy {\XINT_flpower_b 0#1}%
    \krof
}%
\def\XINT_flpower_zero [#1]#2#3#4#5%
{%
    \if #41 
          \xint_afterfi {\xintError:DivisionByZero\space 1.e2147483647}%
    \else \xint_afterfi { 0.e0}\fi
}%
\def\XINT_flpower_b #1#2[#3]#4#5%
{%
    \XINT_flpower_c {#4}{#5}{#2[#3]}{#1*\xintOdd {#5}}%
}%
\def\XINT_flpower_c #1#2#3#4%
{%
    \XINT_flpower_loop {#1}{#2}{#3}{{#1}}\XINT_flpow_prd
      \xint_relax
        \xint_undef\xint_undef\xint_undef\xint_undef
        \xint_undef\xint_undef\xint_undef\xint_undef
      \xint_relax {#4}%
}%
\def\XINT_flpower_loop #1#2#3%
{%
    \ifcase\XINT_isOne {#2}
        \xint_afterfi{\expandafter\XINT_flpower_loop_x\expandafter
            {\romannumeral0\XINTinfloatmul [#1]{#3}{#3}}%
            {\romannumeral0\xintdivision {#2}{2}}}%
    \or \expandafter\XINT_flpow_loop_end 
    \fi
    {#1}{{#3}}%
}%
\def\XINT_flpower_loop_x #1#2{\expandafter\XINT_flpower_loop_a #2{#1}}%
\def\XINT_flpower_loop_a #1#2#3#4%
{%
    \ifnum #2 = 1
        \expandafter\XINT_flpower_loop
    \else
        \expandafter\XINT_flpower_loop_throwaway
    \fi
    {#4}{#1}{#3}%
}%
\def\XINT_flpower_loop_throwaway #1#2#3#4%
{%
   \XINT_flpower_loop {#1}{#2}{#3}% 
}%
%    \end{macrocode}
% \subsection{\csh{xintFloatSqrt}}
% \lverb|1.08|
%    \begin{macrocode}
\def\xintFloatSqrt     {\romannumeral0\xintfloatsqrt }%
\def\xintfloatsqrt   #1{\XINT_flsqrt_chkopt \xintfloat #1\Z }%
\def\XINTinFloatSqrt   {\romannumeral0\XINTinfloatsqrt }%
\def\XINTinfloatsqrt #1{\XINT_flsqrt_chkopt \XINT_inFloat #1\Z }%
\def\XINT_flsqrt_chkopt #1#2%
{%
    \ifx [#2\expandafter\XINT_flsqrt_opt
       \else\expandafter\XINT_flsqrt_noopt
    \fi  #1#2%
}%
\def\XINT_flsqrt_noopt #1#2\Z
{%
    #1[\XINTdigits]{\XINT_FL_sqrt \XINTdigits {#2}}%
}%
\def\XINT_flsqrt_opt #1[\Z #2]#3%
{%
    #1[#2]{\XINT_FL_sqrt {#2}{#3}}%
}%
\def\XINT_FL_sqrt #1%
{%
    \ifnum\numexpr #1<\xint_c_xviii 
        \xint_afterfi {\XINT_FL_sqrt_a\xint_c_xviii}%
    \else
        \xint_afterfi {\XINT_FL_sqrt_a {#1+\xint_c_i}}%
    \fi
}%
\def\XINT_FL_sqrt_a #1#2%
{%     
    \expandafter\XINT_FL_sqrt_checkifzeroorneg
    \romannumeral0\XINT_inFloat [#1]{#2}%
}%
\def\XINT_FL_sqrt_checkifzeroorneg #1%
{%
    \xint_UDzerominusfork
     #1-\dummy  \XINT_FL_sqrt_iszero
     0#1\dummy  \XINT_FL_sqrt_isneg
      0-\dummy {\XINT_FL_sqrt_b #1}%
    \krof
}%
\def\XINT_FL_sqrt_iszero #1[#2]{0[0]}%
\def\XINT_FL_sqrt_isneg  #1[#2]{\xintError:RootOfNegative 0[0]}%
\def\XINT_FL_sqrt_b #1[#2]%
{%
    \ifodd #2
        \xint_afterfi{\XINT_FL_sqrt_c 01}%
    \else
        \xint_afterfi{\XINT_FL_sqrt_c {}0}%
    \fi
    {#1}{#2}%
}%
\def\XINT_FL_sqrt_c #1#2#3#4%
{%
    \expandafter\XINT_flsqrt\expandafter {\the\numexpr #4-#2}{#3#1}%
}%
\def\XINT_flsqrt #1#2%
{%
    \expandafter\XINT_sqrt_a
    \expandafter{\romannumeral0\XINT_length {#2}}\XINT_flsqrt_big_d {#2}{#1}%
}%
\def\XINT_flsqrt_big_d #1\or #2\fi #3% 
{%
   \fi
   \ifodd #3
     \xint_afterfi{\expandafter\XINT_flsqrt_big_eB}%
   \else
     \xint_afterfi{\expandafter\XINT_flsqrt_big_eA}%
   \fi
   \expandafter {\the\numexpr (#3-\xint_c_i)/\xint_c_ii }{#1}%
}%
\def\XINT_flsqrt_big_eA  #1#2#3%
{%
    \XINT_flsqrt_big_eA_a #3\Z {#2}{#1}{#3}%
}%
\def\XINT_flsqrt_big_eA_a #1#2#3#4#5#6#7#8#9\Z 
{%
    \XINT_flsqrt_big_eA_b {#1#2#3#4#5#6#7#8}%
}%
\def\XINT_flsqrt_big_eA_b #1#2%
{%
    \expandafter\XINT_flsqrt_big_f
    \romannumeral0\XINT_flsqrt_small_e {#2001}{#1}%
}%
\def\XINT_flsqrt_big_eB #1#2#3%
{%
    \XINT_flsqrt_big_eB_a #3\Z {#2}{#1}{#3}%
}%
\def\XINT_flsqrt_big_eB_a #1#2#3#4#5#6#7#8#9%
{%
    \XINT_flsqrt_big_eB_b {#1#2#3#4#5#6#7#8#9}%
}%
\def\XINT_flsqrt_big_eB_b #1#2\Z #3%
{%
    \expandafter\XINT_flsqrt_big_f
    \romannumeral0\XINT_flsqrt_small_e {#30001}{#1}%
}%
\def\XINT_flsqrt_small_e #1#2%
{%
   \expandafter\XINT_flsqrt_small_f\expandafter
   {\the\numexpr #1*#1-#2-\xint_c_i}{#1}%
}%
\def\XINT_flsqrt_small_f #1#2%
{%
   \expandafter\XINT_flsqrt_small_g\expandafter
   {\the\numexpr (#1+#2)/(2*#2)-\xint_c_i }{#1}{#2}%
}%
\def\XINT_flsqrt_small_g #1%
{%
    \ifnum #1>\xint_c_
       \expandafter\XINT_flsqrt_small_h
    \else
       \expandafter\XINT_flsqrt_small_end
    \fi
    {#1}%
}%
\def\XINT_flsqrt_small_h #1#2#3%
{%
    \expandafter\XINT_flsqrt_small_f\expandafter
    {\the\numexpr #2-\xint_c_ii*#1*#3+#1*#1\expandafter}\expandafter
    {\the\numexpr #3-#1}%
}%
\def\XINT_flsqrt_small_end #1#2#3%
{%
    \expandafter\space\expandafter
    {\the\numexpr \xint_c_i+#3*\xint_c_x^iv-
                      (#2*\xint_c_x^iv+#3)/(\xint_c_ii*#3)}%
}%
\def\XINT_flsqrt_big_f #1%
{%
    \expandafter\XINT_flsqrt_big_fa\expandafter 
    {\romannumeral0\xintiisqr {#1}}{#1}%
}%
\def\XINT_flsqrt_big_fa #1#2#3#4%
{%
    \expandafter\XINT_flsqrt_big_fb\expandafter
    {\romannumeral0\XINT_dsx_addzerosnofuss 
                     {\numexpr #3-\xint_c_viii\relax}{#2}}%
    {\romannumeral0\xintiisub
      {\XINT_dsx_addzerosnofuss 
           {\numexpr \xint_c_ii*(#3-\xint_c_viii)\relax}{#1}}{#4}}%
    {#3}%
}%
\def\XINT_flsqrt_big_fb #1#2%
{%
    \expandafter\XINT_flsqrt_big_g\expandafter {#2}{#1}%
}%
\def\XINT_flsqrt_big_g #1#2%
{%
    \expandafter\XINT_flsqrt_big_j
    \romannumeral0\xintidivision
    {#1}{\romannumeral0\XINT_dbl_pos #2\R\R\R\R\R\R\R\Z \W\W\W\W\W\W\W }{#2}%
}%
\def\XINT_flsqrt_big_j #1%
{%
    \ifcase\XINT_Sgn {#1}
        \expandafter \XINT_flsqrt_big_end_a
    \or \expandafter \XINT_flsqrt_big_k
    \fi {#1}%
}%
\def\XINT_flsqrt_big_k #1#2#3%
{%
    \expandafter\XINT_flsqrt_big_l\expandafter
    {\romannumeral0\XINT_sub_pre {#3}{#1}}%
    {\romannumeral0\xintiiadd {#2}{\romannumeral0\XINT_sqr {#1}}}%
}%
\def\XINT_flsqrt_big_l #1#2%
{%
   \expandafter\XINT_flsqrt_big_g\expandafter
   {#2}{#1}%
}%
\def\XINT_flsqrt_big_end_a #1#2#3#4#5%
{%
   \expandafter\XINT_flsqrt_big_end_b\expandafter
   {\the\numexpr -#4+#5/\xint_c_ii\expandafter}\expandafter
   {\romannumeral0\xintiisub 
    {\XINT_dsx_addzerosnofuss {#4}{#3}}%
    {\xintHalf{\xintiQuo{\XINT_dsx_addzerosnofuss {#4}{#2}}{#3}}}}%
}%
\def\XINT_flsqrt_big_end_b #1#2{#2[#1]}%
\XINT_restorecatcodes_endinput%
%    \end{macrocode}
%\catcode`\<=0 \catcode`\>=11 \catcode`\*=11 \catcode`\/=11
%\let</xintfrac>\relax
%\def<*xintseries>{\catcode`\<=12 \catcode`\>=12 \catcode`\*=12 \catcode`\/=12 }
%</xintfrac>
%<*xintseries>
%
% \StoreCodelineNo {xintfrac}
%
% \section{Package \xintseriesname implementation}
% 
% The commenting is currently (\docdate) very sparse.
%
% \localtableofcontents
% \subsection{Catcodes, \protect\eTeX{} and reload detection}
%
% The code for reload detection is copied from \textsc{Heiko
% Oberdiek}'s packages, and adapted here to check for previous
% loading of the \xintfracname package.
%
% The method for catcodes is slightly different, but still
% directly inspired by these packages.
%
%    \begin{macrocode}
\begingroup\catcode61\catcode48\catcode32=10\relax%
  \catcode13=5    % ^^M
  \endlinechar=13 %
  \catcode123=1   % {
  \catcode125=2   % }
  \catcode64=11   % @
  \catcode35=6    % #
  \catcode44=12   % ,
  \catcode45=12   % -
  \catcode46=12   % .
  \catcode58=12   % :
  \def\space { }%
  \let\z\endgroup
  \expandafter\let\expandafter\x\csname ver@xintseries.sty\endcsname
  \expandafter\let\expandafter\w\csname ver@xintfrac.sty\endcsname
  \expandafter
    \ifx\csname PackageInfo\endcsname\relax
      \def\y#1#2{\immediate\write-1{Package #1 Info: #2.}}%
    \else
      \def\y#1#2{\PackageInfo{#1}{#2}}%
    \fi
  \expandafter
  \ifx\csname numexpr\endcsname\relax
     \y{xintseries}{\numexpr not available, aborting input}%
     \aftergroup\endinput
  \else
    \ifx\x\relax   % plain-TeX, first loading of xintseries.sty
      \ifx\w\relax % but xintfrac.sty not yet loaded.
         \y{xintseries}{Package xintfrac is required}%
         \y{xintseries}{Will try \string\input\space xintfrac.sty}%
         \def\z{\endgroup\input xintfrac.sty\relax}%
      \fi
    \else
      \def\empty {}%
      \ifx\x\empty % LaTeX, first loading,
      % variable is initialized, but \ProvidesPackage not yet seen
          \ifx\w\relax % xintfrac.sty not yet loaded.
            \y{xintseries}{Package xintfrac is required}%
            \y{xintseries}{Will try \string\RequirePackage{xintfrac}}%
            \def\z{\endgroup\RequirePackage{xintfrac}}%
          \fi
      \else
        \y{xintseries}{I was already loaded, aborting input}%
        \aftergroup\endinput
      \fi
    \fi
  \fi
\z%
%    \end{macrocode}
% \subsection{Confirmation of \xintfracname loading}
%    \begin{macrocode}
\begingroup\catcode61\catcode48\catcode32=10\relax%
  \catcode13=5    % ^^M
  \endlinechar=13 %
  \catcode123=1   % {
  \catcode125=2   % }
  \catcode64=11   % @
  \catcode35=6    % #
  \catcode44=12   % ,
  \catcode45=12   % -
  \catcode46=12   % .
  \catcode58=12   % :
  \expandafter
    \ifx\csname PackageInfo\endcsname\relax
      \def\y#1#2{\immediate\write-1{Package #1 Info: #2.}}%
    \else
      \def\y#1#2{\PackageInfo{#1}{#2}}%
    \fi
  \def\empty {}%
  \expandafter\let\expandafter\w\csname ver@xintfrac.sty\endcsname
  \ifx\w\relax % Plain TeX, user gave a file name at the prompt
      \y{xintseries}{Loading of package xintfrac failed, aborting input}%
      \aftergroup\endinput
  \fi
  \ifx\w\empty % LaTeX, user gave a file name at the prompt
      \y{xintseries}{Loading of package xintfrac failed, aborting input}%
      \aftergroup\endinput
  \fi
\endgroup%
%    \end{macrocode}
% \subsection{Catcodes}
%    \begin{macrocode}
\XINTsetupcatcodes%
%    \end{macrocode}
% \subsection{Package identification}
%    \begin{macrocode}
\XINT_providespackage
\ProvidesPackage{xintseries}%
  [2013/10/03 v1.09b Expandable partial sums with xint package (jfB)]%
%    \end{macrocode}
% \subsection{\csh{xintSeries}}
% \lverb|&
% Modified in 1.06 to give the indices first to a \numexpr rather than expanding
% twice. I just use \the\numexpr and maintain the previous code after that.
% 1.08a adds the forgotten optimization following that previous change.| 
%    \begin{macrocode}
\def\xintSeries {\romannumeral0\xintseries }%
\def\xintseries #1#2%
{%
    \expandafter\XINT_series\expandafter
    {\the\numexpr #1\expandafter}\expandafter{\the\numexpr #2}%
}%
\def\XINT_series #1#2#3%
{%
   \ifnum #2<#1
      \xint_afterfi { 0/1[0]}%
   \else
      \xint_afterfi {\XINT_series_loop {#1}{0}{#2}{#3}}%
   \fi
}%
\def\XINT_series_loop #1#2#3#4%
{%
    \ifnum #3>#1 \else \XINT_series_exit \fi
    \expandafter\XINT_series_loop\expandafter
    {\the\numexpr #1+1\expandafter }\expandafter
    {\romannumeral0\xintadd {#2}{#4{#1}}}%
    {#3}{#4}%
}%
\def\XINT_series_exit \fi #1#2#3#4#5#6#7#8%
{%
    \fi\xint_gobble_ii #6%
}%
%    \end{macrocode}
% \subsection{\csh{xintiSeries}}
% \lverb|&
% Modified in 1.06 to give the indices first to a \numexpr rather than expanding
% twice. I just use \the\numexpr and maintain the previous code after that.
% 1.08a adds the forgotten optimization following that previous change.| 
%    \begin{macrocode}
\def\xintiSeries {\romannumeral0\xintiseries }%
\def\xintiseries #1#2%
{%
    \expandafter\XINT_iseries\expandafter 
    {\the\numexpr #1\expandafter}\expandafter{\the\numexpr #2}%
}%
\def\XINT_iseries #1#2#3%
{%
   \ifnum #2<#1
      \xint_afterfi { 0}%
   \else
      \xint_afterfi {\XINT_iseries_loop {#1}{0}{#2}{#3}}%
   \fi
}%
\def\XINT_iseries_loop #1#2#3#4%
{%
    \ifnum #3>#1 \else \XINT_iseries_exit \fi
    \expandafter\XINT_iseries_loop\expandafter
    {\the\numexpr #1+1\expandafter }\expandafter
    {\romannumeral0\xintiiadd {#2}{#4{#1}}}%
    {#3}{#4}%
}%
\def\XINT_iseries_exit \fi #1#2#3#4#5#6#7#8%
{%
    \fi\xint_gobble_ii #6%
}%
%    \end{macrocode}
% \subsection{\csh{xintPowerSeries}}
% \lverb|&
% The 1.03 version was very lame and created a build-up of denominators.
% The Horner scheme for polynomial evaluation is used in 1.04, this
% cures the denominator problem and drastically improves the efficiency
% of the macro.
% Modified in 1.06 to give the indices first to a \numexpr rather than expanding
% twice. I just use \the\numexpr and maintain the previous code after that.
% 1.08a adds the forgotten optimization following that previous change.| 
%    \begin{macrocode}
\def\xintPowerSeries {\romannumeral0\xintpowerseries }%
\def\xintpowerseries #1#2%
{%
    \expandafter\XINT_powseries\expandafter 
    {\the\numexpr #1\expandafter}\expandafter{\the\numexpr #2}%
}%
\def\XINT_powseries #1#2#3#4%
{%
   \ifnum #2<#1
      \xint_afterfi { 0/1[0]}%
   \else
      \xint_afterfi
      {\XINT_powseries_loop_i {#3{#2}}{#1}{#2}{#3}{#4}}%
   \fi
}%
\def\XINT_powseries_loop_i #1#2#3#4#5%
{%
    \ifnum #3>#2 \else\XINT_powseries_exit_i\fi
    \expandafter\XINT_powseries_loop_ii\expandafter
    {\the\numexpr #3-1\expandafter}\expandafter
    {\romannumeral0\xintmul {#1}{#5}}{#2}{#4}{#5}%
}%
\def\XINT_powseries_loop_ii #1#2#3#4%
{%
   \expandafter\XINT_powseries_loop_i\expandafter
   {\romannumeral0\xintadd {#4{#1}}{#2}}{#3}{#1}{#4}%
}%
\def\XINT_powseries_exit_i\fi #1#2#3#4#5#6#7#8#9%
{%
    \fi \XINT_powseries_exit_ii  #6{#7}%
}%
\def\XINT_powseries_exit_ii #1#2#3#4#5#6%
{%
    \xintmul{\xintPow {#5}{#6}}{#4}%
}%
%    \end{macrocode}
% \subsection{\csh{xintPowerSeriesX}}
% \lverb|&
% Same as \xintPowerSeries except for the initial expansion of the x parameter.
% Modified in 1.06 to give the indices first to a \numexpr rather than expanding
% twice. I just use \the\numexpr and maintain the previous code after that.
% 1.08a adds the forgotten optimization following that previous change.| 
%    \begin{macrocode}
\def\xintPowerSeriesX {\romannumeral0\xintpowerseriesx }%
\def\xintpowerseriesx #1#2%
{%
    \expandafter\XINT_powseriesx\expandafter 
    {\the\numexpr #1\expandafter}\expandafter{\the\numexpr #2}%
}%
\def\XINT_powseriesx #1#2#3#4%
{%
   \ifnum #2<#1
      \xint_afterfi { 0/1[0]}%
   \else
      \xint_afterfi
      {\expandafter\XINT_powseriesx_pre\expandafter 
                  {\romannumeral-`0#4}{#1}{#2}{#3}%
      }%
   \fi
}%
\def\XINT_powseriesx_pre #1#2#3#4%
{%
    \XINT_powseries_loop_i {#4{#3}}{#2}{#3}{#4}{#1}%
}%
%    \end{macrocode}
% \subsection{\csh{xintRationalSeries}}
% \lverb|&
% This computes F(a)+...+F(b) on the basis of the value of F(a) and the
% ratios F(n)/F(n-1). As in \xintPowerSeries we use an iterative scheme which
% has the great advantage to avoid denominator build-up. This makes exact
% computations possible with exponential type series, which would be completely
% inaccessible to \xintSeries. 
% #1=a, #2=b, #3=F(a), #4=ratio function
% Modified in 1.06 to give the indices first to a \numexpr rather than expanding
% twice. I just use \the\numexpr and maintain the previous code after that.
% 1.08a adds the forgotten optimization following that previous change.| 
%    \begin{macrocode}
\def\xintRationalSeries {\romannumeral0\xintratseries }%
\def\xintratseries #1#2%
{%
    \expandafter\XINT_ratseries\expandafter 
    {\the\numexpr #1\expandafter}\expandafter{\the\numexpr #2}%
}%
\def\XINT_ratseries #1#2#3#4%
{%
   \ifnum #2<#1
      \xint_afterfi { 0/1[0]}%
   \else
      \xint_afterfi
      {\XINT_ratseries_loop {#2}{1}{#1}{#4}{#3}}%
   \fi
}%
\def\XINT_ratseries_loop #1#2#3#4%
{%
    \ifnum #1>#3 \else\XINT_ratseries_exit_i\fi
    \expandafter\XINT_ratseries_loop\expandafter
    {\the\numexpr #1-1\expandafter}\expandafter
    {\romannumeral0\xintadd {1}{\xintMul {#2}{#4{#1}}}}{#3}{#4}%
}%
\def\XINT_ratseries_exit_i\fi #1#2#3#4#5#6#7#8%
{%
    \fi \XINT_ratseries_exit_ii  #6%
}%
\def\XINT_ratseries_exit_ii #1#2#3#4#5%
{%
    \XINT_ratseries_exit_iii #5%
}%
\def\XINT_ratseries_exit_iii #1#2#3#4%
{%
    \xintmul{#2}{#4}%
}%
%    \end{macrocode}
% \subsection{\csh{xintRationalSeriesX}}
% \lverb|&
% a,b,initial,ratiofunction,x$\
% This computes F(a,x)+...+F(b,x) on the basis of the value of F(a,x) and the
% ratios F(n,x)/F(n-1,x). The argument x is first expanded and it is the value
% resulting from this which is used then throughout. The initial term F(a,x)
% must be defined as one-parameter macro which will be given x. 
% Modified in 1.06 to give the indices first to a \numexpr rather than expanding
% twice. I just use \the\numexpr and maintain the previous code after that.
% 1.08a adds the forgotten optimization following that previous change.|
%    \begin{macrocode}
\def\xintRationalSeriesX {\romannumeral0\xintratseriesx }%
\def\xintratseriesx #1#2%
{%
    \expandafter\XINT_ratseriesx\expandafter 
    {\the\numexpr #1\expandafter}\expandafter{\the\numexpr #2}%
}%
\def\XINT_ratseriesx #1#2#3#4#5%
{%
   \ifnum #2<#1
      \xint_afterfi { 0/1[0]}%
   \else
      \xint_afterfi
      {\expandafter\XINT_ratseriesx_pre\expandafter 
                   {\romannumeral-`0#5}{#2}{#1}{#4}{#3}%
      }%
   \fi
}%
\def\XINT_ratseriesx_pre #1#2#3#4#5%
{%
    \XINT_ratseries_loop {#2}{1}{#3}{#4{#1}}{#5{#1}}%
}%
%    \end{macrocode}
% \subsection{\csh{xintFxPtPowerSeries}}
% \lverb|&
% I am not two happy with this piece of code. Will make it more economical
% another day. 
% Modified in 1.06 to give the indices first to a \numexpr rather than expanding
% twice. I just use \the\numexpr and maintain the previous code after that.
% 1.08a: forgot last time some optimization from the change to \numexpr.|
%    \begin{macrocode}
\def\xintFxPtPowerSeries {\romannumeral0\xintfxptpowerseries }%
\def\xintfxptpowerseries #1#2%
{%
    \expandafter\XINT_fppowseries\expandafter 
    {\the\numexpr #1\expandafter}\expandafter{\the\numexpr #2}%
}%
\def\XINT_fppowseries #1#2#3#4#5%
{%
   \ifnum #2<#1
      \xint_afterfi { 0}%
   \else
      \xint_afterfi
        {\expandafter\XINT_fppowseries_loop_pre\expandafter
           {\romannumeral0\xinttrunc {#5}{\xintPow {#4}{#1}}}%
          {#1}{#4}{#2}{#3}{#5}%
        }%
   \fi
}%
\def\XINT_fppowseries_loop_pre #1#2#3#4#5#6%
{%
    \ifnum #4>#2 \else\XINT_fppowseries_dont_i \fi
    \expandafter\XINT_fppowseries_loop_i\expandafter 
    {\the\numexpr #2+\xint_c_i\expandafter}\expandafter
    {\romannumeral0\xintitrunc {#6}{\xintMul {#5{#2}}{#1}}}%
    {#1}{#3}{#4}{#5}{#6}%
}%
\def\XINT_fppowseries_dont_i \fi\expandafter\XINT_fppowseries_loop_i
    {\fi \expandafter\XINT_fppowseries_dont_ii }%
\def\XINT_fppowseries_dont_ii #1#2#3#4#5#6#7{\xinttrunc {#7}{#2[-#7]}}%
\def\XINT_fppowseries_loop_i #1#2#3#4#5#6#7%
{%
    \ifnum #5>#1 \else \XINT_fppowseries_exit_i \fi
    \expandafter\XINT_fppowseries_loop_ii\expandafter
    {\romannumeral0\xinttrunc {#7}{\xintMul {#3}{#4}}}%
    {#1}{#4}{#2}{#5}{#6}{#7}%
}%
\def\XINT_fppowseries_loop_ii #1#2#3#4#5#6#7%
{%
    \expandafter\XINT_fppowseries_loop_i\expandafter
    {\the\numexpr #2+\xint_c_i\expandafter}\expandafter
    {\romannumeral0\xintiiadd {#4}{\xintiTrunc {#7}{\xintMul {#6{#2}}{#1}}}}%
    {#1}{#3}{#5}{#6}{#7}%
}%
\def\XINT_fppowseries_exit_i\fi\expandafter\XINT_fppowseries_loop_ii
    {\fi \expandafter\XINT_fppowseries_exit_ii }%
\def\XINT_fppowseries_exit_ii #1#2#3#4#5#6#7%
{%
    \xinttrunc {#7}
    {\xintiiadd {#4}{\xintiTrunc {#7}{\xintMul {#6{#2}}{#1}}}[-#7]}%
}%
%    \end{macrocode}
% \subsection{\csh{xintFxPtPowerSeriesX}}
% \lverb|&
% a,b,coeff,x,D$\
% Modified in 1.06 to give the indices first to a \numexpr rather than expanding
% twice. I just use \the\numexpr and maintain the previous code after that.
% 1.08a adds the forgotten optimization following that previous change.| 
%    \begin{macrocode}
\def\xintFxPtPowerSeriesX {\romannumeral0\xintfxptpowerseriesx }%
\def\xintfxptpowerseriesx #1#2%
{%
    \expandafter\XINT_fppowseriesx\expandafter 
    {\the\numexpr #1\expandafter}\expandafter{\the\numexpr #2}%
}%
\def\XINT_fppowseriesx #1#2#3#4#5%
{%
   \ifnum #2<#1
      \xint_afterfi { 0}%
   \else
      \xint_afterfi
        {\expandafter \XINT_fppowseriesx_pre \expandafter
         {\romannumeral-`0#4}{#1}{#2}{#3}{#5}%
        }%
   \fi
}%
\def\XINT_fppowseriesx_pre #1#2#3#4#5%
{%
    \expandafter\XINT_fppowseries_loop_pre\expandafter
       {\romannumeral0\xinttrunc {#5}{\xintPow {#1}{#2}}}%
       {#2}{#1}{#3}{#4}{#5}%
}%
%    \end{macrocode}
% \subsection{\csh{xintFloatPowerSeries}}
% \lverb|1.08a. I still have to re-visit \xintFxPtPowerSeries; temporarily I
% just adapted the code to the case of floats.|
%    \begin{macrocode}
\def\xintFloatPowerSeries {\romannumeral0\xintfloatpowerseries }%
\def\xintfloatpowerseries #1{\XINT_flpowseries_chkopt #1\Z }%
\def\XINT_flpowseries_chkopt #1%
{%
    \ifx [#1\expandafter\XINT_flpowseries_opt
       \else\expandafter\XINT_flpowseries_noopt
    \fi
    #1%
}%
\def\XINT_flpowseries_noopt  #1\Z #2%
{%
    \expandafter\XINT_flpowseries\expandafter 
    {\the\numexpr #1\expandafter}\expandafter
    {\the\numexpr #2}\XINTdigits 
}%
\def\XINT_flpowseries_opt [\Z #1]#2#3%
{%
    \expandafter\XINT_flpowseries\expandafter 
    {\the\numexpr #2\expandafter}\expandafter
    {\the\numexpr #3\expandafter}{\the\numexpr #1}%
}%
\def\XINT_flpowseries #1#2#3#4#5%
{%
   \ifnum #2<#1
      \xint_afterfi { 0.e0}%
   \else
      \xint_afterfi
        {\expandafter\XINT_flpowseries_loop_pre\expandafter
           {\romannumeral0\XINTinfloatpow [#3]{#5}{#1}}%
          {#1}{#5}{#2}{#4}{#3}%
        }%
   \fi
}%
\def\XINT_flpowseries_loop_pre #1#2#3#4#5#6%
{%
    \ifnum #4>#2 \else\XINT_flpowseries_dont_i \fi
    \expandafter\XINT_flpowseries_loop_i\expandafter 
    {\the\numexpr #2+\xint_c_i\expandafter}\expandafter
    {\romannumeral0\XINTinfloatmul [#6]{#5{#2}}{#1}}%
    {#1}{#3}{#4}{#5}{#6}%
}%
\def\XINT_flpowseries_dont_i \fi\expandafter\XINT_flpowseries_loop_i
    {\fi \expandafter\XINT_flpowseries_dont_ii }%
\def\XINT_flpowseries_dont_ii #1#2#3#4#5#6#7{\xintfloat [#7]{#2}}%
\def\XINT_flpowseries_loop_i #1#2#3#4#5#6#7%
{%
    \ifnum #5>#1 \else \XINT_flpowseries_exit_i \fi
    \expandafter\XINT_flpowseries_loop_ii\expandafter
    {\romannumeral0\XINTinfloatmul [#7]{#3}{#4}}%
    {#1}{#4}{#2}{#5}{#6}{#7}%
}%
\def\XINT_flpowseries_loop_ii #1#2#3#4#5#6#7%
{%
    \expandafter\XINT_flpowseries_loop_i\expandafter
    {\the\numexpr #2+\xint_c_i\expandafter}\expandafter
    {\romannumeral0\XINTinfloatadd [#7]{#4}%
                        {\XINTinfloatmul [#7]{#6{#2}}{#1}}}%
    {#1}{#3}{#5}{#6}{#7}%
}%
\def\XINT_flpowseries_exit_i\fi\expandafter\XINT_flpowseries_loop_ii
    {\fi \expandafter\XINT_flpowseries_exit_ii }%
\def\XINT_flpowseries_exit_ii #1#2#3#4#5#6#7%
{%
    \xintfloatadd [#7]{#4}{\XINTinfloatmul [#7]{#6{#2}}{#1}}%
}%
%    \end{macrocode}
% \subsection{\csh{xintFloatPowerSeriesX}}
% \lverb|1.08a|
%    \begin{macrocode}
\def\xintFloatPowerSeriesX {\romannumeral0\xintfloatpowerseriesx }%
\def\xintfloatpowerseriesx #1{\XINT_flpowseriesx_chkopt #1\Z }%
\def\XINT_flpowseriesx_chkopt #1%
{%
    \ifx [#1\expandafter\XINT_flpowseriesx_opt
       \else\expandafter\XINT_flpowseriesx_noopt
    \fi
    #1%
}%
\def\XINT_flpowseriesx_noopt  #1\Z #2%
{%
    \expandafter\XINT_flpowseriesx\expandafter 
    {\the\numexpr #1\expandafter}\expandafter
    {\the\numexpr #2}\XINTdigits 
}%
\def\XINT_flpowseriesx_opt [\Z #1]#2#3%
{%
    \expandafter\XINT_flpowseriesx\expandafter 
    {\the\numexpr #2\expandafter}\expandafter
    {\the\numexpr #3\expandafter}{\the\numexpr #1}%
}%
\def\XINT_flpowseriesx #1#2#3#4#5%
{%
   \ifnum #2<#1
      \xint_afterfi { 0.e0}%
   \else
      \xint_afterfi
        {\expandafter \XINT_flpowseriesx_pre \expandafter
         {\romannumeral-`0#5}{#1}{#2}{#4}{#3}%
        }%
   \fi
}%
\def\XINT_flpowseriesx_pre #1#2#3#4#5%
{%
    \expandafter\XINT_flpowseries_loop_pre\expandafter
       {\romannumeral0\XINTinfloatpow [#5]{#1}{#2}}%
       {#2}{#1}{#3}{#4}{#5}%
}%
\XINT_restorecatcodes_endinput%
%    \end{macrocode}
%\catcode`\<=0 \catcode`\>=11 \catcode`\*=11 \catcode`\/=11
%\let</xintseries>\relax
%\def<*xintcfrac>{\catcode`\<=12 \catcode`\>=12 \catcode`\*=12 \catcode`\/=12 }
%</xintseries>
%<*xintcfrac>
%
% \StoreCodelineNo {xintseries}
%
% \section{Package \xintcfracname implementation}
% 
% The commenting is currently (\docdate) very sparse.
%
% \localtableofcontents
% \subsection{Catcodes, \protect\eTeX{} and reload detection}
%
% The code for reload detection is copied from \textsc{Heiko
% Oberdiek}'s packages, and adapted here to check for previous
% loading of the \xintfracname package.
%
% The method for catcodes is slightly different, but still
% directly inspired by these packages.
%
%    \begin{macrocode}
\begingroup\catcode61\catcode48\catcode32=10\relax%
  \catcode13=5    % ^^M
  \endlinechar=13 %
  \catcode123=1   % {
  \catcode125=2   % }
  \catcode64=11   % @
  \catcode35=6    % #
  \catcode44=12   % ,
  \catcode45=12   % -
  \catcode46=12   % .
  \catcode58=12   % :
  \def\space { }%
  \let\z\endgroup
  \expandafter\let\expandafter\x\csname ver@xintcfrac.sty\endcsname
  \expandafter\let\expandafter\w\csname ver@xintfrac.sty\endcsname
  \expandafter
    \ifx\csname PackageInfo\endcsname\relax
      \def\y#1#2{\immediate\write-1{Package #1 Info: #2.}}%
    \else
      \def\y#1#2{\PackageInfo{#1}{#2}}%
    \fi
  \expandafter
  \ifx\csname numexpr\endcsname\relax
     \y{xintcfrac}{\numexpr not available, aborting input}%
     \aftergroup\endinput
  \else
    \ifx\x\relax   % plain-TeX, first loading of xintcfrac.sty
      \ifx\w\relax % but xintfrac.sty not yet loaded.
         \y{xintcfrac}{Package xintfrac is required}%
         \y{xintcfrac}{Will try \string\input\space xintfrac.sty}%
         \def\z{\endgroup\input xintfrac.sty\relax}%
      \fi
    \else
      \def\empty {}%
      \ifx\x\empty % LaTeX, first loading,
      % variable is initialized, but \ProvidesPackage not yet seen
          \ifx\w\relax % xintfrac.sty not yet loaded.
            \y{xintcfrac}{Package xintfrac is required}%
            \y{xintcfrac}{Will try \string\RequirePackage{xintfrac}}%
            \def\z{\endgroup\RequirePackage{xintfrac}}%
          \fi
      \else
        \y{xintcfrac}{I was already loaded, aborting input}%
        \aftergroup\endinput
      \fi
    \fi
  \fi
\z%
%    \end{macrocode}
% \subsection{Confirmation of \xintfracname loading}
%    \begin{macrocode}
\begingroup\catcode61\catcode48\catcode32=10\relax%
  \catcode13=5    % ^^M
  \endlinechar=13 %
  \catcode123=1   % {
  \catcode125=2   % }
  \catcode64=11   % @
  \catcode35=6    % #
  \catcode44=12   % ,
  \catcode45=12   % -
  \catcode46=12   % .
  \catcode58=12   % :
  \expandafter
    \ifx\csname PackageInfo\endcsname\relax
      \def\y#1#2{\immediate\write-1{Package #1 Info: #2.}}%
    \else
      \def\y#1#2{\PackageInfo{#1}{#2}}%
    \fi
  \def\empty {}%
  \expandafter\let\expandafter\w\csname ver@xintfrac.sty\endcsname
  \ifx\w\relax % Plain TeX, user gave a file name at the prompt
      \y{xintcfrac}{Loading of package xintfrac failed, aborting input}%
      \aftergroup\endinput
  \fi
  \ifx\w\empty % LaTeX, user gave a file name at the prompt
      \y{xintcfrac}{Loading of package xintfrac failed, aborting input}%
      \aftergroup\endinput
  \fi
\endgroup%
%    \end{macrocode}
% \subsection{Catcodes}
%    \begin{macrocode}
\XINTsetupcatcodes%
%    \end{macrocode}
% \subsection{Package identification}
%    \begin{macrocode}
\XINT_providespackage
\ProvidesPackage{xintcfrac}%
  [2013/10/03 v1.09b Expandable continued fractions with xint package (jfB)]%
%    \end{macrocode}
% \subsection{\csh{xintCFrac}}
%    \begin{macrocode}
\def\xintCFrac {\romannumeral0\xintcfrac }%
\def\xintcfrac #1%
{%
    \XINT_cfrac_opt_a #1\Z
}%
\def\XINT_cfrac_opt_a #1%
{% 
    \ifx[#1\XINT_cfrac_opt_b\fi \XINT_cfrac_noopt #1%
}%
\def\XINT_cfrac_noopt #1\Z
{%
    \expandafter\XINT_cfrac_A\romannumeral0\xintrawwithzeros {#1}\Z
    \relax\relax
}%
\def\XINT_cfrac_opt_b\fi\XINT_cfrac_noopt [\Z #1]%
{%
    \fi\csname XINT_cfrac_opt#1\endcsname
}%
\def\XINT_cfrac_optl #1%
{%
    \expandafter\XINT_cfrac_A\romannumeral0\xintrawwithzeros {#1}\Z
    \relax\hfill
}%
\def\XINT_cfrac_optc #1%
{%
    \expandafter\XINT_cfrac_A\romannumeral0\xintrawwithzeros {#1}\Z
    \relax\relax
}%
\def\XINT_cfrac_optr #1%
{%
    \expandafter\XINT_cfrac_A\romannumeral0\xintrawwithzeros {#1}\Z
    \hfill\relax
}%
\def\XINT_cfrac_A #1/#2\Z
{%
    \expandafter\XINT_cfrac_B\romannumeral0\xintidivision {#1}{#2}{#2}%
}%
\def\XINT_cfrac_B #1#2%
{%
    \XINT_cfrac_C #2\Z {#1}%
}%
\def\XINT_cfrac_C #1%
{%
    \xint_gob_til_zero #1\XINT_cfrac_integer 0\XINT_cfrac_D #1%
}%
\def\XINT_cfrac_integer 0\XINT_cfrac_D 0#1\Z #2#3#4#5{ #2}%
\def\XINT_cfrac_D #1\Z #2#3{\XINT_cfrac_loop_a {#1}{#3}{#1}{{#2}}}%  
\def\XINT_cfrac_loop_a 
{%
    \expandafter\XINT_cfrac_loop_d\romannumeral0\XINT_div_prepare
}%
\def\XINT_cfrac_loop_d #1#2%
{%
    \XINT_cfrac_loop_e #2.{#1}%
}%
\def\XINT_cfrac_loop_e #1%
{%
    \xint_gob_til_zero #1\xint_cfrac_loop_exit0\XINT_cfrac_loop_f #1%
}%
\def\XINT_cfrac_loop_f #1.#2#3#4%
{%
    \XINT_cfrac_loop_a {#1}{#3}{#1}{{#2}#4}%
}%
\def\xint_cfrac_loop_exit0\XINT_cfrac_loop_f #1.#2#3#4#5#6%
   {\XINT_cfrac_T #5#6{#2}#4\Z }%
\def\XINT_cfrac_T #1#2#3#4%
{%
  \xint_gob_til_Z #4\XINT_cfrac_end\Z\XINT_cfrac_T #1#2{#4+\cfrac{#11#2}{#3}}%
}%
\def\XINT_cfrac_end\Z\XINT_cfrac_T #1#2#3%
{%
    \XINT_cfrac_end_b #3%
}%
\def\XINT_cfrac_end_b \Z+\cfrac#1#2{ #2}%
%    \end{macrocode}
% \subsection{\csh{xintGCFrac}}
%    \begin{macrocode}
\def\xintGCFrac {\romannumeral0\xintgcfrac }%
\def\xintgcfrac #1{\XINT_gcfrac_opt_a #1\Z }%
\def\XINT_gcfrac_opt_a #1%
{% 
    \ifx[#1\XINT_gcfrac_opt_b\fi \XINT_gcfrac_noopt #1%
}%
\def\XINT_gcfrac_noopt #1\Z
{%
    \XINT_gcfrac #1+\W/\relax\relax
}%
\def\XINT_gcfrac_opt_b\fi\XINT_gcfrac_noopt [\Z #1]%
{%
    \fi\csname XINT_gcfrac_opt#1\endcsname
}%
\def\XINT_gcfrac_optl #1%
{%
    \XINT_gcfrac #1+\W/\relax\hfill
}%
\def\XINT_gcfrac_optc #1%
{%
    \XINT_gcfrac #1+\W/\relax\relax
}%
\def\XINT_gcfrac_optr #1%
{%
    \XINT_gcfrac #1+\W/\hfill\relax
}%
\def\XINT_gcfrac 
{%
    \expandafter\XINT_gcfrac_enter\romannumeral-`0%
}%
\def\XINT_gcfrac_enter {\XINT_gcfrac_loop {}}%
\def\XINT_gcfrac_loop #1#2+#3/%
{%
    \xint_gob_til_W #3\XINT_gcfrac_endloop\W
    \XINT_gcfrac_loop {{#3}{#2}#1}%
}%
\def\XINT_gcfrac_endloop\W\XINT_gcfrac_loop #1#2#3%
{%
    \XINT_gcfrac_T #2#3#1\Z\Z
}%
\def\XINT_gcfrac_T #1#2#3#4{\XINT_gcfrac_U #1#2{\xintFrac{#4}}}%
\def\XINT_gcfrac_U #1#2#3#4#5%
{%
    \xint_gob_til_Z #5\XINT_gcfrac_end\Z\XINT_gcfrac_U 
              #1#2{\xintFrac{#5}%
               \ifcase\xintSgn{#4}
               +\or+\else-\fi
               \cfrac{#1\xintFrac{\xintAbs{#4}}#2}{#3}}%
}%
\def\XINT_gcfrac_end\Z\XINT_gcfrac_U #1#2#3%
{%
    \XINT_gcfrac_end_b #3%
}%
\def\XINT_gcfrac_end_b #1\cfrac#2#3{ #3}%
%    \end{macrocode}
% \subsection{\csh{xintGCtoGCx}}
%    \begin{macrocode}
\def\xintGCtoGCx {\romannumeral0\xintgctogcx }%
\def\xintgctogcx #1#2#3%
{%
    \expandafter\XINT_gctgcx_start\expandafter {\romannumeral-`0#3}{#1}{#2}%
}%
\def\XINT_gctgcx_start #1#2#3{\XINT_gctgcx_loop_a {}{#2}{#3}#1+\W/}%
\def\XINT_gctgcx_loop_a #1#2#3#4+#5/%
{%
    \xint_gob_til_W #5\XINT_gctgcx_end\W
    \XINT_gctgcx_loop_b {#1{#4}}{#2{#5}#3}{#2}{#3}%
}%
\def\XINT_gctgcx_loop_b #1#2%
{%
    \XINT_gctgcx_loop_a {#1#2}%
}%  
\def\XINT_gctgcx_end\W\XINT_gctgcx_loop_b #1#2#3#4{ #1}%
%    \end{macrocode}
% \subsection{\csh{xintFtoCs}}
%    \begin{macrocode}
\def\xintFtoCs {\romannumeral0\xintftocs }%
\def\xintftocs #1%
{%
    \expandafter\XINT_ftc_A\romannumeral0\xintrawwithzeros {#1}\Z
}%
\def\XINT_ftc_A #1/#2\Z
{%
    \expandafter\XINT_ftc_B\romannumeral0\xintidivision {#1}{#2}{#2}%
}%
\def\XINT_ftc_B #1#2%
{%
    \XINT_ftc_C #2.{#1}%
}%
\def\XINT_ftc_C #1%
{%
    \xint_gob_til_zero #1\XINT_ftc_integer 0\XINT_ftc_D #1%
}%
\def\XINT_ftc_integer 0\XINT_ftc_D 0#1.#2#3{ #2}%
\def\XINT_ftc_D #1.#2#3{\XINT_ftc_loop_a {#1}{#3}{#1}{#2,}}%  
\def\XINT_ftc_loop_a 
{%
    \expandafter\XINT_ftc_loop_d\romannumeral0\XINT_div_prepare
}%
\def\XINT_ftc_loop_d #1#2%
{%
    \XINT_ftc_loop_e #2.{#1}%
}%
\def\XINT_ftc_loop_e #1%
{%
    \xint_gob_til_zero #1\xint_ftc_loop_exit0\XINT_ftc_loop_f #1%
}%
\def\XINT_ftc_loop_f #1.#2#3#4%
{%
    \XINT_ftc_loop_a {#1}{#3}{#1}{#4#2,}%
}%
\def\xint_ftc_loop_exit0\XINT_ftc_loop_f #1.#2#3#4{ #4#2}%
%    \end{macrocode}
% \subsection{\csh{xintFtoCx}}
%    \begin{macrocode}
\def\xintFtoCx {\romannumeral0\xintftocx }%
\def\xintftocx #1#2%
{%
    \expandafter\XINT_ftcx_A\romannumeral0\xintrawwithzeros {#2}\Z {#1}%
}%
\def\XINT_ftcx_A #1/#2\Z
{%
    \expandafter\XINT_ftcx_B\romannumeral0\xintidivision {#1}{#2}{#2}%
}%
\def\XINT_ftcx_B #1#2%
{%
    \XINT_ftcx_C #2.{#1}%
}%
\def\XINT_ftcx_C #1%
{%
    \xint_gob_til_zero #1\XINT_ftcx_integer 0\XINT_ftcx_D #1%
}%
\def\XINT_ftcx_integer 0\XINT_ftcx_D 0#1.#2#3#4{ #2}%
\def\XINT_ftcx_D #1.#2#3#4{\XINT_ftcx_loop_a {#1}{#3}{#1}{#2#4}{#4}}%  
\def\XINT_ftcx_loop_a 
{%
    \expandafter\XINT_ftcx_loop_d\romannumeral0\XINT_div_prepare
}%
\def\XINT_ftcx_loop_d #1#2%
{%
    \XINT_ftcx_loop_e #2.{#1}%
}%
\def\XINT_ftcx_loop_e #1%
{%
    \xint_gob_til_zero #1\xint_ftcx_loop_exit0\XINT_ftcx_loop_f #1%
}%
\def\XINT_ftcx_loop_f #1.#2#3#4#5%
{%
    \XINT_ftcx_loop_a {#1}{#3}{#1}{#4{#2}#5}{#5}%
}%
\def\xint_ftcx_loop_exit0\XINT_ftcx_loop_f #1.#2#3#4#5{ #4{#2}}%
%    \end{macrocode}
% \subsection{\csh{xintFtoGC}}
%    \begin{macrocode}
\def\xintFtoGC {\romannumeral0\xintftogc }%
\def\xintftogc {\xintftocx {+1/}}%
%    \end{macrocode}
% \subsection{\csh{xintFtoCC}}
%    \begin{macrocode}
\def\xintFtoCC {\romannumeral0\xintftocc }%
\def\xintftocc #1%
{%
    \expandafter\XINT_ftcc_A\expandafter {\romannumeral0\xintrawwithzeros {#1}}%
}%
\def\XINT_ftcc_A #1%
{%
    \expandafter\XINT_ftcc_B
    \romannumeral0\xintrawwithzeros {\xintAdd {1/2[0]}{#1[0]}}\Z {#1[0]}%
}%
\def\XINT_ftcc_B #1/#2\Z 
{%
    \expandafter\XINT_ftcc_C\expandafter {\romannumeral0\xintiquo {#1}{#2}}%
}%
\def\XINT_ftcc_C #1#2%
{%
    \expandafter\XINT_ftcc_D\romannumeral0\xintsub {#2}{#1}\Z {#1}%
}%
\def\XINT_ftcc_D #1%
{%
    \xint_UDzerominusfork
      #1-\dummy \XINT_ftcc_integer
      0#1\dummy \XINT_ftcc_En
       0-\dummy {\XINT_ftcc_Ep #1}%
    \krof
}%
\def\XINT_ftcc_Ep #1\Z #2%
{%
    \expandafter\XINT_ftcc_loop_a\expandafter
    {\romannumeral0\xintdiv {1[0]}{#1}}{#2+1/}%
}%
\def\XINT_ftcc_En #1\Z #2%
{%
    \expandafter\XINT_ftcc_loop_a\expandafter
    {\romannumeral0\xintdiv {1[0]}{#1}}{#2+-1/}%
}%
\def\XINT_ftcc_integer #1\Z #2{ #2}%
\def\XINT_ftcc_loop_a #1%
{%
    \expandafter\XINT_ftcc_loop_b
    \romannumeral0\xintrawwithzeros {\xintAdd {1/2[0]}{#1}}\Z {#1}%
}%
\def\XINT_ftcc_loop_b #1/#2\Z
{%
    \expandafter\XINT_ftcc_loop_c\expandafter 
    {\romannumeral0\xintiquo {#1}{#2}}%
}%
\def\XINT_ftcc_loop_c #1#2%
{%
    \expandafter\XINT_ftcc_loop_d
    \romannumeral0\xintsub {#2}{#1[0]}\Z {#1}%
}%
\def\XINT_ftcc_loop_d #1%
{%
    \xint_UDzerominusfork
      #1-\dummy \XINT_ftcc_end
      0#1\dummy \XINT_ftcc_loop_N
       0-\dummy {\XINT_ftcc_loop_P #1}%
    \krof
}%
\def\XINT_ftcc_end #1\Z #2#3{ #3#2}%
\def\XINT_ftcc_loop_P #1\Z #2#3%
{%
    \expandafter\XINT_ftcc_loop_a\expandafter
    {\romannumeral0\xintdiv {1[0]}{#1}}{#3#2+1/}%
}%
\def\XINT_ftcc_loop_N #1\Z #2#3%
{%
    \expandafter\XINT_ftcc_loop_a\expandafter
    {\romannumeral0\xintdiv {1[0]}{#1}}{#3#2+-1/}%
}%
%    \end{macrocode}
% \subsection{\csh{xintFtoCv}}
%    \begin{macrocode}
\def\xintFtoCv {\romannumeral0\xintftocv }%
\def\xintftocv #1%
{%
    \xinticstocv {\xintFtoCs {#1}}%
}%
%    \end{macrocode}
% \subsection{\csh{xintFtoCCv}}
%    \begin{macrocode}
\def\xintFtoCCv {\romannumeral0\xintftoccv }%
\def\xintftoccv #1%
{%
    \xintigctocv {\xintFtoCC {#1}}%
}%
%    \end{macrocode}
% \subsection{\csh{xintCstoF}}
%    \begin{macrocode}
\def\xintCstoF {\romannumeral0\xintcstof }%
\def\xintcstof #1%
{%
    \expandafter\XINT_cstf_prep \romannumeral-`0#1,\W,%
}%
\def\XINT_cstf_prep
{%
    \XINT_cstf_loop_a 1001%
}%
\def\XINT_cstf_loop_a #1#2#3#4#5,%
{%
    \xint_gob_til_W #5\XINT_cstf_end\W
    \expandafter\XINT_cstf_loop_b
    \romannumeral0\xintrawwithzeros {#5}.{#1}{#2}{#3}{#4}%
}%
\def\XINT_cstf_loop_b #1/#2.#3#4#5#6%
{%
    \expandafter\XINT_cstf_loop_c\expandafter
    {\romannumeral0\XINT_mul_fork #2\Z #4\Z }%
    {\romannumeral0\XINT_mul_fork #2\Z #3\Z }%
    {\romannumeral0\xintiiadd {\XINT_Mul {#2}{#6}}{\XINT_Mul {#1}{#4}}}%
    {\romannumeral0\xintiiadd {\XINT_Mul {#2}{#5}}{\XINT_Mul {#1}{#3}}}%
}%
\def\XINT_cstf_loop_c #1#2%
{%
    \expandafter\XINT_cstf_loop_d\expandafter {\expandafter{#2}{#1}}%
}%
\def\XINT_cstf_loop_d #1#2%
{%
    \expandafter\XINT_cstf_loop_e\expandafter {\expandafter{#2}#1}%
}%
\def\XINT_cstf_loop_e #1#2%
{%
    \expandafter\XINT_cstf_loop_a\expandafter{#2}#1%
}%
\def\XINT_cstf_end #1.#2#3#4#5{\xintrawwithzeros {#2/#3}}% 1.09b removes [0]
%    \end{macrocode}
% \subsection{\csh{xintiCstoF}}
%    \begin{macrocode}
\def\xintiCstoF {\romannumeral0\xinticstof }%
\def\xinticstof #1%
{%
    \expandafter\XINT_icstf_prep \romannumeral-`0#1,\W,%
}%
\def\XINT_icstf_prep
{%
    \XINT_icstf_loop_a 1001%
}%
\def\XINT_icstf_loop_a #1#2#3#4#5,%
{%
    \xint_gob_til_W #5\XINT_icstf_end\W
    \expandafter
    \XINT_icstf_loop_b \romannumeral-`0#5.{#1}{#2}{#3}{#4}%
}%
\def\XINT_icstf_loop_b #1.#2#3#4#5%
{%
    \expandafter\XINT_icstf_loop_c\expandafter
    {\romannumeral0\xintiiadd {#5}{\XINT_Mul {#1}{#3}}}%
    {\romannumeral0\xintiiadd {#4}{\XINT_Mul {#1}{#2}}}%
    {#2}{#3}%
}%
\def\XINT_icstf_loop_c #1#2%
{%
    \expandafter\XINT_icstf_loop_a\expandafter {#2}{#1}%
}%
\def\XINT_icstf_end#1.#2#3#4#5{\xintrawwithzeros {#2/#3}}% 1.09b removes [0]
%    \end{macrocode}
% \subsection{\csh{xintGCtoF}}
%    \begin{macrocode}
\def\xintGCtoF {\romannumeral0\xintgctof }%
\def\xintgctof #1%
{%
    \expandafter\XINT_gctf_prep \romannumeral-`0#1+\W/%
}%
\def\XINT_gctf_prep
{%
    \XINT_gctf_loop_a 1001%
}%
\def\XINT_gctf_loop_a #1#2#3#4#5+%
{%
    \expandafter\XINT_gctf_loop_b
    \romannumeral0\xintrawwithzeros {#5}.{#1}{#2}{#3}{#4}%
}%
\def\XINT_gctf_loop_b #1/#2.#3#4#5#6%
{%
    \expandafter\XINT_gctf_loop_c\expandafter
    {\romannumeral0\XINT_mul_fork #2\Z #4\Z }%
    {\romannumeral0\XINT_mul_fork #2\Z #3\Z }%
    {\romannumeral0\xintiiadd {\XINT_Mul {#2}{#6}}{\XINT_Mul {#1}{#4}}}%
    {\romannumeral0\xintiiadd {\XINT_Mul {#2}{#5}}{\XINT_Mul {#1}{#3}}}%
}%
\def\XINT_gctf_loop_c #1#2%
{%
    \expandafter\XINT_gctf_loop_d\expandafter {\expandafter{#2}{#1}}%
}%
\def\XINT_gctf_loop_d #1#2%
{%
    \expandafter\XINT_gctf_loop_e\expandafter {\expandafter{#2}#1}%
}%
\def\XINT_gctf_loop_e #1#2%
{%
    \expandafter\XINT_gctf_loop_f\expandafter {\expandafter{#2}#1}%
}%
\def\XINT_gctf_loop_f #1#2/%
{%
    \xint_gob_til_W #2\XINT_gctf_end\W
    \expandafter\XINT_gctf_loop_g 
    \romannumeral0\xintrawwithzeros {#2}.#1%
}%
\def\XINT_gctf_loop_g #1/#2.#3#4#5#6%
{%
    \expandafter\XINT_gctf_loop_h\expandafter
    {\romannumeral0\XINT_mul_fork #1\Z #6\Z }%
    {\romannumeral0\XINT_mul_fork #1\Z #5\Z }%
    {\romannumeral0\XINT_mul_fork #2\Z #4\Z }%
    {\romannumeral0\XINT_mul_fork #2\Z #3\Z }%
}%
\def\XINT_gctf_loop_h #1#2%
{%
    \expandafter\XINT_gctf_loop_i\expandafter {\expandafter{#2}{#1}}%
}%
\def\XINT_gctf_loop_i #1#2%
{%
    \expandafter\XINT_gctf_loop_j\expandafter {\expandafter{#2}#1}%
}%
\def\XINT_gctf_loop_j #1#2%
{%
    \expandafter\XINT_gctf_loop_a\expandafter {#2}#1%
}%
\def\XINT_gctf_end #1.#2#3#4#5{\xintrawwithzeros {#2/#3}}% 1.09b removes [0]
%    \end{macrocode}
% \subsection{\csh{xintiGCtoF}}
%    \begin{macrocode}
\def\xintiGCtoF {\romannumeral0\xintigctof }%
\def\xintigctof #1%
{%
    \expandafter\XINT_igctf_prep \romannumeral-`0#1+\W/%
}%
\def\XINT_igctf_prep
{%
    \XINT_igctf_loop_a 1001%
}%
\def\XINT_igctf_loop_a #1#2#3#4#5+%
{%
    \expandafter\XINT_igctf_loop_b
    \romannumeral-`0#5.{#1}{#2}{#3}{#4}%
}%
\def\XINT_igctf_loop_b #1.#2#3#4#5%
{%
    \expandafter\XINT_igctf_loop_c\expandafter
    {\romannumeral0\xintiiadd {#5}{\XINT_Mul {#1}{#3}}}%
    {\romannumeral0\xintiiadd {#4}{\XINT_Mul {#1}{#2}}}%
    {#2}{#3}%
}%
\def\XINT_igctf_loop_c #1#2%
{%
    \expandafter\XINT_igctf_loop_f\expandafter {\expandafter{#2}{#1}}%
}%
\def\XINT_igctf_loop_f #1#2#3#4/%
{%
    \xint_gob_til_W #4\XINT_igctf_end\W
    \expandafter\XINT_igctf_loop_g 
    \romannumeral-`0#4.{#2}{#3}#1%
}%
\def\XINT_igctf_loop_g #1.#2#3%
{%
    \expandafter\XINT_igctf_loop_h\expandafter
    {\romannumeral0\XINT_mul_fork #1\Z #3\Z }%
    {\romannumeral0\XINT_mul_fork #1\Z #2\Z }%
}%
\def\XINT_igctf_loop_h #1#2%
{%
    \expandafter\XINT_igctf_loop_i\expandafter {#2}{#1}%
}%
\def\XINT_igctf_loop_i #1#2#3#4%
{%
    \XINT_igctf_loop_a {#3}{#4}{#1}{#2}%
}%
\def\XINT_igctf_end #1.#2#3#4#5{\xintrawwithzeros {#4/#5}}% 1.09b removes [0]
%    \end{macrocode}
% \subsection{\csh{xintCstoCv}}
%    \begin{macrocode}
\def\xintCstoCv {\romannumeral0\xintcstocv }%
\def\xintcstocv #1%
{%
    \expandafter\XINT_cstcv_prep \romannumeral-`0#1,\W,%
}%
\def\XINT_cstcv_prep
{%
    \XINT_cstcv_loop_a {}1001%
}%
\def\XINT_cstcv_loop_a #1#2#3#4#5#6,%
{%
    \xint_gob_til_W #6\XINT_cstcv_end\W
    \expandafter\XINT_cstcv_loop_b
    \romannumeral0\xintrawwithzeros {#6}.{#2}{#3}{#4}{#5}{#1}%
}%
\def\XINT_cstcv_loop_b #1/#2.#3#4#5#6%
{%
    \expandafter\XINT_cstcv_loop_c\expandafter
    {\romannumeral0\XINT_mul_fork #2\Z #4\Z }%
    {\romannumeral0\XINT_mul_fork #2\Z #3\Z }%
    {\romannumeral0\xintiiadd {\XINT_Mul {#2}{#6}}{\XINT_Mul {#1}{#4}}}%
    {\romannumeral0\xintiiadd {\XINT_Mul {#2}{#5}}{\XINT_Mul {#1}{#3}}}%
}%
\def\XINT_cstcv_loop_c #1#2%
{%
    \expandafter\XINT_cstcv_loop_d\expandafter {\expandafter{#2}{#1}}%
}%
\def\XINT_cstcv_loop_d #1#2%
{%
    \expandafter\XINT_cstcv_loop_e\expandafter {\expandafter{#2}#1}%
}%
\def\XINT_cstcv_loop_e #1#2%
{%
    \expandafter\XINT_cstcv_loop_f\expandafter{#2}#1%
}%
\def\XINT_cstcv_loop_f #1#2#3#4#5%
{%
    \expandafter\XINT_cstcv_loop_g\expandafter 
    {\romannumeral0\xintrawwithzeros {#1/#2}}{#5}{#1}{#2}{#3}{#4}%
}%
\def\XINT_cstcv_loop_g #1#2{\XINT_cstcv_loop_a {#2{#1}}}% 1.09b removes [0]
\def\XINT_cstcv_end #1.#2#3#4#5#6{ #6}%
%    \end{macrocode}
% \subsection{\csh{xintiCstoCv}}
%    \begin{macrocode}
\def\xintiCstoCv {\romannumeral0\xinticstocv }%
\def\xinticstocv #1%
{%
    \expandafter\XINT_icstcv_prep \romannumeral-`0#1,\W,%
}%
\def\XINT_icstcv_prep
{%
    \XINT_icstcv_loop_a {}1001%
}%
\def\XINT_icstcv_loop_a #1#2#3#4#5#6,%
{%
    \xint_gob_til_W #6\XINT_icstcv_end\W
    \expandafter
    \XINT_icstcv_loop_b \romannumeral-`0#6.{#2}{#3}{#4}{#5}{#1}%
}%
\def\XINT_icstcv_loop_b #1.#2#3#4#5%
{%
    \expandafter\XINT_icstcv_loop_c\expandafter
    {\romannumeral0\xintiiadd {#5}{\XINT_Mul {#1}{#3}}}%
    {\romannumeral0\xintiiadd {#4}{\XINT_Mul {#1}{#2}}}%
    {{#2}{#3}}%
}%
\def\XINT_icstcv_loop_c #1#2%
{%
    \expandafter\XINT_icstcv_loop_d\expandafter {#2}{#1}%
}%
\def\XINT_icstcv_loop_d #1#2%
{%
    \expandafter\XINT_icstcv_loop_e\expandafter
    {\romannumeral0\xintrawwithzeros {#1/#2}}{{#1}{#2}}%
}%
\def\XINT_icstcv_loop_e #1#2#3#4{\XINT_icstcv_loop_a {#4{#1}}#2#3}%
\def\XINT_icstcv_end #1.#2#3#4#5#6{ #6}%  1.09b removes [0]
%    \end{macrocode}
% \subsection{\csh{xintGCtoCv}}
%    \begin{macrocode}
\def\xintGCtoCv {\romannumeral0\xintgctocv }%
\def\xintgctocv #1%
{%
    \expandafter\XINT_gctcv_prep \romannumeral-`0#1+\W/%
}%
\def\XINT_gctcv_prep
{%
    \XINT_gctcv_loop_a {}1001%
}%
\def\XINT_gctcv_loop_a #1#2#3#4#5#6+%
{%
    \expandafter\XINT_gctcv_loop_b
    \romannumeral0\xintrawwithzeros {#6}.{#2}{#3}{#4}{#5}{#1}%
}%
\def\XINT_gctcv_loop_b #1/#2.#3#4#5#6%
{%
    \expandafter\XINT_gctcv_loop_c\expandafter
    {\romannumeral0\XINT_mul_fork #2\Z #4\Z }%
    {\romannumeral0\XINT_mul_fork #2\Z #3\Z }%
    {\romannumeral0\xintiiadd {\XINT_Mul {#2}{#6}}{\XINT_Mul {#1}{#4}}}%
    {\romannumeral0\xintiiadd {\XINT_Mul {#2}{#5}}{\XINT_Mul {#1}{#3}}}%
}%
\def\XINT_gctcv_loop_c #1#2%
{%
    \expandafter\XINT_gctcv_loop_d\expandafter {\expandafter{#2}{#1}}%
}%
\def\XINT_gctcv_loop_d #1#2%
{%
    \expandafter\XINT_gctcv_loop_e\expandafter {\expandafter{#2}{#1}}%
}%
\def\XINT_gctcv_loop_e #1#2%
{%
    \expandafter\XINT_gctcv_loop_f\expandafter {#2}#1%
}%
\def\XINT_gctcv_loop_f #1#2%
{%
    \expandafter\XINT_gctcv_loop_g\expandafter
    {\romannumeral0\xintrawwithzeros {#1/#2}}{{#1}{#2}}%
}%
\def\XINT_gctcv_loop_g #1#2#3#4%
{%
    \XINT_gctcv_loop_h {#4{#1}}{#2#3}% 1.09b removes [0]
}%
\def\XINT_gctcv_loop_h #1#2#3/%
{%
    \xint_gob_til_W #3\XINT_gctcv_end\W
    \expandafter\XINT_gctcv_loop_i
    \romannumeral0\xintrawwithzeros {#3}.#2{#1}%
}%
\def\XINT_gctcv_loop_i #1/#2.#3#4#5#6%
{%
    \expandafter\XINT_gctcv_loop_j\expandafter
    {\romannumeral0\XINT_mul_fork #1\Z #6\Z }%
    {\romannumeral0\XINT_mul_fork #1\Z #5\Z }%
    {\romannumeral0\XINT_mul_fork #2\Z #4\Z }%
    {\romannumeral0\XINT_mul_fork #2\Z #3\Z }%
}%
\def\XINT_gctcv_loop_j #1#2%
{%
    \expandafter\XINT_gctcv_loop_k\expandafter {\expandafter{#2}{#1}}%
}%
\def\XINT_gctcv_loop_k #1#2%
{%
    \expandafter\XINT_gctcv_loop_l\expandafter {\expandafter{#2}#1}%
}%
\def\XINT_gctcv_loop_l #1#2%
{%
    \expandafter\XINT_gctcv_loop_m\expandafter {\expandafter{#2}#1}%
}%
\def\XINT_gctcv_loop_m #1#2{\XINT_gctcv_loop_a {#2}#1}%
\def\XINT_gctcv_end #1.#2#3#4#5#6{ #6}%
%    \end{macrocode}
% \subsection{\csh{xintiGCtoCv}}
%    \begin{macrocode}
\def\xintiGCtoCv {\romannumeral0\xintigctocv }%
\def\xintigctocv #1%
{%
    \expandafter\XINT_igctcv_prep \romannumeral-`0#1+\W/%
}%
\def\XINT_igctcv_prep
{%
    \XINT_igctcv_loop_a {}1001%
}%
\def\XINT_igctcv_loop_a #1#2#3#4#5#6+%
{%
    \expandafter\XINT_igctcv_loop_b
    \romannumeral-`0#6.{#2}{#3}{#4}{#5}{#1}%
}%
\def\XINT_igctcv_loop_b #1.#2#3#4#5%
{%
    \expandafter\XINT_igctcv_loop_c\expandafter
    {\romannumeral0\xintiiadd {#5}{\XINT_Mul {#1}{#3}}}%
    {\romannumeral0\xintiiadd {#4}{\XINT_Mul {#1}{#2}}}%
    {{#2}{#3}}%
}%
\def\XINT_igctcv_loop_c #1#2%
{%
    \expandafter\XINT_igctcv_loop_f\expandafter {\expandafter{#2}{#1}}%
}%
\def\XINT_igctcv_loop_f #1#2#3#4/%
{%
    \xint_gob_til_W #4\XINT_igctcv_end_a\W
    \expandafter\XINT_igctcv_loop_g 
    \romannumeral-`0#4.#1#2{#3}%
}%
\def\XINT_igctcv_loop_g #1.#2#3#4#5%
{%
    \expandafter\XINT_igctcv_loop_h\expandafter
    {\romannumeral0\XINT_mul_fork #1\Z #5\Z }%
    {\romannumeral0\XINT_mul_fork #1\Z #4\Z }%
    {{#2}{#3}}%
}%
\def\XINT_igctcv_loop_h #1#2%
{%
    \expandafter\XINT_igctcv_loop_i\expandafter {\expandafter{#2}{#1}}%
}%
\def\XINT_igctcv_loop_i #1#2{\XINT_igctcv_loop_k #2{#2#1}}%
\def\XINT_igctcv_loop_k #1#2%
{%
    \expandafter\XINT_igctcv_loop_l\expandafter
    {\romannumeral0\xintrawwithzeros {#1/#2}}%
}%
\def\XINT_igctcv_loop_l #1#2#3{\XINT_igctcv_loop_a {#3{#1[0]}}#2}%
\def\XINT_igctcv_end_a #1.#2#3#4#5%
{%
    \expandafter\XINT_igctcv_end_b\expandafter
    {\romannumeral0\xintrawwithzeros {#2/#3}}%
}%
\def\XINT_igctcv_end_b #1#2{ #2{#1}}% 1.09b removes [0]
%    \end{macrocode}
% \subsection{\csh{xintCntoF}}
% \lverb|&
% Modified in 1.06 to give the N first to a \numexpr rather than expanding
% twice. I just use \the\numexpr and maintain the previous code after that.|
%    \begin{macrocode}
\def\xintCntoF {\romannumeral0\xintcntof }%
\def\xintcntof #1%
{%
    \expandafter\XINT_cntf\expandafter {\the\numexpr #1}%
}%
\def\XINT_cntf #1#2%
{%
   \ifnum #1>\xint_c_
      \xint_afterfi {\expandafter\XINT_cntf_loop\expandafter 
                     {\the\numexpr #1-1\expandafter}\expandafter
                     {\romannumeral-`0#2{#1}}{#2}}%
   \else
      \xint_afterfi 
         {\ifnum #1=\xint_c_
              \xint_afterfi {\expandafter\space \romannumeral-`0#2{0}}%
          \else \xint_afterfi { 0/1[0]}%
          \fi}%
   \fi
}%
\def\XINT_cntf_loop #1#2#3%
{%
    \ifnum #1>\xint_c_ \else \XINT_cntf_exit \fi
    \expandafter\XINT_cntf_loop\expandafter
    {\the\numexpr #1-1\expandafter }\expandafter
    {\romannumeral0\xintadd {\xintDiv {1[0]}{#2}}{#3{#1}}}%
    {#3}%
}%
\def\XINT_cntf_exit \fi 
    \expandafter\XINT_cntf_loop\expandafter
    #1\expandafter #2#3%
{%
    \fi\xint_gobble_ii #2%
}%
%    \end{macrocode}
% \subsection{\csh{xintGCntoF}}
% \lverb|&
% Modified in 1.06 to give the N first to a \numexpr rather than expanding
% twice. I just use \the\numexpr and maintain the previous code after that.|
%    \begin{macrocode}
\def\xintGCntoF {\romannumeral0\xintgcntof }%
\def\xintgcntof #1%
{%
    \expandafter\XINT_gcntf\expandafter {\the\numexpr #1}%
}%
\def\XINT_gcntf #1#2#3%
{%
   \ifnum #1>\xint_c_
      \xint_afterfi {\expandafter\XINT_gcntf_loop\expandafter 
                     {\the\numexpr #1-1\expandafter}\expandafter
                     {\romannumeral-`0#2{#1}}{#2}{#3}}%
   \else
      \xint_afterfi 
         {\ifnum #1=\xint_c_
              \xint_afterfi {\expandafter\space\romannumeral-`0#2{0}}%
          \else \xint_afterfi { 0/1[0]}%
          \fi}%
   \fi
}%
\def\XINT_gcntf_loop #1#2#3#4%
{%
    \ifnum #1>\xint_c_ \else \XINT_gcntf_exit \fi
    \expandafter\XINT_gcntf_loop\expandafter
    {\the\numexpr #1-1\expandafter }\expandafter
    {\romannumeral0\xintadd {\xintDiv {#4{#1}}{#2}}{#3{#1}}}%
    {#3}{#4}%
}%
\def\XINT_gcntf_exit \fi 
    \expandafter\XINT_gcntf_loop\expandafter
    #1\expandafter #2#3#4%
{%
    \fi\xint_gobble_ii #2%
}%
%    \end{macrocode}
% \subsection{\csh{xintCntoCs}}
% \lverb|&
% Modified in 1.06 to give the N first to a \numexpr rather than expanding
% twice. I just use \the\numexpr and maintain the previous code after that.|
%    \begin{macrocode}
\def\xintCntoCs {\romannumeral0\xintcntocs }%
\def\xintcntocs #1%
{%
    \expandafter\XINT_cntcs\expandafter {\the\numexpr #1}%
}%
\def\XINT_cntcs #1#2%
{%
   \ifnum #1<0
      \xint_afterfi { 0/1[0]}%
   \else       
      \xint_afterfi {\expandafter\XINT_cntcs_loop\expandafter 
                     {\the\numexpr #1-1\expandafter}\expandafter
                     {\expandafter{\romannumeral-`0#2{#1}}}{#2}}%
   \fi
}%
\def\XINT_cntcs_loop #1#2#3%
{%
    \ifnum #1>-1 \else \XINT_cntcs_exit \fi
    \expandafter\XINT_cntcs_loop\expandafter
    {\the\numexpr #1-1\expandafter }\expandafter 
    {\expandafter{\romannumeral-`0#3{#1}},#2}{#3}%
}%
\def\XINT_cntcs_exit \fi 
    \expandafter\XINT_cntcs_loop\expandafter
    #1\expandafter #2#3%
{%
    \fi\XINT_cntcs_exit_b #2%
}%
\def\XINT_cntcs_exit_b #1,{ }%
%    \end{macrocode}
% \subsection{\csh{xintCntoGC}}
% \lverb|&
% Modified in 1.06 to give the N first to a \numexpr rather than expanding
% twice. I just use \the\numexpr and maintain the previous code after that.|
%    \begin{macrocode}
\def\xintCntoGC {\romannumeral0\xintcntogc }%
\def\xintcntogc #1%
{%
    \expandafter\XINT_cntgc\expandafter {\the\numexpr #1}%
}%
\def\XINT_cntgc #1#2%
{%
   \ifnum #1<0
      \xint_afterfi { 0/1[0]}%
   \else       
      \xint_afterfi {\expandafter\XINT_cntgc_loop\expandafter 
                     {\the\numexpr #1-1\expandafter}\expandafter
                     {\expandafter{\romannumeral-`0#2{#1}}}{#2}}%
   \fi
}%
\def\XINT_cntgc_loop #1#2#3%
{%
    \ifnum #1>-1 \else \XINT_cntgc_exit \fi
    \expandafter\XINT_cntgc_loop\expandafter
    {\the\numexpr #1-1\expandafter }\expandafter 
    {\expandafter{\romannumeral-`0#3{#1}}+1/#2}{#3}%
}%
\def\XINT_cntgc_exit \fi 
    \expandafter\XINT_cntgc_loop\expandafter
    #1\expandafter #2#3%
{%
    \fi\XINT_cntgc_exit_b #2%
}%
\def\XINT_cntgc_exit_b #1+1/{ }%
%    \end{macrocode}
% \subsection{\csh{xintGCntoGC}}
% \lverb|&
% Modified in 1.06 to give the N first to a \numexpr rather than expanding
% twice. I just use \the\numexpr and maintain the previous code after that.|
%    \begin{macrocode}
\def\xintGCntoGC {\romannumeral0\xintgcntogc }%
\def\xintgcntogc #1%
{%
    \expandafter\XINT_gcntgc\expandafter {\the\numexpr #1}%
}%
\def\XINT_gcntgc #1#2#3%
{%
   \ifnum #1<0
      \xint_afterfi { {0/1[0]}}%
   \else       
      \xint_afterfi {\expandafter\XINT_gcntgc_loop\expandafter 
                     {\the\numexpr #1-1\expandafter}\expandafter
                     {\expandafter{\romannumeral-`0#2{#1}}}{#2}{#3}}%
   \fi
}%
\def\XINT_gcntgc_loop #1#2#3#4%
{%
    \ifnum #1>-1 \else \XINT_gcntgc_exit \fi
    \expandafter\XINT_gcntgc_loop_b\expandafter
    {\expandafter{\romannumeral-`0#4{#1}}/#2}{#3{#1}}{#1}{#3}{#4}%
}%
\def\XINT_gcntgc_loop_b #1#2#3%
{%
    \expandafter\XINT_gcntgc_loop\expandafter
    {\the\numexpr #3-1\expandafter}\expandafter
    {\expandafter{\romannumeral-`0#2}+#1}%
}%
\def\XINT_gcntgc_exit \fi
    \expandafter\XINT_gcntgc_loop_b\expandafter #1#2#3#4#5%
{%
    \fi\XINT_gcntgc_exit_b #1%
}%
\def\XINT_gcntgc_exit_b #1/{ }%
%    \end{macrocode}
% \subsection{\csh{xintCstoGC}}
%    \begin{macrocode}
\def\xintCstoGC {\romannumeral0\xintcstogc }%
\def\xintcstogc #1%
{%
    \expandafter\XINT_cstc_prep \romannumeral-`0#1,\W,%
}%
\def\XINT_cstc_prep #1,{\XINT_cstc_loop_a {{#1}}}%
\def\XINT_cstc_loop_a #1#2,%
{%
    \xint_gob_til_W #2\XINT_cstc_end\W
    \XINT_cstc_loop_b {#1}{#2}%
}%
\def\XINT_cstc_loop_b #1#2{\XINT_cstc_loop_a {#1+1/{#2}}}%
\def\XINT_cstc_end\W\XINT_cstc_loop_b #1#2{ #1}%
%    \end{macrocode}
% \subsection{\csh{xintGCtoGC}}
%    \begin{macrocode}
\def\xintGCtoGC {\romannumeral0\xintgctogc }%
\def\xintgctogc #1%
{%
    \expandafter\XINT_gctgc_start \romannumeral-`0#1+\W/%
}%
\def\XINT_gctgc_start {\XINT_gctgc_loop_a {}}%
\def\XINT_gctgc_loop_a #1#2+#3/%
{%
    \xint_gob_til_W #3\XINT_gctgc_end\W
    \expandafter\XINT_gctgc_loop_b\expandafter
    {\romannumeral-`0#2}{#3}{#1}%
}%
\def\XINT_gctgc_loop_b #1#2%
{%
    \expandafter\XINT_gctgc_loop_c\expandafter
    {\romannumeral-`0#2}{#1}%
}%
\def\XINT_gctgc_loop_c #1#2#3%
{%
    \XINT_gctgc_loop_a {#3{#2}+{#1}/}%
}%
\def\XINT_gctgc_end\W\expandafter\XINT_gctgc_loop_b
{%
    \expandafter\XINT_gctgc_end_b
}%
\def\XINT_gctgc_end_b #1#2#3{ #3{#1}}%
\XINT_restorecatcodes_endinput%
%    \end{macrocode}
%\catcode`\<=0 \catcode`\>=11 \catcode`\*=11 \catcode`\/=11
%\let</xintcfrac>\relax
%\def<*xintexpr>{\catcode`\<=12 \catcode`\>=12 \catcode`\*=12 \catcode`\/=12 }
%</xintcfrac>
%<*xintexpr>
%
% \StoreCodelineNo {xintcfrac}
%
% \section{Package \xintexprname implementation}
% 
% The first version was released in June 2013. I was greatly helped in
% this task of writing an expandable parser of infix operations by the
% comments provided in 
% |l3fp-parse.dtx|. One will recognize in particular the idea of the `until'
% macros;  I  have not looked into the actual |l3fp| code beyond the very
% useful comments provided in its documentation. 
%
% A main worry was that my data
% has no a priori bound on its size; to keep the code reasonably
% efficient, I experimented with a
% technique 
% of storing and retrieving data expandably as \emph{names} of control
% sequences. Intermediate computation results are stored as control sequences
% |\.a/b[n]|. 
%
%  Another peculiarity is that the input is allowed to contain (but only
%  where the scanner looks for a
%  number or fraction) material within braces |{...}|. This will be
%  expanded completely and must give an integer, decimal number or fraction
%  (not in scientific notation). Conversely any fraction (or macro giving
%  on expansion one such; of course this does not apply to intermediate
%  computation results, only to user input) in the 
%  |A/B[n]| format \emph{with the brackets} \textbf{must} be enclosed in
%  such braces, square brackets 
%  are not acceptable by the expression parser. 
%
% These two things are a bit \emph{experimental} and perhaps I will opt for
% another approach at a later stage. To circumvent the potential hash-table
% impact of the |\.a/b[n]| I 
% have provided the macro creators |\xintNewExpr| and |\xintNewFloatExpr|.
%
% Roughly speaking, the parser mechanism is as follows: at any given time the
% last found
% ``operator'' has its associated |until| macro awaiting some news from the
% token 
% flow; first |getnext| expands forward in the hope to construct some
% number, which may come from a parenthesized sub-expression, from some
% braced material, or from a digit by digit scan. After this number has
% been formed the next operator is looked for by the |getop| macro. Once |getop|
% has finished its job, |until| is presented with three tokens: the first one is
% the precedence level of the new found operator (which may  be an end of
% expression marker), the second is the operator character token (earlier
% versions had here already some macro name, but in order to keep as much common
% code to expr and floatexpr common as possible, this was modied) of the new
% found 
% operator, and the third 
% one is the newly found number (which was encountered just before the
% new operator).
% 
% The
% |until| macro of the earlier operator examines the precedence level of
% the new found one, and either executes the earlier operator (in the case of
% a binary operation, with the found number and a previously stored one) or it
% delays execution, giving the hand to the |until| macro of the operator
% having been found of higher precedence. 
%
% A minus sign acting as
% prefix gets converted into a (unary) operator
% inheriting the precedence level of the previous operator.
%
% Once the end of the expression is found (it has to be marked by a |\relax|)
% the final result is output as four tokens: the first one a  catcode 11
% exclamation mark, the second one an error generating macro, the third one a
% printing macro and
% the fourth is |\.a/b[n]|. The prefix
% |\xintthe| makes the output printable by killing the first two tokens.
%
% Version |1.08b| |[2013/06/14]| corrected a problem originating in the
% attempt to 
% attribute a special rôle to braces: expansion could be stopped by space
% tokens,  as various macros tried to expand without grabbing what came next.
% They now have a doubled |\romannumeral-`0|.
%
% Version |1.09a| |[2013/09/24]| has a better mechanism regarding |\xintthe|,
% more commenting and better organization of the code, and most
% importantly it implements functions, comparison operators, logic operators,
% conditionals. The code was reorganized and expansion proceeds a bit
% differently  in order to have the |_getnext| and |_getop| codes entirely
% shared by  |\xintexpr| and |\xintfloatexpr|. |\xintNewExpr| was rewritten in
% order to work with the standard macro parameter character |#|, to be catcode
% protected and to also allow comma separated expressions.
%
% \localtableofcontents
% \subsection{Catcodes, \protect\eTeX{} and reload detection}
%
% The code for reload detection is copied from \textsc{Heiko
% Oberdiek}'s packages, and adapted here to check for previous
% loading of the \xintfracname package.
%
% The method for catcodes is slightly different, but still
% directly inspired by these packages.
%
%    \begin{macrocode}
\begingroup\catcode61\catcode48\catcode32=10\relax%
  \catcode13=5    % ^^M
  \endlinechar=13 %
  \catcode123=1   % {
  \catcode125=2   % }
  \catcode64=11   % @
  \catcode35=6    % #
  \catcode44=12   % ,
  \catcode45=12   % -
  \catcode46=12   % .
  \catcode58=12   % :
  \def\space { }%
  \let\z\endgroup
  \expandafter\let\expandafter\x\csname ver@xintexpr.sty\endcsname
  \expandafter\let\expandafter\w\csname ver@xintfrac.sty\endcsname
  \expandafter
    \ifx\csname PackageInfo\endcsname\relax
      \def\y#1#2{\immediate\write-1{Package #1 Info: #2.}}%
    \else
      \def\y#1#2{\PackageInfo{#1}{#2}}%
    \fi
  \expandafter
  \ifx\csname numexpr\endcsname\relax
     \y{xintexpr}{\numexpr not available, aborting input}%
     \aftergroup\endinput
  \else
    \ifx\x\relax   % plain-TeX, first loading of xintexpr.sty
      \ifx\w\relax % but xintfrac.sty not yet loaded.
         \y{xintexpr}{Package xintfrac is required}%
         \y{xintexpr}{Will try \string\input\space xintfrac.sty}%
         \def\z{\endgroup\input xintfrac.sty\relax}%
      \fi
    \else
      \def\empty {}%
      \ifx\x\empty % LaTeX, first loading,
      % variable is initialized, but \ProvidesPackage not yet seen
          \ifx\w\relax % xintfrac.sty not yet loaded.
            \y{xintexpr}{Package xintfrac is required}%
            \y{xintexpr}{Will try \string\RequirePackage{xintfrac}}%
            \def\z{\endgroup\RequirePackage{xintfrac}}%
          \fi
      \else
        \y{xintexpr}{I was already loaded, aborting input}%
        \aftergroup\endinput
      \fi
    \fi
  \fi
\z%
%    \end{macrocode}
% \subsection{Confirmation of \xintfracname loading}
%    \begin{macrocode}
\begingroup\catcode61\catcode48\catcode32=10\relax%
  \catcode13=5    % ^^M
  \endlinechar=13 %
  \catcode123=1   % {
  \catcode125=2   % }
  \catcode64=11   % @
  \catcode35=6    % #
  \catcode44=12   % ,
  \catcode45=12   % -
  \catcode46=12   % .
  \catcode58=12   % :
  \expandafter
    \ifx\csname PackageInfo\endcsname\relax
      \def\y#1#2{\immediate\write-1{Package #1 Info: #2.}}%
    \else
      \def\y#1#2{\PackageInfo{#1}{#2}}%
    \fi
  \def\empty {}%
  \expandafter\let\expandafter\w\csname ver@xintfrac.sty\endcsname
  \ifx\w\relax % Plain TeX, user gave a file name at the prompt
      \y{xintexpr}{Loading of package xintfrac failed, aborting input}%
      \aftergroup\endinput
  \fi
  \ifx\w\empty % LaTeX, user gave a file name at the prompt
      \y{xintexpr}{Loading of package xintfrac failed, aborting input}%
      \aftergroup\endinput
  \fi
\endgroup%
%    \end{macrocode}
% \subsection{Catcodes}
%    \begin{macrocode}
\XINTsetupcatcodes%
%    \end{macrocode}
% \subsection{Package identification}
%    \begin{macrocode}
\XINT_providespackage
\ProvidesPackage{xintexpr}%
  [2013/10/03 v1.09b Expandable expression parser (jfB)]%
%    \end{macrocode}
% \subsection{Helper macros}
%    \begin{macrocode}
\def\xint_gob_til_dot #1.{}%
\def\xint_gob_til_dot_andstop #1.{ }%
\def\xint_gob_til_! #1!{}% nota bene: ! is of catcode 11
\def\XINT_expr_unexpectedtoken {\xintError:ignored }% 
\def\XINT_newexpr_stripprefix #1>{\noexpand\romannumeral-`0}%
\def\xint_firstofone  #1{#1}%
%    \end{macrocode}
% \subsection{Encapsulation in pseudo names}
%    \begin{macrocode}
\def\XINT_expr_lock #1!{\expandafter\space\csname .#1\endcsname }%
\def\XINT_expr_unlock  {\expandafter\xint_gob_til_dot\string }%
\def\XINT_expr_usethe  {use_xintthe!\xintError:use_xintthe! }%
\def\XINT_expr_done    {!\XINT_expr_usethe\XINT_expr_print }%
\def\XINT_expr_print   #1{\XINT_expr_unlock #1}%
\def\XINT_flexpr_done    {!\XINT_expr_usethe\XINT_flexpr_print }%
\def\XINT_flexpr_print  #1{\xintFloat:csv{\XINT_expr_unlock #1}}%
\def\XINT_numexpr_print #1{\xintRound:csv{\XINT_expr_unlock #1}}%
%    \end{macrocode}
% \subsection{\csh{xintexpr},~\csh{xinttheexpr},~\csh{xintthe}}
%    \begin{macrocode}
\def\xintexpr    {\romannumeral0\xinteval }%
\def\xinteval
{%
    \expandafter\XINT_expr_until_end_a \romannumeral-`0\XINT_expr_getnext
}%
\def\xinttheeval {\expandafter\xint_gobble_ii\romannumeral0\xinteval }%
\def\xinttheexpr {\romannumeral-`0\xinttheeval }%
\def\XINT_numexpr_post !\XINT_expr_usethe\XINT_expr_print%
                     { !\XINT_expr_usethe\XINT_numexpr_print }%
\def\xintnumexpr {\romannumeral0\expandafter\XINT_numexpr_post
                  \romannumeral0\xinteval }%
\def\xintthenumexpr   {\romannumeral-`0\xintthe\xintnumexpr }%
\def\xintfloatexpr    {\romannumeral0\xintfloateval }%
\def\xintfloateval
{%
    \expandafter\XINT_flexpr_until_end_a \romannumeral-`0\XINT_expr_getnext
}%
\def\xintthefloatexpr {\romannumeral-`0\xintthe\xintfloatexpr }%
\def\xintthe #1{\romannumeral-`0\expandafter\xint_gobble_ii\romannumeral-`0#1}%
%    \end{macrocode}
% \subsection{\csh{XINT\_get\_next}: looking for a number}
% \lverb|June 14: 1.08b adds a second \romannumeral-`0 to \XINT_expr_getnext in
% an attempt to solve a problem with space tokens stopping the \romannumeral
% and thus preventing expansion of the following token. For example: 1+
% \the\cnta caused a problem, as `\the' was not expanded. I did not define
% \XINT_expr_getnext as a macro with parameter (which would have cured
% preventively this), precisely to try to recognize brace pairs. The second
% \romannumeral-`0 is added for the same reason in other places.
%
% The get-next scans forward to find a number: after expansion of what
% comes next, an opening parenthesis signals a parenthesized
% sub-expression, a ! with catcode 11 signals there was there an
% \xintexpr.. \relax sub-expression (now evaluated), a minus is a prefix
% operator, a plus 
% is silently ignored, a digit or decimal point signals to start gathering
% a number, braced material {...} is allowed and will be directly fed
% into a \csname..\endcsname for complete expansion which must delivers a
% (fractional) number, possibly ending in [n]; explicit square brackets
% must be enclosed into such braces. Once a number issues from the
% previous procedures, it is a locked into a \csname...\endcsname, and the
% flow then proceeds with  \XINT_expr_getop which will scan for an infix
% or postfix operator following the number.
% 
% A special r\^ole is played by underscores _ for use with \xintNewExpr
% to input macro parameters.
%
% Release 1.09a implements functions; the idea is that a letter
% (actually, anything not otherwise recognized!)
% triggers the function name gatherer, the comma is 
% promoted to a binary operator of 
% priority intermediate between parentheses and infix operators. The code had
% some other revisions in order for all the _getnext and _getop macros to now be
% shared by \xintexpr and \xintflexpr. Perhaps some of the comments are now
% obsolete. 
% |  
%    \begin{macrocode}
\def\XINT_expr_getnext 
{%
    \expandafter\XINT_expr_getnext_checkforbraced_a
    \romannumeral-`0\romannumeral-`0%
}%
\def\XINT_expr_getnext_checkforbraced_a #1%
{%
    \XINT_expr_getnext_checkforbraced_b #1\W\Z {#1}%
}%
\def\XINT_expr_getnext_checkforbraced_b #1#2%
{%
    \xint_UDwfork
       #1\dummy \XINT_expr_getnext_emptybracepair
       #2\dummy \XINT_expr_getnext_onetoken_perhaps
       \W\dummy \XINT_expr_getnext_gotbracedstuff
    \krof
}%
\def\XINT_expr_getnext_onetoken_perhaps\Z #1%
{%
    \expandafter\XINT_expr_getnext_checkforbraced_c\expandafter
    {\romannumeral-`0#1}%
}%
\def\XINT_expr_getnext_checkforbraced_c #1%
{%
    \XINT_expr_getnext_checkforbraced_d #1\W\Z {#1}%
}%
\def\XINT_expr_getnext_checkforbraced_d #1#2%
{%
    \xint_UDwfork
       #1\dummy \XINT_expr_getnext_emptybracepair
       #2\dummy \XINT_expr_getnext_onetoken_wehope
       \W\dummy \XINT_expr_getnext_gotbracedstuff
    \krof
}% doubly braced things are not acceptable, will cause errors.
\def\XINT_expr_getnext_emptybracepair #1{\XINT_expr_getnext }%
\def\XINT_expr_getnext_gotbracedstuff #1\W\Z #2% {..} -> number/fraction
{%
    \expandafter\XINT_expr_getop\csname .#2\endcsname
}%
\def\XINT_expr_getnext_onetoken_wehope\Z #1% #1 isn't a control sequence!
{%
    \xint_gob_til_! #1\XINT_expr_subexpr !%
    \expandafter\XINT_expr_getnext_onetoken_fork\string #1%
}% after this #1 should be now a catcode 12 token.
\def\XINT_expr_subexpr !#1!{\expandafter\XINT_expr_getop\xint_gobble_ii }%
%    \end{macrocode}
% \lverb|1.09a: In order to have this code shared by \xintexpr and
% \xintfloatexpr, I 
% have moved to the until macros the responsability to choose expr or floatexpr,
% hence here, the opening parenthesis for example can not be triggered directly
% as it would not know in which context it works. Hence the \xint_c_x ({}. And
% also the mechanism of \xintNewExpr has been modified to allow use of #. |
%    \begin{macrocode}
\begingroup
\lccode`*=`#
\lowercase{\endgroup
\def\XINT_expr_sixwayfork #1(-.+*\dummy #2#3\krof {#2}%
\def\XINT_expr_getnext_onetoken_fork #1%
{% The * is in truth catcode 12 #. For (clever!) use with \xintNewExpr.
    \XINT_expr_sixwayfork
        #1-.+*\dummy  {\xint_c_x ({}}% back to until to trigger oparen
        (#1.+*\dummy   -%
        (-#1+*\dummy  {\XINT_expr_scandec_II.}%
        (-.#1*\dummy   \XINT_expr_getnext%
         (-.+#1\dummy {\XINT_expr_scandec_II}%
         (-.+*\dummy  {\XINT_expr_scan_dec_or_func #1}%
    \krof
}}%
%    \end{macrocode}
% \subsection{\csh{XINT\_expr\_scan\_dec\_or\_func}: collecting an integer or
% decimal number or function name}
%    \begin{macrocode}
\def\XINT_expr_scan_dec_or_func #1% this #1 of catcode 12
{%
    \ifnum \xint_c_ix<1#1 
        \expandafter\XINT_expr_scandec_I
    \else % We assume we are dealing with a function name!!
        \expandafter\XINT_expr_scanfunc
    \fi #1%
}%
\def\XINT_expr_scanfunc
{%
    \expandafter\XINT_expr_func\romannumeral-`0\XINT_expr_scanfunc_c
}%
\def\XINT_expr_scanfunc_c #1%
{%
    \expandafter #1\romannumeral-`0\expandafter
    \XINT_expr_scanfunc_a\romannumeral-`0\romannumeral-`0%
}%
\def\XINT_expr_scanfunc_a #1% please no braced things here!
{%
    \ifcat #1\relax % missing opening parenthesis, probably
        \expandafter\XINT_expr_scanfunc_panic
    \else
        \xint_afterfi{\expandafter\XINT_expr_scanfunc_b \string #1}%
    \fi
}%
\def\XINT_expr_scanfunc_b #1%
{%
    \if #1(\else\expandafter \XINT_expr_scanfunc_c \fi #1%
}%
\def\XINT_expr_scanfunc_panic {\xintError:bigtroubleahead(0\relax }%
%    \end{macrocode}
% \lverb|1.09a: functions are a new component, and here also we do not know if
% we are in an \xintexpr or an \xintfloatexpr. Hence the method with the @.|
%    \begin{macrocode}
\def\XINT_expr_func #1(% common to expr and flexpr
{%
    \xint_c_x @{#1}% 
}%
\def\XINT_expr_scandec_I
{%
    \expandafter\XINT_expr_getop\romannumeral-`0\expandafter
    \XINT_expr_lock\romannumeral-`0\XINT_expr_scanintpart_b
}%
\def\XINT_expr_scandec_II
{%
    \expandafter\XINT_expr_getop\romannumeral-`0\expandafter
    \XINT_expr_lock\romannumeral-`0\XINT_expr_scanfracpart_b
}%
\def\XINT_expr_scanintpart_a #1% 
{%
    \ifnum \xint_c_ix<1\string#1
       \expandafter\expandafter\expandafter\XINT_expr_scanintpart_b
       \expandafter\string
    \else
       \if #1.% 
           \expandafter\expandafter\expandafter
           \XINT_expr_scandec_transition
       \else
           \expandafter\expandafter\expandafter !% ! of catcode 11...
       \fi
    \fi
    #1%
}%
\def\XINT_expr_scanintpart_b #1%
{%
    \expandafter #1\romannumeral-`0\expandafter
    \XINT_expr_scanintpart_a\romannumeral-`0\romannumeral-`0%
}%
\def\XINT_expr_scandec_transition #1%
{%
    \expandafter.\romannumeral-`0\expandafter
    \XINT_expr_scanfracpart_a\romannumeral-`0\romannumeral-`0%
}%
\def\XINT_expr_scanfracpart_a #1%
{%
    \ifnum \xint_c_ix<1\string#1
       \expandafter\expandafter\expandafter\XINT_expr_scanfracpart_b
       \expandafter\string
    \else
       \expandafter !%
    \fi
    #1%
}%
\def\XINT_expr_scanfracpart_b #1%
{%
    \expandafter #1\romannumeral-`0\expandafter
    \XINT_expr_scanfracpart_a\romannumeral-`0\romannumeral-`0%
}%
%    \end{macrocode}
% \subsection{\csh{XINT\_expr\_getop}: looking for an operator}
% \lverb|June 14 (1.08b): I add here a second \romannumeral-`0, because
% \XINT_expr_getnext and others try to expand the next token
% but without grabbing it.
%
% This finds the next infix operator or closing parenthesis or postfix
% exclamation mark !
% or expression end. It then leaves in the token flow
% <precedence> <operator> <locked number>. The <precedence> is generally
% a character command which thus stops expansion and gives back control to an
% \XINT_expr_until_<op> command; or it is the minus sign which will be
% converted by a suitable \XINT_expr_checkifprefix_<p> into an operator
% with a given inherited precedence; or, in the case of the postfix!,
% <precedence> is 
% \empty, expansion goes on with <operator_!> which does the factorial
% on the locked number and then re-activates \XINT_expr_getop.
%
% In versions earlier than 1.09a the <operator> was already made in to a control
% sequence; but now it is a left as a token and will be converted by the until
% macro which knows if it is in a \xintexpr or an \xintfloatexpr.
% | 
%    \begin{macrocode}
\def\XINT_expr_getop #1% this #1 is the current locked computed value
{%  full expansion of next token, first swallowing a possible space
    \expandafter\XINT_expr_getop_a\expandafter #1%
    \romannumeral-`0\romannumeral-`0%
}%
\def\XINT_expr_getop_a #1#2%
{%  if an un-expandable control sequence is found, must be the ending \relax
    \ifcat #2\relax
        \ifx #2\relax 
             \expandafter\expandafter\expandafter
             \XINT_expr_foundend
        \else
             \XINT_expr_unexpectedtoken
             \expandafter\expandafter\expandafter
             \XINT_expr_getop
        \fi
    \else               
        \expandafter\XINT_expr_foundop\expandafter #2%
    \fi
    #1%
}%
\def\XINT_expr_foundend {\xint_c_ \relax }% \relax is a place holder here.
\def\XINT_expr_foundop #1% then becomes <prec> <op> and is followed by <\.f>
{%  1.09a: no control sequence \XINT_expr_op_#1, code common to expr/flexpr
    \ifcsname XINT_expr_precedence_#1\endcsname
        \expandafter\xint_afterfi\expandafter 
        {\csname XINT_expr_precedence_#1\endcsname #1}%
    \else
        \XINT_expr_unexpectedtoken
        \expandafter\XINT_expr_getop
    \fi
}%
%    \end{macrocode}
% \subsection{Parentheses}
% \lverb|1.09a removes some doubling of \romannumeral-`\0 from 1.08b
% which served no useful purpose here (I think...). |
%    \begin{macrocode}
\def\xint_tmp_do_defs #1#2#3#4#5%
{%
    \def#1##1%
    {%
        \xint_UDsignfork
                     ##1\dummy {\expandafter#1\romannumeral-`0#3}%
                       -\dummy  {#2##1}%
        \krof 
    }%
    \def#2##1##2%
    {%
        \ifcase ##1\expandafter #4%
        \or   \xint_afterfi{%
                \XINT_expr_extra_closing_paren 
                \expandafter #1\romannumeral-`0\XINT_expr_getop
                 }%
        \else \xint_afterfi{%
                \expandafter#1\romannumeral-`0\csname XINT_#5_op_##2\endcsname
                 }%
        \fi
    }%
}%
\expandafter\xint_tmp_do_defs
    \csname XINT_expr_until_end_a\expandafter\endcsname
    \csname XINT_expr_until_end_b\expandafter\endcsname
    \csname XINT_expr_op_-vi\expandafter\endcsname 
    \csname XINT_expr_done\endcsname 
    {expr}%
\expandafter\xint_tmp_do_defs
    \csname XINT_flexpr_until_end_a\expandafter\endcsname
    \csname XINT_flexpr_until_end_b\expandafter\endcsname
    \csname XINT_flexpr_op_-vi\expandafter\endcsname 
    \csname XINT_flexpr_done\endcsname 
    {flexpr}%
\def\XINT_expr_extra_closing_paren {\xintError:removed }%
\def\xint_tmp_do_defs #1#2#3#4#5#6%
{%
    \def #1{\expandafter #3\romannumeral-`0\XINT_expr_getnext }%
    \let #2#1%
    \def #3##1{\xint_UDsignfork
                ##1\dummy {\expandafter #3\romannumeral-`0#5}%
                  -\dummy  {#4##1}%
               \krof }%
    \def #4##1##2%
    {%
        \ifcase ##1\expandafter \XINT_expr_missing_cparen
             \or   \expandafter \XINT_expr_getop
             \else \xint_afterfi
        {\expandafter #3\romannumeral-`0\csname XINT_#6_op_##2\endcsname }%
        \fi
    }%
}%
\expandafter\xint_tmp_do_defs
    \csname XINT_expr_op_(\expandafter\endcsname
    \csname XINT_expr_oparen\expandafter\endcsname
    \csname XINT_expr_until_)_a\expandafter\endcsname
    \csname XINT_expr_until_)_b\expandafter\endcsname
    \csname XINT_expr_op_-vi\endcsname 
    {expr}%
\expandafter\xint_tmp_do_defs
    \csname XINT_flexpr_op_(\expandafter\endcsname
    \csname XINT_flexpr_oparen\expandafter\endcsname
    \csname XINT_flexpr_until_)_a\expandafter\endcsname
    \csname XINT_flexpr_until_)_b\expandafter\endcsname
    \csname XINT_flexpr_op_-vi\endcsname 
    {flexpr}%
\def\XINT_expr_missing_cparen {\xintError:inserted \xint_c_ \XINT_expr_done }%
\expandafter\let\csname XINT_expr_precedence_)\endcsname \xint_c_i
\expandafter\let\csname XINT_expr_op_)\endcsname\XINT_expr_getop
\expandafter\let\csname XINT_flexpr_precedence_)\endcsname \xint_c_i
\expandafter\let\csname XINT_flexpr_op_)\endcsname\XINT_expr_getop
%    \end{macrocode}
% \subsection{The \csh{XINT\_expr\_until\_<op>} macros for boolean operators,
% comparison operators, arithmetic operators, scientfic notation.}
% \lverb|Extended in 1.09a with comparison and boolean operators.|
%    \begin{macrocode}
\def\xint_tmp_def #1#2#3#4#5#6%
{%
    \expandafter\xint_tmp_do_defs
    \csname XINT_#1_op_#3\expandafter\endcsname
    \csname XINT_#1_until_#3_a\expandafter\endcsname
    \csname XINT_#1_until_#3_b\expandafter\endcsname
    \csname XINT_#1_op_-#5\expandafter\endcsname
    \csname xint_c_#4\expandafter\endcsname
    \csname #2#6\expandafter\endcsname 
    \csname XINT_expr_precedence_#3\endcsname {#1}%
}%
\def\xint_tmp_do_defs #1#2#3#4#5#6#7#8%
{%
    \def #1##1% \XINT_expr_op_<op>
    {% keep value, get next number and operator, then do until
        \expandafter #2\expandafter ##1%
        \romannumeral-`0\expandafter\XINT_expr_getnext 
    }%
    \def #2##1##2% \XINT_expr_until_<op>_a
    {\xint_UDsignfork
        ##2\dummy {\expandafter #2\expandafter ##1\romannumeral-`0#4}%
          -\dummy {#3##1##2}%
     \krof }%
    \def #3##1##2##3##4% \XINT_expr_until_<op>_b
    {%  either execute next operation now, or first do next (possibly unary) 
      \ifnum ##2>#5%
        \xint_afterfi {\expandafter #2\expandafter ##1\romannumeral-`0%
                       \csname XINT_#8_op_##3\endcsname {##4}}%
      \else
        \xint_afterfi 
        {\expandafter ##2\expandafter ##3%
         \csname .#6{\XINT_expr_unlock ##1}{\XINT_expr_unlock ##4}\endcsname }%
      \fi
    }%
    \let #7#5%
}%
\def\xint_tmp_def_a #1{\xint_tmp_def {expr}{xint}#1}%
\xintApplyInline {\xint_tmp_def_a }{%
  {|{iii}{vi}{OR}}%
  {&{iv}{vi}{AND}}%
  {<{v}{vi}{Lt}}%
  {>{v}{vi}{Gt}}%
  {={v}{vi}{Eq}}%
  {+{vi}{vi}{Add}}%
  {-{vi}{vi}{Sub}}%
  {*{vii}{vii}{Mul}}%
  {/{vii}{vii}{Div}}%
  {^{viii}{viii}{Pow}}%
  {e{ix}{ix}{fE}}%
  {E{ix}{ix}{fE}}%
}%
\def\xint_tmp_def_a #1{\xint_tmp_def {flexpr}{xint}#1}%
\xintApplyInline {\xint_tmp_def_a }{%
  {|{iii}{vi}{OR}}%
  {&{iv}{vi}{AND}}%
  {<{v}{vi}{Lt}}%
  {>{v}{vi}{Gt}}%
  {={v}{vi}{Eq}}%
}%
\def\xint_tmp_def_a #1{\xint_tmp_def {flexpr}{XINTinFloat}#1}%
\xintApplyInline {\xint_tmp_def_a }{%
  {+{vi}{vi}{Add}}%
  {-{vi}{vi}{Sub}}%
  {*{vii}{vii}{Mul}}%
  {/{vii}{vii}{Div}}%
  {^{viii}{viii}{Power}}%
  {e{ix}{ix}{fE}}%
  {E{ix}{ix}{fE}}%
}%
\let\xint_tmp_def_a\empty
%    \end{macrocode}
% \subsection{The comma as binary operator}
% \lverb|New with 1.09a.|
%    \begin{macrocode}
\def\xint_tmp_do_defs #1#2#3#4#5#6%
{%
    \def #1##1% \XINT_expr_op_,_a
    {%
        \expandafter #2\expandafter ##1\romannumeral-`0\XINT_expr_getnext 
    }%
    \def #2##1##2% \XINT_expr_until_,_a
    {\xint_UDsignfork
        ##2\dummy {\expandafter #2\expandafter ##1\romannumeral-`0#4}%
          -\dummy {#3##1##2}%
     \krof }%
    \def #3##1##2##3##4% \XINT_expr_until_,_b
    {%
      \ifnum ##2>\xint_c_ii
        \xint_afterfi {\expandafter #2\expandafter ##1\romannumeral-`0%
                       \csname XINT_#6_op_##3\endcsname {##4}}%
      \else
        \xint_afterfi 
        {\expandafter ##2\expandafter ##3%
         \csname .\XINT_expr_unlock ##1,\XINT_expr_unlock ##4\endcsname }%
      \fi
    }%
    \let #5\xint_c_ii
}%
\expandafter\xint_tmp_do_defs
    \csname XINT_expr_op_,\expandafter\endcsname
    \csname XINT_expr_until_,_a\expandafter\endcsname
    \csname XINT_expr_until_,_b\expandafter\endcsname
    \csname XINT_expr_op_-vi\expandafter\endcsname 
    \csname XINT_expr_precedence_,\endcsname {expr}%
\expandafter\xint_tmp_do_defs
    \csname XINT_flexpr_op_,\expandafter\endcsname
    \csname XINT_flexpr_until_,_a\expandafter\endcsname
    \csname XINT_flexpr_until_,_b\expandafter\endcsname
    \csname XINT_flexpr_op_-vi\expandafter\endcsname 
    \csname XINT_expr_precedence_,\endcsname {flexpr}%
%    \end{macrocode}
% \subsection{? as two-way conditional}
% \lverb|New with 1.09a.|
%    \begin{macrocode}
\def \XINT_expr_precedence_? #1#2#3#4% 
{%
        \xintifZero{\XINT_expr_unlock  #2}%
                   {\XINT_expr_getnext #4}%
                   {\XINT_expr_getnext #3}%
}%
%    \end{macrocode}
% \subsection{: as three-way conditional}
% \lverb|New with 1.09a.|
%    \begin{macrocode}
\def \XINT_expr_precedence_: #1#2#3#4#5% 
{%
        \xintifSgn {\XINT_expr_unlock  #2}%
                   {\XINT_expr_getnext #3}%
                   {\XINT_expr_getnext #4}%
                   {\XINT_expr_getnext #5}%
}%
%    \end{macrocode}
% \subsection{\csh{XINT\_expr\_op\_-<level>}: minus as prefix inherits its precedence level}
%    \begin{macrocode}
\def\xint_tmp_def #1#2%
{%
    \expandafter\xint_tmp_do_defs
    \csname XINT_#1_op_-#2\expandafter\endcsname
    \csname XINT_#1_until_-#2_a\expandafter\endcsname
    \csname XINT_#1_until_-#2_b\expandafter\endcsname
    \csname xint_c_#2\endcsname {#1}%
}%
\def\xint_tmp_do_defs #1#2#3#4#5%
{%
    \def #1% \XINT_expr_op_-<level> 
    {%  get next number+operator then switch to _until macro
        \expandafter #2\romannumeral-`0\XINT_expr_getnext 
    }%
    \def #2##1% \XINT_expr_until_-<l>_a
    {\xint_UDsignfork
        ##1\dummy {\expandafter #2\romannumeral-`0#1}%
          -\dummy {#3##1}%
     \krof }%
    \def #3##1##2##3% \XINT_expr_until_-<l>_b
    {%  _until tests precedence level with next op, executes now or postpones
        \ifnum ##1>#4%
         \xint_afterfi {\expandafter #2\romannumeral-`0%
                        \csname XINT_#5_op_##2\endcsname {##3}}%
        \else
         \xint_afterfi {\expandafter ##1\expandafter ##2%
                        \csname .\xintOpp{\XINT_expr_unlock ##3}\endcsname }%
        \fi
    }%
}%
\xintApplyInline{\xint_tmp_def {expr}}{{vi}{vii}{viii}{ix}}%
\xintApplyInline{\xint_tmp_def {flexpr}}{{vi}{vii}{viii}{ix}}%
%    \end{macrocode}
% \subsection{! as postfix factorial operator of highest precedence}
% \lverb|\XINT_expr_precedence_! is not a \chardef constant indicating a
% precedence level but it  gets executed immediately on the number is followed.
% It acts the same in \xintexpr and \xintfloatexpr and triggers the exact
% \xintFac.| 
%    \begin{macrocode}
\expandafter\def\csname XINT_expr_precedence_!\endcsname #1#2%
      {\expandafter\XINT_expr_getop
       \csname .\xintFac{\XINT_expr_unlock #2}[0]\endcsname }%
%    \end{macrocode}
% \subsection{Functions}
% \lverb|New with 1.09a.|
%    \begin{macrocode}
\let\xint_tmp_def\empty
\let\xint_tmp_do_defs\empty
\def\XINT_expr_op_@ #1%
{%
    \ifcsname XINT_expr_func_#1\endcsname
    \xint_afterfi{%
        \expandafter\expandafter\csname XINT_expr_func_#1\endcsname 
         }%
    \else \xintError:unknownfunction
          \xint_afterfi{\expandafter\XINT_expr_func_unknown}%
    \fi
    \romannumeral-`0\XINT_expr_oparen
}%
\def\XINT_flexpr_op_@ #1%
{%
    \ifcsname XINT_flexpr_func_#1\endcsname
    \xint_afterfi{%
        \expandafter\expandafter\csname XINT_flexpr_func_#1\endcsname 
         }%
    \else \xintError:unknownfunction
        \xint_afterfi{\expandafter\XINT_expr_func_unknown}%
    \fi
    \romannumeral-`0\XINT_flexpr_oparen
}%
\def\XINT_expr_func_unknown #1#2#3%
{%
    \expandafter #1\expandafter #2\csname .0[0]\endcsname
}%
\def\XINT_expr_func_reduce #1#2#3% 
{%
    \expandafter #1\expandafter #2\csname 
         .\xintIrr {\XINT_expr_unlock #3}\endcsname 
}%
\let\XINT_flexpr_func_reduce\XINT_expr_func_reduce
\def\XINT_expr_func_sqr #1#2#3%
{%
    \expandafter #1\expandafter #2\csname 
         .\xintSqr {\XINT_expr_unlock #3}\endcsname 
}%
\def\XINT_flexpr_func_sqr #1#2#3%
{%
    \expandafter #1\expandafter #2\csname 
    .\XINTinFloatMul {\XINT_expr_unlock #3}{\XINT_expr_unlock #3}\endcsname 
}%
\def\XINT_expr_func_abs #1#2#3%
{%
    \expandafter #1\expandafter #2\csname 
         .\xintAbs {\XINT_expr_unlock #3}\endcsname 
}%
\let\XINT_flexpr_func_abs\XINT_expr_func_abs
\def\XINT_expr_func_sgn #1#2#3%
{%
    \expandafter #1\expandafter #2\csname 
         .\xintSgn {\XINT_expr_unlock #3}\endcsname 
}%
\let\XINT_flexpr_func_sgn\XINT_expr_func_sgn
\def\XINT_expr_func_floor #1#2#3%
{%
    \expandafter #1\expandafter #2\csname 
         .\xintFloor {\XINT_expr_unlock #3}\endcsname 
}%
\let\XINT_flexpr_func_floor\XINT_expr_func_floor
\def\XINT_expr_func_ceil #1#2#3%
{%
    \expandafter #1\expandafter #2\csname 
         .\xintCeil {\XINT_expr_unlock #3}\endcsname 
}%
\let\XINT_flexpr_func_ceil\XINT_expr_func_ceil
\def\XINT_expr_twoargs #1,#2,{{#1}{#2}}%
\def\XINT_expr_func_quo #1#2#3%
{%
    \expandafter #1\expandafter #2\csname .%
    \expandafter\expandafter\expandafter\xintQuo
    \expandafter\XINT_expr_twoargs 
    \romannumeral-`0\XINT_expr_unlock #3,\endcsname 
}%
\let\XINT_flexpr_func_quo\XINT_expr_func_quo
\def\XINT_expr_func_rem #1#2#3%
{%
    \expandafter #1\expandafter #2\csname .%
    \expandafter\expandafter\expandafter\xintRem
    \expandafter\XINT_expr_twoargs 
    \romannumeral-`0\XINT_expr_unlock #3,\endcsname 
}%
\let\XINT_flexpr_func_rem\XINT_expr_func_rem
\def\XINT_expr_oneortwo #1#2#3,#4,#5.%
{%
    \if\relax#5\relax\expandafter\xint_firstoftwo\else
                     \expandafter\xint_secondoftwo\fi
    {#1{0}{#3}}{#2{\xintNum {#4}}{#3}}%
}%
\def\XINT_expr_func_round #1#2#3%
{%
    \expandafter #1\expandafter #2\csname .%
    \expandafter\XINT_expr_oneortwo
    \expandafter\xintiRound\expandafter\xintRound 
    \romannumeral-`0\XINT_expr_unlock #3,,.\endcsname 
}%
\let\XINT_flexpr_func_round\XINT_expr_func_round
\def\XINT_expr_func_trunc #1#2#3%
{%
    \expandafter #1\expandafter #2\csname .%
    \expandafter\XINT_expr_oneortwo
    \expandafter\xintiTrunc\expandafter\xintTrunc
    \romannumeral-`0\XINT_expr_unlock #3,,.\endcsname 
}%
\let\XINT_flexpr_func_trunc\XINT_expr_func_trunc
\def\XINT_expr_argandopt #1,#2,#3.%
{%
    \if\relax#3\relax\expandafter\xint_firstoftwo\else
                     \expandafter\xint_secondoftwo\fi
    {[\XINTdigits]{#1}}{[\xintNum {#2}]{#1}}%
}%
\def\XINT_expr_func_float #1#2#3%
{%
    \expandafter #1\expandafter #2\csname .%
    \expandafter\XINTinFloat
    \romannumeral-`0\expandafter\XINT_expr_argandopt
    \romannumeral-`0\XINT_expr_unlock #3,,.\endcsname 
}%
\let\XINT_flexpr_func_float\XINT_expr_func_float
\def\XINT_expr_func_sqrt #1#2#3%
{%
    \expandafter #1\expandafter #2\csname .%
    \expandafter\XINTinFloatSqrt
    \romannumeral-`0\expandafter\XINT_expr_argandopt
    \romannumeral-`0\XINT_expr_unlock #3,,.\endcsname 
}%
\let\XINT_flexpr_func_sqrt\XINT_expr_func_sqrt
\def\XINT_expr_func_gcd #1#2#3%
{%
    \expandafter #1\expandafter #2\csname 
              .\xintGCDof:csv{\XINT_expr_unlock #3}\endcsname 
}%
\let\XINT_flexpr_func_gcd\XINT_expr_func_gcd
\def\XINT_expr_func_lcm #1#2#3%
{%
    \expandafter #1\expandafter #2\csname 
              .\xintLCMof:csv{\XINT_expr_unlock #3}\endcsname 
}%
\let\XINT_flexpr_func_lcm\XINT_expr_func_lcm
\def\XINT_expr_func_max #1#2#3%
{%
    \expandafter #1\expandafter #2\csname 
              .\xintMaxof:csv{\XINT_expr_unlock #3}\endcsname 
}%
\def\XINT_flexpr_func_max #1#2#3%
{%
    \expandafter #1\expandafter #2\csname 
              .\xintFloatMaxof:csv{\XINT_expr_unlock #3}\endcsname 
}%
\def\XINT_expr_func_min #1#2#3%
{%
    \expandafter #1\expandafter #2\csname 
              .\xintMinof:csv{\XINT_expr_unlock #3}\endcsname 
}%
\def\XINT_flexpr_func_min #1#2#3%
{%
    \expandafter #1\expandafter #2\csname 
              .\xintFloatMinof:csv{\XINT_expr_unlock #3}\endcsname 
}%
\def\XINT_expr_func_sum #1#2#3%
{%
    \expandafter #1\expandafter #2\csname 
              .\xintSum:csv{\XINT_expr_unlock #3}\endcsname 
}%
\def\XINT_flexpr_func_sum #1#2#3%
{%
    \expandafter #1\expandafter #2\csname 
              .\xintFloatSum:csv{\XINT_expr_unlock #3}\endcsname 
}%
\def\XINT_expr_func_prd #1#2#3%
{%
    \expandafter #1\expandafter #2\csname 
              .\xintPrd:csv{\XINT_expr_unlock #3}\endcsname 
}%
\def\XINT_flexpr_func_prd #1#2#3%
{%
    \expandafter #1\expandafter #2\csname 
              .\xintFloatPrd:csv{\XINT_expr_unlock #3}\endcsname 
}%
\let\XINT_expr_func_add\XINT_expr_func_sum
\let\XINT_expr_func_mul\XINT_expr_func_prd
\let\XINT_flexpr_func_add\XINT_flexpr_func_sum
\let\XINT_flexpr_func_mul\XINT_flexpr_func_prd
\def\XINT_expr_func_? #1#2#3% 
{%
    \expandafter #1\expandafter #2\csname 
         .\xintIsNotZero {\XINT_expr_unlock #3}\endcsname 
}%
\let\XINT_flexpr_func_? \XINT_expr_func_?
\def\XINT_expr_func_! #1#2#3% 
{%
    \expandafter #1\expandafter #2\csname 
         .\xintIsZero {\XINT_expr_unlock #3}\endcsname 
}%
\let\XINT_flexpr_func_! \XINT_expr_func_!
\def\XINT_expr_func_not #1#2#3% 
{%
    \expandafter #1\expandafter #2\csname 
         .\xintIsZero {\XINT_expr_unlock #3}\endcsname 
}%
\let\XINT_flexpr_func_not \XINT_expr_func_not
\def\XINT_expr_func_all #1#2#3%
{%
    \expandafter #1\expandafter #2\csname 
              .\xintANDof:csv{\XINT_expr_unlock #3}\endcsname 
}%
\let\XINT_flexpr_func_all\XINT_expr_func_all
\def\XINT_expr_func_any #1#2#3%
{%
    \expandafter #1\expandafter #2\csname 
              .\xintORof:csv{\XINT_expr_unlock #3}\endcsname 
}%
\let\XINT_flexpr_func_any\XINT_expr_func_any
\def\XINT_expr_func_xor #1#2#3%
{%
    \expandafter #1\expandafter #2\csname 
              .\xintXORof:csv{\XINT_expr_unlock #3}\endcsname 
}%
\let\XINT_flexpr_func_xor\XINT_expr_func_xor
\def\xintifNotZero:: #1,#2,#3,{\xintifNotZero{#1}{#2}{#3}}%
\def\XINT_expr_func_if #1#2#3%
{%
    \expandafter #1\expandafter #2\csname 
              .\expandafter\xintifNotZero::
               \romannumeral-`0\XINT_expr_unlock #3,\endcsname 
}%
\let\XINT_flexpr_func_if\XINT_expr_func_if
\def\xintifSgn:: #1,#2,#3,#4,{\xintifSgn{#1}{#2}{#3}{#4}}%
\def\XINT_expr_func_ifsgn #1#2#3%
{%
    \expandafter #1\expandafter #2\csname 
              .\expandafter\xintifSgn::
               \romannumeral-`0\XINT_expr_unlock #3,\endcsname 
}%
\let\XINT_flexpr_func_ifsgn\XINT_expr_func_ifsgn
%    \end{macrocode}
% \subsection{\csh{xintNewExpr}}
% \lverb|&
% Rewritten in 1.09a. Now, the parameters of the formula are entered in the
% usual way by the user, with # not _. And _ is assigned to make macros
% not expand. This way, : is freed, as we now need it for the ternary operator.
% (on numeric data; if use with macro parameters, should be coded with the
% functionn ifsgn , rather)|
%    \begin{macrocode}
\def\XINT_newexpr_print #1{\ifnum\xintNthElt{0}{#1}>1
                            \expandafter\xint_firstoftwo
                           \else
                            \expandafter\xint_secondoftwo
                           \fi
                           {_xintListWithSep,{#1}}{\xint_firstofone#1}}%
\def\XINT_expr_tmp #1%
    {\expandafter\def\csname xint#1\endcsname {_xint#1}}%
\expandafter\def\expandafter\XINT_expr_protect\expandafter
{%
    \romannumeral0%
    \xintapplyunbraced\XINT_expr_tmp{\xintCSVtoList{%
        Floor,Ceil,iRound,Round,iTrunc,Trunc,%
        Lt,Gt,Eq,AND,OR,%
        IsNotZero,IsZero,%
        ifNotZero,ifSgn,%
        Irr,Num,Abs,Sgn,Opp,Quo,Rem,%
        Add,Sub,Mul,Sqr,Div,Pow,Fac,fE}}%
        \def\xintGCDof:csv ##1{_xintGCDof {\xintCSVtoList {##1}}}%
        \def\xintLCMof:csv ##1{_xintLCMof {\xintCSVtoList {##1}}}%
        \def\xintMaxof:csv ##1{_xintMaxof {\xintCSVtoList {##1}}}%
        \def\xintMinof:csv ##1{_xintMinof {\xintCSVtoList {##1}}}%
        \def\xintSum:csv ##1{_xintSum {\xintCSVtoList {##1}}}%
        \def\xintPrd:csv ##1{_xintPrd {\xintCSVtoList {##1}}}%
        \def\xintANDof:csv ##1{_xintANDof {\xintCSVtoList {##1}}}%
        \def\xintORof:csv  ##1{_xintORof {\xintCSVtoList {##1}}}%
        \def\xintXORof:csv ##1{_xintXORof {\xintCSVtoList {##1}}}%
        \def\XINTinFloat     {_XINTinFloat}%
        \def\XINTinFloatSqrt {_XINTinFloatSqrt}%
        \def\XINTdigits      {_XINTdigits}%
        \def\XINT_expr_print ##1{\expandafter\XINT_newexpr_print\expandafter
                {\romannumeral0\xintcsvtolist{\XINT_expr_unlock ##1}}}%
}%
\catcode`* 13
\def\xintNewExpr #1[#2]%
{%
   \begingroup
    \ifcase #2\relax
        \toks0 {\xdef #1}%
    \or \toks0 {\xdef #1##1}%
    \or \toks0 {\xdef #1##1##2}%
    \or \toks0 {\xdef #1##1##2##3}%
    \or \toks0 {\xdef #1##1##2##3##4}%
    \or \toks0 {\xdef #1##1##2##3##4##5}%
    \or \toks0 {\xdef #1##1##2##3##4##5##6}%
    \or \toks0 {\xdef #1##1##2##3##4##5##6##7}%
    \or \toks0 {\xdef #1##1##2##3##4##5##6##7##8}%
    \or \toks0 {\xdef #1##1##2##3##4##5##6##7##8##9}%
    \fi
    \xintexprSafeCatcodes
    \XINT_NewExpr
}%
\def\XINT_NewExpr #1%
{%
    \def\xintTmp ##1##2##3##4##5##6##7##8##9{#1}% 
    \XINT_expr_protect
    \lccode`\*=`_ \lowercase {\def*}{!noexpand!}%
    \catcode`_ 13 \catcode`: 11 \endlinechar -1 
    \everyeof {\noexpand }%
    \edef\XINTtmp ##1##2##3##4##5##6##7##8##9%
        {\scantokens
         \expandafter{\romannumeral-`0\xinttheexpr 
                      \xintTmp {####1}{####2}{####3}%
                               {####4}{####5}{####6}%
                               {####7}{####8}{####9}%
                      \relax}}%
     \lccode`\*=`\$ \lowercase {\def*}{####}%  
     \catcode`\$ 13 \catcode`! 0 \catcode`_ 11 %
     \the\toks0 
     {\scantokens\expandafter{\expandafter
                 \XINT_newexpr_stripprefix\meaning\XINTtmp}}%
\endgroup
}%    
%    \end{macrocode}
% \subsection{\csh{xintNewFloatExpr}}
%    \begin{macrocode}
\def\XINT_newflexpr_print #1{\ifnum\xintNthElt{0}{#1}>1
                            \expandafter\xint_firstoftwo
                           \else
                            \expandafter\xint_secondoftwo
                           \fi
                           {_xintListWithSep,{\xintApply{_xintFloat}{#1}}}
                           {_xintFloat#1}}%
\expandafter\def\expandafter\XINT_flexpr_protect\expandafter
{%
    \romannumeral0%
    \xintapplyunbraced\XINT_expr_tmp{\xintCSVtoList{%
        Floor,Ceil,iRound,Round,iTrunc,Trunc,%
        Lt,Gt,Eq,AND,OR,%
        IsNotZero,IsZero,%
        ifNotZero,ifSgn,%
        Irr,Num,Abs,Sgn,Opp,Quo,Rem,Fac}}%
        \def\xintGCDof:csv ##1{_xintGCDof {\xintCSVtoList {##1}}}%
        \def\xintLCMof:csv ##1{_xintLCMof {\xintCSVtoList {##1}}}%
        \def\xintFloatMaxof:csv ##1{_xintFloatMaxof {\xintCSVtoList {##1}}}%
        \def\xintFloatMinof:csv ##1{_xintFloatMinof {\xintCSVtoList {##1}}}%
        \def\xintFloatSum:csv ##1{_xintFloatSum {\xintCSVtoList {##1}}}%
        \def\xintFloatPrd:csv ##1{_xintFloatPrd {\xintCSVtoList {##1}}}%
        \def\xintANDof:csv ##1{_xintANDof {\xintCSVtoList {##1}}}%
        \def\xintORof:csv  ##1{_xintORof {\xintCSVtoList {##1}}}%
        \def\xintXORof:csv ##1{_xintXORof {\xintCSVtoList {##1}}}%
        \def\XINTinFloat      {_XINTinFloat}%
        \def\XINTinFloatSqrt  {_XINTinFloatSqrt}%
        \def\XINTinFloatAdd   {_XINTinFloatAdd}%
        \def\XINTinFloatSub   {_XINTinFloatSub}%
        \def\XINTinFloatMul   {_XINTinFloatMul}%
        \def\XINTinFloatDiv   {_XINTinFloatDiv}%
        \def\XINTinFloatPower {_XINTinFloatPower}%
        \def\XINTinFloatfE    {_XINTinFloatfE}%
        \def\XINTdigits       {_XINTdigits}%
        \def\XINT_flexpr_print ##1{\expandafter\XINT_newflexpr_print\expandafter
                {\romannumeral0\xintcsvtolist{\XINT_expr_unlock ##1}}}%
}%
\let\XINT_expr_tmp\empty
\def\xintNewFloatExpr #1[#2]%
{%
   \begingroup
    \ifcase #2\relax
        \toks0 {\xdef #1}%
    \or \toks0 {\xdef #1##1}%
    \or \toks0 {\xdef #1##1##2}%
    \or \toks0 {\xdef #1##1##2##3}%
    \or \toks0 {\xdef #1##1##2##3##4}%
    \or \toks0 {\xdef #1##1##2##3##4##5}%
    \or \toks0 {\xdef #1##1##2##3##4##5##6}%
    \or \toks0 {\xdef #1##1##2##3##4##5##6##7}%
    \or \toks0 {\xdef #1##1##2##3##4##5##6##7##8}%
    \or \toks0 {\xdef #1##1##2##3##4##5##6##7##8##9}%
    \fi
    \xintexprSafeCatcodes
    \XINT_NewFloatExpr 
}%
\def\XINT_NewFloatExpr #1%
{%
    \def\xintTmp ##1##2##3##4##5##6##7##8##9{#1}% 
    \XINT_flexpr_protect
    \lccode`\*=`_ \lowercase {\def*}{!noexpand!}%
    \catcode`_ 13 \catcode`: 11 \endlinechar -1 %
    \everyeof {\noexpand }%
    \edef\XINTtmp ##1##2##3##4##5##6##7##8##9%
        {\scantokens
         \expandafter{\romannumeral-`0\xintthefloatexpr
                      \xintTmp {####1}{####2}{####3}%
                               {####4}{####5}{####6}%
                               {####7}{####8}{####9}%
                      \relax}}%
     \lccode`\*=`\$ \lowercase {\def*}{####}%  
     \catcode`\$ 13 \catcode`! 0 \catcode`_ 11 %
     \the\toks0 
     {\scantokens\expandafter
         {\expandafter\XINT_newexpr_stripprefix\meaning\XINTtmp}}%
\endgroup
}%    
\let\xintexprRestoreCatcodes\relax
\def\xintexprSafeCatcodes
{% for end user.
    \edef\xintexprRestoreCatcodes  {% 
        \catcode63=\the\catcode63   % ?
        \catcode124=\the\catcode124 % |
        \catcode38=\the\catcode38   % &
        \catcode33=\the\catcode33   % !
        \catcode93=\the\catcode93   % ]
        \catcode91=\the\catcode91   % [
        \catcode94=\the\catcode94   % ^
        \catcode95=\the\catcode95   % _
        \catcode47=\the\catcode47   % /
        \catcode41=\the\catcode41   % )
        \catcode40=\the\catcode40   % (
        \catcode42=\the\catcode42   % *
        \catcode43=\the\catcode43   % +
        \catcode62=\the\catcode62   % >
        \catcode60=\the\catcode60   % <
        \catcode58=\the\catcode58   % :
        \catcode46=\the\catcode46   % .
        \catcode45=\the\catcode45   % -
        \catcode44=\the\catcode44   % ,
        \catcode61=\the\catcode61\relax   % =
    }% this is just for some standard situation with a few made active by Babel
        \catcode63=12  % ?
        \catcode124=12 % |
        \catcode38=4   % &
        \catcode33=12  % !
        \catcode93=12  % ]
        \catcode91=12  % [
        \catcode94=7   % ^
        \catcode95=8   % _
        \catcode47=12  % /
        \catcode41=12  % )
        \catcode40=12  % (
        \catcode42=12  % *
        \catcode43=12  % +
        \catcode62=12  % >
        \catcode60=12  % <
        \catcode58=12  % :
        \catcode46=12  % .
        \catcode45=12  % -
        \catcode44=12  % ,
        \catcode61=12  % =
}%    
\XINT_restorecatcodes_endinput%
%    \end{macrocode}
% \DeleteShortVerb{\|}
% \MakePercentComment
%</xintexpr>
%<*doc>
\StoreCodelineNo {xintexpr}

\def\mymacro #1{\mymacroaux #1} 
\def\mymacroaux #1#2{\strut \texttt{#1:}& \digitstt{ #2.}\tabularnewline }
\indent
\begin{tabular}[t]{r@{}r}
\xintApplyUnbraced\mymacro\storedlinecounts
\end{tabular}
\def\mymacroaux #1#2{#2}%
\parbox[t]{10cm}{Total number of code lines:
  \digitstt{\xintiSum{\xintApply\mymacro\storedlinecounts}}. Each package starts
  with circa \digitstt{80} lines dealing
  with catcodes, package identification and reloading management, also for Plain
  \TeX\strut. Version
  \texttt{\pkgversion} of \texttt{\pkgdate}.\par}
 

\CharacterTable
 {Upper-case    \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
  Lower-case    \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
  Digits        \0\1\2\3\4\5\6\7\8\9
  Exclamation   \!     Double quote  \"     Hash (number) \#
  Dollar        \$     Percent       \%     Ampersand     \&
  Acute accent  \'     Left paren    \(     Right paren   \)
  Asterisk      \*     Plus          \+     Comma         \,
  Minus         \-     Point         \.     Solidus       \/
  Colon         \:     Semicolon     \;     Less than     \<
  Equals        \=     Greater than  \>     Question mark \?
  Commercial at \@     Left bracket  \[     Backslash     \\
  Right bracket \]     Circumflex    \^     Underscore    \_
  Grave accent  \`     Left brace    \{     Vertical bar  \|
  Right brace   \}     Tilde         \~}
\CheckSum{18823}
\makeatletter\check@checksum\makeatother
\Finale
%%
%% End of file `xint.dtx'.