fixed and handled 1/x

Added code for number inversion, caught the infinity error in a
condition when trying to invert 0… was hard to figure out!