ASKSAGE: Sage Q&A Forum - Individual question feedhttp://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Thu, 05 Dec 2013 11:36:00 -0600random number generator functionhttp://ask.sagemath.org/question/10802/random-number-generator-function/What is SAGE's equivalent of Mathematica's RandomReal[] function?Wed, 04 Dec 2013 15:28:11 -0600http://ask.sagemath.org/question/10802/random-number-generator-function/Comment by dazedANDconfused for <p>What is SAGE's equivalent of Mathematica's RandomReal[] function?</p>
http://ask.sagemath.org/question/10802/random-number-generator-function/?comment=16570#post-id-16570See if the [random_element](http://www.sagemath.org/doc/reference/rings_numerical/sage/rings/real_mpfr.html) command is what you want. For example RR.random_element(-10,10)Wed, 04 Dec 2013 16:20:21 -0600http://ask.sagemath.org/question/10802/random-number-generator-function/?comment=16570#post-id-16570Comment by Tom Burke for <p>What is SAGE's equivalent of Mathematica's RandomReal[] function?</p>
http://ask.sagemath.org/question/10802/random-number-generator-function/?comment=16569#post-id-16569Yes, thank you. That's what I was looking for.Thu, 05 Dec 2013 01:49:36 -0600http://ask.sagemath.org/question/10802/random-number-generator-function/?comment=16569#post-id-16569Comment by kcrisman for <p>What is SAGE's equivalent of Mathematica's RandomReal[] function?</p>
http://ask.sagemath.org/question/10802/random-number-generator-function/?comment=16565#post-id-16565@dazedANDconfused - please put this as an answer so that Tom can accept it :)Thu, 05 Dec 2013 06:40:49 -0600http://ask.sagemath.org/question/10802/random-number-generator-function/?comment=16565#post-id-16565Answer by dazedANDconfused for <p>What is SAGE's equivalent of Mathematica's RandomReal[] function?</p>
http://ask.sagemath.org/question/10802/random-number-generator-function/?answer=15763#post-id-15763I don't know much about Mathematica but from looking at the description [here](http://reference.wolfram.com/mathematica/ref/RandomReal.html) I think you want [random_element()](http://www.sagemath.org/doc/reference/rings_numerical/sage/rings/real_mpfr.html). Typing
RR.random_element(-10,10)
will produce a random real between -10 and 10. Change the upper and lower limits as you need.Thu, 05 Dec 2013 11:36:00 -0600http://ask.sagemath.org/question/10802/random-number-generator-function/?answer=15763#post-id-15763