Data update
This commit is contained in:
parent
4bb20c9b71
commit
cbaf4c4b64
12390 changed files with 318560 additions and 27248 deletions
10
Task/Map-range/ReScript/map-range-1.res
Normal file
10
Task/Map-range/ReScript/map-range-1.res
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