Looking at ewma method in https://github.com/pydata/pandas/blob/master/pandas/algos.pyx, there is a strange code:
for i from 1 <= i < N:
cur = input[i]
prev = output[i - 1]
if **cur == cur:**
if **prev == prev**:
output[i] = oldw * prev + neww * cur
else:
output[i] = neww * cur
else:
output[i] = prev
Why is it comparing cur==cur and prev==prev?
I'm trying to implement this method in Java but get different results (7.01644573 in Python and 7.013072549019608 in Java, for example), so maybe this magic "==" operator does something?..