diff: support for inf/-inf#150
diff: support for inf/-inf#150eric-bonfadini wants to merge 2 commits intoinveniosoftware:masterfrom
Conversation
| first_is_ninf = first == float('-inf') | ||
| second_is_ninf = second == float('-inf') | ||
|
|
||
| if first_is_nan or second_is_nan: |
There was a problem hiding this comment.
on a more mathematical level, should two nan or two inf or two -inf be considered the same? It is improbable that two inf are the same when you are running a diff. If we agree that they should be considered the same, then this all looks great!
There was a problem hiding this comment.
I asked myself the same question while doing this PR and I found links like this stating that inf==inf and -inf==-inf .
On the contrary, it seems that they agree that Nan!=Nan , but that's outside the scope of this PR.
Let me know if you prefer not considering two inf the same, I can easily adapt tests and code.
There was a problem hiding this comment.
I think following convention is preferred over mathematical precision, so this sounds good to me 👍
Closes #146