Re: Replace, test question
- To: mathgroup at smc.vnet.net
- Subject: [mg120339] Re: Replace, test question
- From: Peter Breitfeld <phbrf at t-online.de>
- Date: Tue, 19 Jul 2011 06:57:52 -0400 (EDT)
- References: <j0113e$qad$1@smc.vnet.net>
PA32R wrote:
> {58, 61, 15, 66, 10, 2, 24, 81, 45, 84} /. x_ /; PrimeQ -> P
Instead, you should use:
{58, 61, 15, 66, 10, 2, 24, 81, 45, 84} /. x_ /; PrimeQ[x] -> P
or
{58, 61, 15, 66, 10, 2, 24, 81, 45, 84} /. x_?PrimeQ -> P
--
_________________________________________________________________
Peter Breitfeld, Bad Saulgau, Germany -- http://www.pBreitfeld.de