Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
1996
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 1996

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

Search the Archive

Re: Mma: 13 is not prime!

  • To: mathgroup at smc.vnet.net
  • Subject: [mg4634] Re: Mma: 13 is not prime!
  • From: Harald Berndt <haraldb at nature.berkeley.edu>
  • Date: Thu, 22 Aug 1996 03:54:52 -0400
  • Organization: University of California Forest Products Lab
  • Sender: owner-wri-mathgroup at wolfram.com

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