Ask Your Question
1

random number generator function

asked 2013-12-04 22:28:11 +0100

Tom Burke gravatar image

updated 2013-12-06 18:28:30 +0100

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 23:20:21 +0100 )edit

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

Tom Burke gravatar imageTom Burke ( 2013-12-05 08:49:36 +0100 )edit

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

kcrisman gravatar imagekcrisman ( 2013-12-05 13:40:49 +0100 )edit

1 Answer

Sort by ยป oldest newest most voted
3

answered 2013-12-05 18:36:00 +0100

dazedANDconfused gravatar image

updated 2013-12-05 18:36:37 +0100

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 22:28:11 +0100

Seen: 7,041 times

Last updated: Dec 06 '13