September 2017 Update
This commit is contained in:
parent
bba7bfd280
commit
ba8067c3b7
14570 changed files with 153136 additions and 63871 deletions
7
Task/Map-range/Zkl/map-range.zkl
Normal file
7
Task/Map-range/Zkl/map-range.zkl
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
fcn mapRange([(a1,a2)], [(b1,b2)], s) // a1a2 is List(a1,a2)
|
||||
{ b1 + ((s - a1) * (b2 - b1) / (a2 - a1)) }
|
||||
|
||||
r1:=T(0.0, 10.0); r2:=T(-1.0, 0.0);
|
||||
foreach s in ([0.0 .. 10]){
|
||||
"%2d maps to %5.2f".fmt(s,mapRange(r1,r2, s)).println();
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue