MathGroup Archive 1998

[Date Index] [Thread Index] [Author Index]

Search the Archive

RE: Sqrt and Listability

  • To: mathgroup at smc.vnet.net
  • Subject: [mg14879] RE: [mg14836] Sqrt and Listability
  • From: Daniel CLEMENT <dclement at mail.cpod.fr>
  • Date: Mon, 23 Nov 1998 10:11:57 -0500
  • Sender: owner-wri-mathgroup at wolfram.com

Andrzej,

Try TreeForm[Sqrt[x]] to see that Sqrt[x] is automatically converted to 
x^(1/2). Since Power is a function of 2 arguments, I  don't know if
"Listable" makes sense with it.

Regards,

Daniel CLEMENT

> ----- Original Message -----
> From:	Andrzej Kozlowski [SMTP:andrzej at tuins.ac.jp]
> Sent:	Friday, November 20, 1998, 8:14:22
> To:	mathgroup at smc.vnet.net
> Subject:	[mg14836] Sqrt and Listability
>
> I have come across a mystery. Solving it is a matter of absolutely no
> importance, yet I would be grateful for any help in putting it to
rest.
>
[...]
>
> In[1]:=
> Sqrt[{4,9}]
> Out[2]=
> {2, 3}
>
> One can check it's attributes explicitly: In[2]:=
> Attributes[Sqrt]
> Out[2]=
> {Listable,NumericFunction,Protected}
>
> Now we remove Listable:
>
> In[3]:=
> ClearAttributes[Sqrt,Listable]
>
> Sqrt is no longer Listable:
>
> In[4]:=
> Attributes[Sqrt]
> Out[4]=
> {NumericFunction,Protected}
>
> Or is it?
>
> In[5]:=
> Sqrt[{4,9}]
> Out[5]=
> {2,3}
>
[...]
>
> My question is: why on earth is Listablity "hard wired" into Sqrt but
> not in other functions, like Sin. Log etc. Is this just a accidental
> quirk (I wouldn't even call it a bug) which just proves my point about
> "never trusting a computer program" or is there something "deep"
> involved in this?
>
> Andrzej Kozlowski
>
> Professor of Mathematics
> Toyama International University
> Toyama, JAPAN
>
>
> ----- End Of Original Message -----




  • Prev by Date: Re: Evaluation Control
  • Next by Date: Announcement: QR Streams and MathDirect
  • Previous by thread: Sqrt and Listability
  • Next by thread: Re: Sqrt and Listability