First time here? Check out the FAQ!

Ask Your Question
1

random number generator function

asked 11 years ago

Tom Burke gravatar image

updated 11 years ago

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

Preview: (hide)

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 ( 11 years ago )

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

Tom Burke gravatar imageTom Burke ( 11 years ago )

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

kcrisman gravatar imagekcrisman ( 11 years ago )

1 Answer

Sort by » oldest newest most voted
3

answered 11 years ago

dazedANDconfused gravatar image

updated 11 years ago

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.

Preview: (hide)
link

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: 11 years ago

Seen: 7,310 times

Last updated: Dec 06 '13