Anonymous user
Map range: Difference between revisions
→{{header|Vala}}
m (Formatting.) |
|||
Line 2,905:
=={{header|Vala}}==
return b1+(s-a1)*(b2-b1)/(a2-a1);
▲<lang vala>double map_range(double[] a, double[] b, double s) {
} ▼
▲}
void main() {
}
▲ print("%2d maps to %5.2f\n", s, map_range(r1, r2, (double)s));
}</lang>
|