How can i easy check if the value jumps from '-' to '+' ?

Its my firsttime i program this.