Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
10
Task/Map-range/ReScript/map-range-1.re
Normal file
10
Task/Map-range/ReScript/map-range-1.re
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
let map_range = ((a1, a2), (b1, b2), s) => {
|
||||
b1 +. ((s -. a1) *. (b2 -. b1) /. (a2 -. a1))
|
||||
}
|
||||
|
||||
Js.log("Mapping [0,10] to [-1,0] at intervals of 1:")
|
||||
|
||||
for i in 0 to 10 {
|
||||
Js.log("f(" ++ Js.String.make(i) ++ ") = " ++
|
||||
Js.String.make(map_range((0.0, 10.0), (-1.0, 0.0), float(i))))
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue