Re: How to define a constant in mathematica like Pi
- To: mathgroup at smc.vnet.net
- Subject: [mg64011] Re: How to define a constant in mathematica like Pi
- From: "Dana DeLouis" <ddelouis at bellsouth.net>
- Date: Fri, 27 Jan 2006 05:13:23 -0500 (EST)
- Sender: owner-wri-mathgroup at wolfram.com
> I would like to define a constant in Mathematica for example c=1.2345
Hi. Just another option...
I used Rationalize to avoid a convergence warning with ver. 5.2
c = Rationalize[1.2345]
2469/2000
SetAttributes[c, Constant]
Sqrt[Pi/c]
20*Sqrt[(5*Pi)/2469]
Integrate[E^((-c)*x^2),
{x, -Infinity, Infinity}]
20*Sqrt[(5*Pi)/2469]
HTH. :>)
Dana DeLouis
"José Carlos Santos" <jcsantos at fc.up.pt> wrote in message
news:dr7vuo$pdp$1 at smc.vnet.net...
> Hi all,
>
> I'm posting a question asked by someone who is currently unable to post
> here. Here's the problem:
>
> I would like to define a constant in mathematica for example c=1.2345
> in such a way that it behaves exactly like Pi or E. That is when I
> type c then I get the output c and not 1.2345.
>
> If I do integration[Exp[-c*x^2],{x,-oo,oo}] then I should get
> sqrt[Pi/c] and not If[c<0...]
>
> Best regards,
>
> Jose Carlos Santos
>