Re: [sage-devel] A curious result with len : an int is not an Integer.

2010-05-04 Thread Florent Hivert
Hi Francois, > I play with random in order to approximate Pi by Monte-Carlo method. > > sage: n=10^5 ; len(filter(lambda t:t, [random()^2+random^2() < 1 for k in > [1..n]])) / len([1..n]) > > The test looks at the point (random(), random()) and tests if it's in the > quarter circle. > The

[sage-devel] A curious result with len : an int is not an Integer.

2010-05-04 Thread Francois Maltey
Hello, I play with random in order to approximate Pi by Monte-Carlo method. sage: n=10^5 ; len(filter(lambda t:t, [random()^2+random^2() < 1 for k in [1..n]])) / len([1..n]) The test looks at the point (random(), random()) and tests if it's in the quarter circle. The result may be about pi