Interpolation function


function phi( key : typekey; lo, up : integer ) : integer; var i : integer; begin i := ( (key-MinKey) * (up-lo+1) ) div (MaxKey-MinKey) + lo; phi := i; if i>up then phi := up else if i<lo then phi := lo end;

Pascal source (42.phi.p)



© Addison-Wesley Publishing Co. Inc.