Data update
This commit is contained in:
parent
72eb4943cb
commit
4d5544505c
2347 changed files with 62432 additions and 16731 deletions
13
Task/Map-range/Free-Pascal-Lazarus/map-range-1.pas
Normal file
13
Task/Map-range/Free-Pascal-Lazarus/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: 2, ' maps to: ', MapRange([0.0, 10.0], [-1.0, 0.0], i): 5: 2);
|
||||
end.
|
||||
Loading…
Add table
Add a link
Reference in a new issue