|
[Date Index]
[Thread Index]
[Author Index]
Re: Re: Bug Report - Two numerical values for a same variable
- To: mathgroup at smc.vnet.net
- Subject: [mg54336] Re: [mg54296] Re: Bug Report - Two numerical values for a same variable
- From: Andrzej Kozlowski <akoz at mimuw.edu.pl>
- Date: Thu, 17 Feb 2005 10:30:53 -0500 (EST)
- References: <cuhr4q$978$1@smc.vnet.net> <cukc65$lup$1@smc.vnet.net> <200502130521.AAA03676@smc.vnet.net> <opsl4914q7iz9bcq@monster> <002301c51217$ad7438b0$b5803e44@Dell> <cup6bc$e11$1@smc.vnet.net> <curp0c$qv3$1@smc.vnet.net> <200502161936.OAA19201@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
On 16 Feb 2005, at 20:36, Maxim wrote:
> On Tue, 15 Feb 2005 03:06:52 +0000 (UTC), Carl K. Woll
> <carlw at u.washington.edu> wrote:
>
>>
>> Objects with head Rational are atoms, so you don't have access to the
>> integers inside a rational object. It's the samething as complex
>> numbers.
>> For example,
>>
>> Complex[6,7] /. 7->1
>> 6 + 7 I
>>
>> Carl Woll
>>
>
> However, if I construct something like Complex[E, E] manually, it
> won't be
> an atom, and some functions will have problems with it:
>
> In[1]:=
> Complex[E, E] // Re // N
> Complex[E, E] // Re // ComplexExpand // N
>
> Out[1]=
> 2.7182818
>
> Out[2]=
> 2.7182818 + 2.7182818 I
>
> Perhaps this is an unallowed construct, but how am I supposed to know
> that
> it's unallowed?
>
> Maxim Rytin
> m.r at inbox.ru
>
Well, you can check that
In[16]:=
Complex[E, E] == E + I*E
Out[16]=
Complex[E, E] == (1 + I)*E
in other words, these two expressions are not considered equal. Even
more obviously Rational[Pi,Pi] does not return 1.
In general it is certainly true in the case of Mathematica that you
can't conclude from the fact that there is no explicit statement saying
that something is not allowed that it will be all right to do it.
Rather like in real life, I would say.
Andrzej Kozlowski
Chiba, Japan
http://www.akikoz.net/andrzej/index.html
http://www.mimuw.edu.pl/~akoz/
Prev by Date:
Re: comparing two lists
Next by Date:
Re: "teach" mathematica an integral
Previous by thread:
Re: Bug Report - Two numerical values for a same variable
Next by thread:
Re: Re: [Mathematica 5.1] Bug Report - Two numerical values for a same variable
|