Ask Your Question
0

random number generator function

asked 2013-12-04 15:28:11 -0500

Tom Burke gravatar image

updated 2013-12-06 11:28:30 -0500

What is SAGE's equivalent of Mathematica's RandomReal[] function?

edit retag flag offensive close merge delete

Comments

3

See 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)

dazedANDconfused gravatar imagedazedANDconfused ( 2013-12-04 16:20:21 -0500 )edit

Yes, thank you. That's what I was looking for.

Tom Burke gravatar imageTom Burke ( 2013-12-05 01:49:36 -0500 )edit

@dazedANDconfused - please put this as an answer so that Tom can accept it :)

kcrisman gravatar imagekcrisman ( 2013-12-05 06:40:49 -0500 )edit

1 answer

Sort by ยป oldest newest most voted
2

answered 2013-12-05 11:36:00 -0500

dazedANDconfused gravatar image

updated 2013-12-05 11:36:37 -0500

I don't know much about Mathematica but from looking at the description here I think you want random_element(). Typing

RR.random_element(-10,10)

will produce a random real between -10 and 10. Change the upper and lower limits as you need.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2013-12-04 15:28:11 -0500

Seen: 429 times

Last updated: Dec 06 '13