MathGroup Archive 1996

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

Search the Archive

Re: Mma: 13 is not prime!


Felix Holderied wrote:
> 
> Please help me:
> 
> In[]:=
>         PrimeQ[13]
> Out[]=
>         True
> 
> In[]:=
>         PrimeQ[p] /.{p->13}
> Out[]=
>         False
> 
> WHY?
> 
> Greetings, Felix


It's all in the evaluation order! Basically, you get the answer for

			 PrimeQ[p]

which is evaluated before the replacement takes place (and has of 
course the result False). Try instead

In[93]:=
ReleaseHold[ Hold[PrimeQ[p]] /.{p->13} ]
Out[93]=
True

-- 
_______________________________________________________________
Harald Berndt                          University of California
Research Specialist                  Forest Products Laboratory
Phone: 510-215-4224                            FAX:510-215-4299
_______________________________________________________________


==== [MESSAGE SEPARATOR] ====


  • Prev by Date: Re: Trilinear plots
  • Next by Date: new Package: Transform2DPlot.m
  • Previous by thread: Re: Mma: 13 is not prime!
  • Next by thread: Printing Landscape