Just another update
This commit is contained in:
parent
a25938f123
commit
00a190b0a6
6591 changed files with 94363 additions and 23227 deletions
13
Task/Map-range/Pascal/map-range-1.pascal
Normal file
13
Task/Map-range/Pascal/map-range-1.pascal
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
Program Map(output);
|
||||
|
||||
function MapRange(fromRange, toRange: array of real; value: real): real;
|
||||
begin
|
||||
MapRange := (value-fromRange[0]) * (toRange[1]-toRange[0]) / (fromRange[1]-fromRange[0]) + toRange[0];
|
||||
end;
|
||||
|
||||
var
|
||||
i: integer;
|
||||
begin
|
||||
for i := 0 to 10 do
|
||||
writeln (i, ' maps to: ', MapRange([0.0, 10.0], [-1.0, 0.0], i):4:2);
|
||||
end.
|
||||
Loading…
Add table
Add a link
Reference in a new issue