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

ValueError: math domain error if value == 0 #90

Open
sgelb opened this issue Nov 6, 2021 · 1 comment
Open

ValueError: math domain error if value == 0 #90

sgelb opened this issue Nov 6, 2021 · 1 comment

Comments

@sgelb
Copy link

sgelb commented Nov 6, 2021

If termgraph is used as a module and a value is 0, a ValueError: math domain error is thrown by math.log in utils.py::cvt_to_readable(num) here:

index = int(math.log(num) / math.log(1000))

Problem is that there is there is no zero check for num. This is done correctly in termgraph.py::cvt_to_readable(num):

if num != 0:

@frankbryce
Copy link

I made a pull request to fix this.

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