From: Robert K. <rob...@gm...> - 2006-11-02 05:42:34
|
Keith Goodman wrote: > On 11/1/06, David Cournapeau <da...@ar...> wrote: >> Hi, >> >> I want to generate some random integers,let's say in the range [- >> 2^15, 2^16]. Why doing: >> >> noise = numpy.random.random_integers(- (2 ** 15), (2 * 15), 22050) >> >> gives only negative numbers ? > > I guess 2^15 is too big to be an int. No, it isn't. As Fernando pointed out, if David's code is what he typed here, then his upper bound is (2 * 15) == 30 not (2 ** 15) == 32768 as he intended intended. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." -- Umberto Eco |