A-M baby
This commit is contained in:
parent
764da6cbbb
commit
db842d013d
19005 changed files with 197040 additions and 7 deletions
9
Task/Map-range/REXX/map-range-2.rexx
Normal file
9
Task/Map-range/REXX/map-range-2.rexx
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
/*REXX program maps a number from one range to another range. */
|
||||
|
||||
do j=0 to 10
|
||||
say right(j,3) ' maps to ' mapRange(0 10, -1 0, j)
|
||||
end /*j*/
|
||||
exit /*stick a fork in it, we're done.*/
|
||||
|
||||
/*──────────────────────────────────MAPRANGE subroutine─────────────────*/
|
||||
mapRange: procedure; arg a1 a2,b1 b2,x; return b1+(x-a1)*(b2-b1)/(a2-a1)
|
||||
Loading…
Add table
Add a link
Reference in a new issue