summaryrefslogtreecommitdiff
path: root/tests/typ/math/frac.typ
blob: 15b5da33ef903abc27acb44b7071c066c25f64ec (plain) (blame)
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
// Test fractions.

---
// Test that denominator baseline matches in the common case.
$ x = 1/2 = a/(a h) = a/a = a/(1/2) $

---
// Test parenthesis removal.
$ (|x| + |y|)/2 < [1+2]/3 $

---
// Test large fraction.
$ x = (-b plus.minus sqrt(b^2 - 4a c))/(2a) $

---
// Test binomial.
$ binom(circle, square) $

---
// Error: 8-13 missing argument: lower
$ binom(x^2) $

---
// Test associativity.
$ 1/2/3 = (1/2)/3 = 1/(2/3) $

---
// Test precedence.
$ a_1/b_2, 1/f(x), zeta(x)/2, "foo"[|x|]/2 \
  1.2/3.7, 2.3^3.4 \
  🏳️‍🌈[x]/2, f [x]/2, phi [x]/2, 🏳️‍🌈 [x]/2 \
  +[x]/2, 1(x)/2, 2[x]/2 \
  (a)b/2, b(a)[b]/2 $