aboutsummaryrefslogtreecommitdiffstats
path: root/klippy/serialhdl.py
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2017-03-22 10:46:59 -0400
committerKevin O'Connor <kevin@koconnor.net>2017-03-22 10:54:53 -0400
commit8d92c898eef382e902175c2bf2cb5cead2bcd29f (patch)
tree86f7a50a0b9e74c43eedc6aefb349795b3092916 /klippy/serialhdl.py
parent9bf73cd72dc4b279c52c764e916d8a898adb2761 (diff)
downloadkutter-8d92c898eef382e902175c2bf2cb5cead2bcd29f.tar.gz
kutter-8d92c898eef382e902175c2bf2cb5cead2bcd29f.tar.xz
kutter-8d92c898eef382e902175c2bf2cb5cead2bcd29f.zip
stepcompress: Always return 0 on negative number in safe_sqrt()
sqrt() of a negative number in the C code returns NaN. This value results in behavior that is difficult to debug. Always return 0.0 instead as this results in better behavior that is easier to track down. Also, on some code paths, safe_sqrt is called on numbers that are multiplied by very large amounts (eg, 16000000**2) and thus distinguishing between large and small negative numbers is difficult. For now, report in the log if the value is below -0.001. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'klippy/serialhdl.py')
0 files changed, 0 insertions, 0 deletions