Why the result of my calculation change?