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

dec2hp and hp2... bug #156

Open
philanderson71 opened this issue Nov 25, 2024 · 0 comments
Open

dec2hp and hp2... bug #156

philanderson71 opened this issue Nov 25, 2024 · 0 comments

Comments

@philanderson71
Copy link

Edge cases on some whole minute boundaries cause issues due to floating point precision:
`

Python 3.7.4 (tags/v3.7.4:e09359112e, Jul 8 2019, 20:34:20) [MSC v.1916 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
from geodepy.angles import hp2dec, dec2hp
dec2hp(1.083333333333333333333333)
1.046
hp2dec(0.15)
Traceback (most recent call last):
File "", line 1, in
File "C:\geodepy\angles.py", line 1024, in hp2dec
raise ValueError(f'Invalid HP Notation: 3rd decimal place greater '
ValueError: Invalid HP Notation: 3rd decimal place greater than 5: 0.15
hp2dec(20.2)
Traceback (most recent call last):
File "", line 1, in
File "C:\geodepy\angles.py", line 1024, in hp2dec
raise ValueError(f'Invalid HP Notation: 3rd decimal place greater '
ValueError: Invalid HP Notation: 3rd decimal place greater than 5: 20.2
hp2dec(20.02)
Traceback (most recent call last):
File "", line 1, in
File "C:\geodepy\angles.py", line 1024, in hp2dec
raise ValueError(f'Invalid HP Notation: 3rd decimal place greater '
ValueError: Invalid HP Notation: 3rd decimal place greater than 5: 20.02
hp2dec(133.4800)
Traceback (most recent call last):
File "", line 1, in
File "C:\geodepy\angles.py", line 1024, in hp2dec
raise ValueError(f'Invalid HP Notation: 3rd decimal place greater '
ValueError: Invalid HP Notation: 3rd decimal place greater than 5: 133.48

`

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

1 participant