13 lines
262 B
Text
13 lines
262 B
Text
include c:\cxpl\codes;
|
|
|
|
func real Map(A1, A2, B1, B2, S);
|
|
real A1, A2, B1, B2, S;
|
|
return B1 + (S-A1)*(B2-B1)/(A2-A1);
|
|
|
|
int I;
|
|
[for I:= 0 to 10 do
|
|
[if I<10 then ChOut(0, ^ ); IntOut(0, I);
|
|
RlOut(0, Map(0., 10., -1., 0., float(I)));
|
|
CrLf(0);
|
|
];
|
|
]
|