in pow, use negif instead of if_else and unary minus to avoid issues with scalar int8