Closed felagund closed 10 years ago
Damn, I'm not doing enough Python lately, I though dividing by 0 in float context would return Inf like in most languages.
At first sight I'd tend to return inf, because that's logical.
But 0 second long subtitles, is a kind of convention for comments, or stale items. So players don't bother displaying them on any frame.
So 0.0
if definitely the value that make most sense.
THanks for that, but please add a test.
Test added.
LGTM. Thanks!
When duration is 0, the program used to throw an error. Now it returns 0. I am not sure if that is the best value to return (float('inf') could be used maybe) but cannot think of anything better and this seems better than throwing an exception.