Ok perfect! I would just change the comment so it is more clear that we are checking result == NaN : 
```
// Check if result == NaN (see http://...)
```