Added equals and hashCode to math classes