General interpolation formula
function phi( key : typekey; lo, up : integer ) : integer; var i : integer; begin i := trunc( (key-MinKey) * (up-lo+1.0) / (MaxKey-MinKey) ) + lo; phi := i; if i>up then phi := up else if i
C
source (41.phi.c)
Pascal
source (41.phi.p)
©
Addison-Wesley
Publishing Co. Inc.