4 ms·
> I would have an exponentiation operator. > That operator might be: ** > [...] > It might be possible to add this to existing C now > since the operat
by rbonvall 16y ago
> I would have an exponentiation operator.
> That operator might be: **
> [...]
> It might be possible to add this to existing C now
> since the operator is not already used.
a ** b == a * (*b)
- prodigal_erik 16y agoAs I recall, a C compiler is not required to realize that a -- b would be valid if parsed as a - (- b) so creating this operator would be equally feasible. Though I don't think exponentiation is common enough to need one, especially in C where you couldn't overload it for rationals or bignums.
- mooism2 16y agoThe point is that a**b may occur in existing code, and mean a * (*b) Introducing a double-star operator would break this code.