Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
8
Task/Map-range/Liberty-BASIC/map-range.basic
Normal file
8
Task/Map-range/Liberty-BASIC/map-range.basic
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
For i = 0 To 10
|
||||
Print "f(";i;") maps to ";mapToRange(i, 0, 10, -1, 0)
|
||||
Next i
|
||||
End
|
||||
|
||||
Function mapToRange(value, inputMin, inputMax, outputMin, outputMax)
|
||||
mapToRange = (((value - inputMin) * (outputMax - outputMin)) / (inputMax - inputMin)) + outputMin
|
||||
End Function
|
||||
Loading…
Add table
Add a link
Reference in a new issue