summaryrefslogtreecommitdiffstats
path: root/mpi/make-logtab.txr
blob: 90e36f38d0d7d95577ff394c312a282df9bf2211 (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
@(bind scale 16384)
@(bind type "unsigned int")
@(bind logs @(tuples 4 ^(0.0 0.0
                         ,*(take 63
                                 (mapcar* [chain log2 / (op * scale) ceil toint]
                                          (range 2))))))
@(output)
/*
 * A table of the logs of 2 for various bases scaled by a factor
 * and converted to integer.
 *
 * This table is used to compute output lengths for the mp_toradix
 * function.
 */

#define MP_LOG_SCALE @scale

const @type s_logv_2[] = {
@  (repeat)
  @(rep)@logs, @(last)@logs,@(end)
@  (last)
  @(rep)@logs, @(last)@logs@(end)
@  (end)
};
@(end)