I want to calculate x^y
(power of x to y) where x and y are both int32_t
's. The result should be the same. If there is an overflow (also meaning: outside the bound of an int32_t
, I want to catch that overflow - preferably before it even happens.
How is that possible?
(I know there are relevant __builtin
methods for addition/subtraction/multiplication, but I don't think exponentation has one...)