Open sgelb opened 3 years ago
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: https://github.com/mkaz/termgraph/blob/09e17cc3510b62969fc12075dd698817357a5a93/termgraph/utils.py#L16
ValueError: math domain error
math.log
utils.py::cvt_to_readable(num)
Problem is that there is there is no zero check for num. This is done correctly in termgraph.py::cvt_to_readable(num): https://github.com/mkaz/termgraph/blob/4aa3b6711136fb0232bf149a64afa4b49c2b28f3/termgraph/termgraph.py#L197
termgraph.py::cvt_to_readable(num)
I made a pull request to fix this.
If termgraph is used as a module and a value is 0, a
ValueError: math domain error
is thrown bymath.log
inutils.py::cvt_to_readable(num)
here: https://github.com/mkaz/termgraph/blob/09e17cc3510b62969fc12075dd698817357a5a93/termgraph/utils.py#L16Problem is that there is there is no zero check for num. This is done correctly in
termgraph.py::cvt_to_readable(num)
: https://github.com/mkaz/termgraph/blob/4aa3b6711136fb0232bf149a64afa4b49c2b28f3/termgraph/termgraph.py#L197