_fit_

float fit(float num, float old min, float old max, float new min, float new max)
oldmin과 oldmax값에서의 num레인지의 값을 new min, new max에 반영하여 값을 리턴한다. 만약에 num이 old min보다 작거나 old min보다 크면 값은 자동으로 new min이나 max값이 반영된다.
eg.
fit(3, 1, 4, 5, 20) = 15
fit(0, 1, 4, 5, 20) = 5
fit(5, 1, 4, 5, 20) = 20

see also.
fit01, fit11, fit10