Random...
Uwe Schmitt
uwe at rocksport.de
Mon Mar 25 13:57:49 EST 2002
FREDRIK HULDTGREN <tdi01fhu at syd.kth.se> wrote:
| I want to generate random numbers, very large random numbers. If I use
| randrange() I get an out of bounds error since it only supports numbers
| up to (2**31)-1. However, I can use uniform(), but then I get the number
| returned in 7.9655120654553743e+018 or something simaler, and I would
| rather have it in a "L" format(796551206545537430183218312890381031L).
| How do I do this?
| thanx
| /Fredrik
You could generate two random numbers and clue them together to
a longer number.
there is a mp (multip precision) library at http://gmpy.sourceforge.net
Greetings, Uwe
--
Dr. rer. nat. Uwe Schmitt Uwe.Schmitt at num.uni-sb.de
Universitaet des Saarlandes Angewandte Mathematik
Building 36.1 Room 4.17 PO-Box 151150 D-66041 Saarbruecken
Mobile:0177/6806587 Fax:+49(0)681/302-4435 Office:+49(0)681/302-2468
More information about the Python-list
mailing list