fixing NaN comparison

- added test comparing NaNs that failed intitially
- fixed equal to make test pass