So what if we tell a programming language to calculate this: X/1, where X is any number. Do they actually calculate the output or check/ignore 1 and return X?
Furthermore, when coding something like the above is it worth checking if the divider is 1 or is it faster to just let it compute the division anyway?
Thank you
In order to elaborate on this question: Which is faster?
$result = $number / $divisor;
or
$result = $divisor > 1 ? $number / $divisor : $number;