TeX in C
Explore TeX with modern c compiler.
|
第七章:定点数算数. 更多...
宏定义 | |
#define | INC_TEX_MATH |
PART 7: ARITHMETIC WITH SCALED DIMENSIONS. 更多... | |
#define | UNITY 65536L |
[#101] 2^{16}, rep 1.00000 更多... | |
#define | TWO 131072L |
[#101] 2^{17}, rep 2.00000 更多... | |
#define | INF_BAD 10000 |
[#108]: infinitely bad value 更多... | |
#define | nx_plus_y(n, x, y) mult_and_add((n), (x), (y), 07777777777L) |
[105] 455, 716, 1240. 更多... | |
#define | mult_integers(n, x) mult_and_add((n), (x), 0, 017777777777L) |
[105] 1240. 更多... | |
函数 | |
Integer | half (Integer x) |
[#100] 整除 2 更多... | |
Scaled | round_decimals (SmallNumber k, char digs[]) |
[#102]: create a scaled integer from a given decimal fraction. 更多... | |
void | print_scaled (Scaled s) |
[#103]: prints scaled real, rounded to five digits 更多... | |
Scaled | mult_and_add (Integer n, Scaled x, Scaled y, Scaled max_ans) |
[#105]: return nx + y 更多... | |
Scaled | x_over_n (Scaled x, Integer n) |
[#106]: x / n 更多... | |
Scaled | xn_over_d (Scaled x, Integer n, Integer d) |
[#107]: x * (n / d) 更多... | |
HalfWord | badness (Scaled t, Scaled s) |
[#108]: compute the “badness” of glue. 更多... | |
变量 | |
Boolean | arith_error = false |
[#104] has arithmetic overflow occurred recently? 更多... | |
Scaled | tex_remainder = 0 |
[#104] amount subtracted to get an exact division 更多... | |
第七章:定点数算数.
export:
#define INC_TEX_MATH |
PART 7: ARITHMETIC WITH SCALED DIMENSIONS.
#define INF_BAD 10000 |
[#108]: infinitely bad value
#define mult_integers | ( | n, | |
x | |||
) | mult_and_add((n), (x), 0, 017777777777L) |
[105] 1240.
Note: 017777777777L == 2147483647L
#define nx_plus_y | ( | n, | |
x, | |||
y | |||
) | mult_and_add((n), (x), (y), 07777777777L) |
[105] 455, 716, 1240.
Note: 07777777777L == 1073741823L
#define TWO 131072L |
[#101] 2^{17}, rep 2.00000
#define UNITY 65536L |
[#101] 2^{16}, rep 1.00000
[#108]: compute the “badness” of glue.
given t >= 0 when a total t is supposed to be made from amounts that sum to s.
void print_scaled | ( | Scaled | s | ) |
[#103]: prints scaled real, rounded to five digits
Scaled round_decimals | ( | SmallNumber | k, |
char | digs[] | ||
) |
[#102]: create a scaled integer from a given decimal fraction.
{ dig[i], | i = k-1, 0 ≤ k ≤ 17 }
Boolean arith_error = false |
[#104] has arithmetic overflow occurred recently?
Scaled tex_remainder = 0 |
[#104] amount subtracted to get an exact division