Ticket #1796 (closed defect: fixed)

Opened 5 months ago

Last modified 5 months ago

OverflowError : math range error

Reported by: pjotr Assigned to: anonymous
Priority: critical Milestone:
Component: generic Version:
Keywords: Cc:
Time spent: Time remaining: 0h
Time planned:

Description

It happens here in lemill.net: http://lemill.net/content/language

It has something to do with line 1051 LargeSectionFolder?.py >>> b=int((8*log(b-mincount,2))/log(maxcount,2))

Change History

08/26/08 17:26:41 changed by tarmo

Well, the algorithm should actually be

b=int((8*log(b-mincount,2))/log(maxcount-mincount,2))

And that can throw OverflowError? if either log gets a 0 to calculate. Also the latter log can produce a 0 which will cause a ZeroDivisionError?.

I suggest you fix the algorithm as shown above and put a try except around it for the two error types, in which case b=0.

08/26/08 17:56:53 changed by jukka

  • status changed from new to closed.
  • resolution set to fixed.
  • tt_remaining set to 0h.

(In [2531]) Fixed #1796, Fixed #1789, Fixed #1793