Data update
This commit is contained in:
parent
4bb20c9b71
commit
cbaf4c4b64
12390 changed files with 318560 additions and 27248 deletions
8
Task/Map-range/Asymptote/map-range.asymptote
Normal file
8
Task/Map-range/Asymptote/map-range.asymptote
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
real mapRange(int s, int a1, int a2, int b1, int b2) {
|
||||
return b1 + (s - a1) * (b2 - b1) / (a2 - a1);
|
||||
}
|
||||
|
||||
for (int i = 0; i <= 10; ++i) {
|
||||
real r = mapRange(i, 0, 10, -1, 0);
|
||||
write( (string)i + " maps to " + format("%0.1f", r) );
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue