Raising an error for in-place difference calculation