rescale value min max newmin newmax &key :return-type [Function]

Returns value rescaled to lie between newmin and newmax. min and max are the old minimum and maximum values. The type of the value returned normally depends on the type of the arguments specified to the function. Use :return-type to force the return value to be either float, integer or ratio. float may be specified as a list (float digits) in which case the floating point return value will be rounded to digitnumber of places.

Example:

? (rescale .51 0 1 0 100)
51.0

? (rescale 1.2 1 2 80 90)
85.0

See Also:

fit


Last Modified: 5-Mar-1998