![]() |
Fox's Pages | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
UW home
|
Updated: Jan 13, 1998 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| M4 Macros |
Here are a few, maybe useful M4 macros, taken from my SunExpert Q&AIX column, January, 1998.
Included are a for loop: for(var,start,end,procedure)
For example,
for(`x',1,5,`
x squared = eval(x**2)')
expands to
1 squared = 1
2 squared = 4
3 squared = 9
4 squared = 16
5 squared = 25
There is also the sublime nextprime calculator, which expands to the next higher prime number from its argument: nextprime(number)
For example,
nextprime(50000)
expands to
50021
Get the macros as text,
tools.m4, or in a compressed form,
tools.m4.gz.
|
Jim Fox UW Technology Identity and Access Management University of Washington fox@washington.edu |
© 1983-2009, University of Washington