Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG: smirnov -- make comparison robust to handle NaNs #187

Closed
wants to merge 2 commits into from

Conversation

yarikoptic
Copy link
Contributor

any comparison (< or >=) with NaN is False, so check to belong to the range
[x,y] must be done with (>=x)&&(<=y) and not !((<x)||(>y))

This issue happens to be critical especially for big-endian architectures
leading to stalling in smirnov due to excessive looping later in the code.

References:
http://bugs.debian.org/cgi-bin/bugreport.cgi\?bug\=653948
http://mail.scipy.org/pipermail/scipy-dev/2012-March/017298.html

any comparison (< or >=) with NaN is False, so check to belong to the range
[x,y] must be done with (>=x)&&(<=y) and not !((<x)||(>y))

This issue happens to be critical especially for big-endian architectures
leading to stalling in smirnov due to excessive looping later in the code.

References:
  http://bugs.debian.org/cgi-bin/bugreport.cgi\?bug\=653948
  http://mail.scipy.org/pipermail/scipy-dev/2012-March/017298.html
@pv
Copy link
Member

pv commented Mar 31, 2012

Thanks, this looks correct. A small regression test should be added (e.g. during merge).

Bug ref: http://projects.scipy.org/scipy/ticket/1638

@yarikoptic
Copy link
Contributor Author

Just to make clear -- a regression test was not expected from me, was it? ;-)

@pv
Copy link
Member

pv commented Apr 2, 2012

@yarikoptic: Well, if you add it, someone else doesn't need to :) But if you don't, it shouldn't hold back merging this

@yarikoptic
Copy link
Contributor Author

tested that it does halt with unpatched version and completes with patched one (not sure if that qualifies for a term "regression test" without comparing to smth :-P ;-) ) Thank you @stefanv !

@stefanv
Copy link
Member

stefanv commented May 9, 2012

It will catch the regression, at least :) @pv what do you think?

@pv
Copy link
Member

pv commented May 11, 2012

Merged in f7083b6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants