ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Thu, 05 Dec 2013 18:36:00 +0100random number generator functionhttps://ask.sagemath.org/question/10802/random-number-generator-function/What is SAGE's equivalent of Mathematica's RandomReal[] function?Wed, 04 Dec 2013 22:28:11 +0100https://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>
https://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 23:20:21 +0100https://ask.sagemath.org/question/10802/random-number-generator-function/?comment=16570#post-id-16570Comment by kcrisman for <p>What is SAGE's equivalent of Mathematica's RandomReal[] function?</p>
https://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 13:40:49 +0100https://ask.sagemath.org/question/10802/random-number-generator-function/?comment=16565#post-id-16565Comment by Tom Burke for <p>What is SAGE's equivalent of Mathematica's RandomReal[] function?</p>
https://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 08:49:36 +0100https://ask.sagemath.org/question/10802/random-number-generator-function/?comment=16569#post-id-16569Answer by dazedANDconfused for <p>What is SAGE's equivalent of Mathematica's RandomReal[] function?</p>
https://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 18:36:00 +0100https://ask.sagemath.org/question/10802/random-number-generator-function/?answer=15763#post-id-15763