Data update
This commit is contained in:
parent
4bb20c9b71
commit
cbaf4c4b64
12390 changed files with 318560 additions and 27248 deletions
10
Task/Map-range/Dart/map-range.dart
Normal file
10
Task/Map-range/Dart/map-range.dart
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
double mapRange(int s, int a1, int a2, int b1, int b2) {
|
||||
return b1 + (s - a1) * (b2 - b1) / (a2 - a1);
|
||||
}
|
||||
|
||||
void main() {
|
||||
for (int i = 0; i <= 10; i++) {
|
||||
double r = mapRange(i, 0, 10, -1, 0);
|
||||
print("${i.toString().padLeft(2)} maps to ${r.toStringAsFixed(1)}");
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue