Ask Your Question
1

random number generator function

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

Tom Burke gravatar image

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

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 +0200 )edit

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

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

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

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

1 Answer

Sort by ยป oldest newest most voted
3

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

dazedANDconfused gravatar image

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

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 +0200

Seen: 6,380 times

Last updated: Dec 06 '13