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

calculation of NL for -87 and 87 latitudes #62

Open
wrobell opened this issue Mar 2, 2020 · 1 comment
Open

calculation of NL for -87 and 87 latitudes #62

wrobell opened this issue Mar 2, 2020 · 1 comment

Comments

@wrobell
Copy link
Contributor

wrobell commented Mar 2, 2020

The code is in cprNL function is

if lat == 87 or lat == -87:
    return 2

Considering that latitude is a float obtained using IEEE-754 standard, IMHO, it is highly unlikely we will hit -87/87 exactly (https://docs.python.org/3/tutorial/floatingpoint.html). Should math.isclose be used here (https://docs.python.org/3/library/math.html#math.isclose)?

@junzis
Copy link
Owner

junzis commented Mar 3, 2020

You are absolutely right! Now fixed with commit ed18352.

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

No branches or pull requests

2 participants