Skip to content

dec2hp and hp2... bug #156

@philanderson71

Description

@philanderson71

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

`

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions