Data update
This commit is contained in:
parent
4bb20c9b71
commit
cbaf4c4b64
12390 changed files with 318560 additions and 27248 deletions
15
Task/Map-range/Gambas/map-range.gambas
Normal file
15
Task/Map-range/Gambas/map-range.gambas
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
Function MapRange(s As Integer, a1 As Integer, a2 As Integer, b1 As Integer, b2 As Integer) As Float
|
||||
|
||||
Return b1 + (s - a1) * (b2 - b1) / (a2 - a1)
|
||||
|
||||
End Function
|
||||
|
||||
Public Sub Main()
|
||||
|
||||
Dim i As Integer
|
||||
|
||||
For i = 0 To 10
|
||||
Print Format$(i, "##"); " maps to "; Format$(MapRange(i, 0, 10, -1, 0), "+##.0")
|
||||
Next
|
||||
|
||||
End Sub
|
||||
Loading…
Add table
Add a link
Reference in a new issue