xref: /freebsd/contrib/bc/tests/bc/scripts/screen.bc (revision 1f474190)
1#! /usr/bin/bc -q
2
3define a(i, j) {
4	scale = 0
5	if(i % 2 == 0) return i;
6	if(j - i >= 0.5) return i + 1;
7	return i - 1;
8}
9
10define x(w, h, n) {
11	scale = 20
12	f = w / n
13	scale = 0
14	i = h / f
15	scale = 1
16	j = h / f
17	return a(i, j);
18}
19
20x(720, 576, 600)
21