The existing implementation is occasionally fooled by small numbers. I have an alternate implementation that I'm trying out to see if it gets fooled less often.
Created attachment 321139 [details] [diff] [review]
Interesting and simpler approach. I would like to try it out when I can, but I like it.