Ask Your Question
0

Defining custom global constants

asked 2012-05-18 16:34:21 +0200

daniel.e2718 gravatar image

updated 2012-05-18 17:31:22 +0200

niles gravatar image

Is it possible to define a custom constant like pi? One that is handled symbolically, one that can be used without prior definition...

For example, could it be possible to define "tau" to equal 2*pi for my Sage installation so that when I open my notebook, I can call "tau" without needing to define it in every cell?

And to take it a step further, would it be possible to replace constants? Like pi with tau/2? This isn't as important, but it would be very nice!

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2012-05-18 17:31:00 +0200

niles gravatar image

Just define the variables, functions, or other things in a file, and load it into Sage at startup. There are a number of questions and answers along these lines already on this site:

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: 2012-05-18 16:34:21 +0200

Seen: 485 times

Last updated: May 18 '12