% Most implementations of PostScript have max and min builtin, but they are % not part of the PostScript standard. These are fairly minimal % implementations, however they will still not outperform native code. % % The maxs/mins functions will find the maximum and minimum of a set. These % will be much more effective if they reference native code. They work as % follows: % % any1 any2 any % returns the maximum value of any1 any2 % any1 ... anyn n any % returns the maximum/minimum value of any1 ... anyn /max { 2 copy lt { exch } bind if pop } bind def /min { 2 copy gt { exch } bind if pop } bind def /maxs { 1 sub //max repeat } bind def /mins { 1 sub //min repeat } bind def