Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
13
Task/Map-range/PL-I/map-range.pli
Normal file
13
Task/Map-range/PL-I/map-range.pli
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
map: procedure options (main); /* 24/11/2011 */
|
||||
declare (a1, a2, b1, b2) float;
|
||||
declare d fixed decimal (3,1);
|
||||
|
||||
do d = 0 to 10 by 0.9, 10;
|
||||
put skip edit ( d, ' maps to ', map(0, 10, -1, 0, d) ) (f(5,1), a, f(10,6));
|
||||
end;
|
||||
|
||||
map: procedure (a1, a2, b1, b2, s) returns (float);
|
||||
declare (a1, a2, b1, b2, s) float;
|
||||
return (b1 + (s - a1)*(b2 - b1) / (a2 - a1) );
|
||||
end map;
|
||||
end map;
|
||||
Loading…
Add table
Add a link
Reference in a new issue