I am curious with something that is so easy; why would you want it in core?
A lot of the Math Functions could be considered "so easy".
abs()
could be written out as:
function abs($n) {
if ($n >= 0) return $n;
else return $n*-1;
}
pi()
could be replaced by simply setting a global variable equal to 3.14159265358979
floor()
could be written out as:
function floor($n) {
$stop = strpos($n, '.');
if ($stop !== false) return substr($n,0,$stop);
else return $n
}
ceil()
could be written out as:
function ceila($n) {
$stop = strpos($n, '.');
if ($stop !== false) return 1+substr($n,0,$stop);
else return $n;
}
The above examples are just a few that stick out to me I'm sure that looking through the list of available math functions would provide a few more examples. Keeping these examples in mind, I don't follow the logic of range mapping being too easy to implement manually whenever it is needed to not warrant being included in core.
The above examples are just a few that stick out to me I'm sure that
looking through the list of available math functions would provide a
few more examples. Keeping these examples in mind, I don't follow the
logic of range mapping being too easy to implement manually whenever
it is needed to not warrant being included in core.
The mentioned functions are very very very common math functions. Your
map() is relatively specialized.
johannes