blob: e745beceb25406b39d8b6005509299a93f798ba1 (
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
|
%%
%% This is file `l3int.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% l3int.dtx (with options: `package,trace')
%%
%%
%% EXPERIMENTAL CODE
%%
%% Do not distribute this file without also distributing the
%% source files specified above.
%%
%% Do not distribute a modified version of this file.
%%
%%
%% File: l3int.dtx Copyright (C) 1990-1998 LaTeX3 project
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{l3int}
[1998/04/20 v1.0c L3 Experimental Integer module]
\RequirePackage{l3basics}\par
\def_new:Npn \int_incr:N #1{\tex_advance:D#1\c_one
}
\def_new:Npn \int_decr:N #1{\tex_advance:D#1\c_minus_one
}
\def_new:Npn \int_gincr:N {
\pref_global:D
\int_incr:N}
\def_new:Npn \int_gdecr:N {
\pref_global:D
\int_decr:N}
\def:Npn \int_incr:N #1{\int_add:Nn#1\c_one}
\def:Npn \int_decr:N #1{\int_add:Nn#1\c_minus_one}
\def:Npn \int_gincr:N #1{\int_gadd:Nn#1\c_one}
\def:Npn \int_gdecr:N #1{\int_gadd:Nn#1\c_minus_one}
\def_new:Npn \int_new:N {} % but since we don't distribute
\let:NN \int_new:N \newcount % allocation better nick the LaTeX one ...
\def_new:Npn \int_new:c {\exp_args:Nc \int_new:N}
\def_new:Npn \int_set:Nn #1#2{#1#2\scan_stop:
}
\def_new:Npn \int_gset:Nn {
\pref_global:D
\int_set:Nn }
\def_new:Npn \int_set:cn {\exp_args:Nc \int_set:Nn }
\def_new:Npn \int_gset:cn {\exp_args:Nc \int_gset:Nn }
\def_new:Npn \int_add:Nn #1#2{
\tex_advance:D#1#2\scan_stop:
}
\def_new:Npn\int_add:cn{\exp_args:Nc\int_add:Nn}
\def_new:Npn \int_sub:Nn #1#2{
\tex_advance:D#1-#2\scan_stop:
}
\def_new:Npn \int_gadd:Nn {
\pref_global:D
\int_add:Nn }
\def_new:Npn \int_gsub:Nn {
\pref_global:D
\int_sub:Nn }
\let_new:NN \int_use:N \tex_the:D
\def_new:Npn \int_use:c #1{\int_use:N \cs:w#1\cs_end:}
\def_new:Npn \int_gincr:c {\exp_args:Nc \int_gincr:N}
\def_new:Npn \int_gdecr:c {\exp_args:Nc \int_gdecr:N}
\chk_new_cs:N \l_tmpa_int
\tex_countdef:D\l_tmpa_int 255
\int_new:N \l_tmpb_int
\int_new:N \l_tmpc_int
\int_new:N \g_tmpa_int
\int_new:N \g_tmpb_int
\tex_chardef:D \c_zero = 0 \scan_stop:
\tex_chardef:D \c_one = 1 \scan_stop:
\tex_chardef:D \c_two = 2 \scan_stop:
\tex_chardef:D \c_three = 3 \scan_stop:
\tex_chardef:D \c_four = 4 \scan_stop:
\tex_chardef:D \c_sixteen = 16 \scan_stop:
\tex_chardef:D \c_thirty_two = 32 \scan_stop:
\tex_chardef:D \c_twohundred_fifty_five = 255 \scan_stop:
\tex_mathchardef:D \c_twohundred_fifty_six = 256 \scan_stop:
\tex_mathchardef:D \c_thousand = 1000 \scan_stop:
\tex_mathchardef:D \c_ten_thousand = 10000 \scan_stop:
\tex_mathchardef:D \c_ten_thousand_one = 10001 \scan_stop:
\tex_mathchardef:D \c_ten_thousand_two = 10002 \scan_stop:
\tex_mathchardef:D \c_ten_thousand_three = 10003 \scan_stop:
\tex_mathchardef:D \c_ten_thousand_four = 10004 \scan_stop:
\tex_mathchardef:D \c_twenty_thousand = 20000 \scan_stop:
\let_new:NN \fint_new:N \newmuskip % nicked from LaTeX
\def_new:Npn \fint_use:N {\exp_after:NN\fint_use_aux:w\the_internal:D}
\tex_lccode:D`\!=`\m \tex_lccode:D`\?=`\u
\tex_lowercase:D{\def_new:Npn \fint_use_aux:w #1.0!?{#1}}
\tex_lccode:D`\!=0\scan_stop: \tex_lccode:D`\?=0\scan_stop:
\def_new:Npn \fint_set:Nn #1#2{#1#2~mu\scan_stop:
}
\def_new:Npn \fint_gset:Nn{
\pref_global:D
\fint_set:Nn}
\def_new:Npn \fint_set_eq:NN #1#2{#1#2
}
\def_new:Npn \fint_gset_eq:NN {
\pref_global:D
\fint_set_eq:NN}
\def_new:Npn \fint_add:Nn #1#2{\int_add:Nn#1{#2mu}}
\def_new:Npn \fint_gadd:Nn {
\pref_global:D
\fint_add:Nn}
\def_new:Npn \fint_sub:Nn #1#2{\int_sub:Nn#1{#2mu}}
\def_new:Npn \fint_gsub:Nn {
\pref_global:D
\fint_sub:Nn}
\def_new:Npn \fint_incr:N #1{\advance:D#1\c_one mu\scan_stop:
}
\def_new:Npn \fint_decr:N #1{\advance:D#1\c_minus_one mu\scan_stop:
}
\def_new:Npn \fint_gincr:N {
\pref_global:D
\fint_incr:N}
\def_new:Npn \fint_gdecr:N {
\pref_global:D
\fint_decr:N}
\def:Npn \fint_incr:N #1{\fint_add:Nn#1\c_one}
\def:Npn \fint_decr:N #1{\fint_add:Nn#1\c_minus_one}
\tex_mathchardef:D\c_fint_max=16383 \scan_stop:
%%
%%
%% End of file `l3int.sty'.
|