2006年11月6日月曜日

random.randrange

I encountered a question why can't we use random.randrange
instead of nzmath.bigrange.

I guess the original intension was to be used with Python
2.2, since that version has the function with limited range.
It means that the big integer argument caused OverflowError
or something.

Today, I test random.randrange. It looks good enough at the
first grance. But, it isn't usable for big integers. The
returned values are rarely in the specified (virtual) range.

I filed a bug for Python:
http://sourceforge.net/tracker/?func=detail&aid=1590891&group_id=5470&atid=105470