Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
13
Task/Map-range/Pascal/map-range-1.pas
Normal file
13
Task/Map-range/Pascal/map-range-1.pas
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