add condition of negative exp
add edge cases for x or n == -+1. sol of q049