Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2004
*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 2004

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

Search the Archive

Re: why Pi is not recognized as a positive number?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg45367] Re: why Pi is not recognized as a positive number?
  • From: Bill Rowe <readnewsciv at earthlink.net>
  • Date: Sat, 3 Jan 2004 01:35:10 -0500 (EST)
  • Sender: owner-wri-mathgroup at wolfram.com

On 1/2/04 at 4:23 AM, pedrito6 at softhome.net (Pedro L) wrote:

>   I wanted to define a function for the positive numbers. But I discovered
>   something "strange" with Mathematica.

<snip Mathematica notebook example>

The pattern x_Positive matches a thing named x with Head Positive. Since Pi doesn't have head Positive f is left unevaluated when defined as

f[x_Positive]:= 1 + x

You can get the result you want with Positive by either defining f as

f[x_/;Positive@x]:= 1 + x  or
f[x_]:= 1 + x/;Positive@x
--
To reply via email subtract one hundred and four


  • Prev by Date: Re: why Pi is not recognized as a positive number?
  • Next by Date: Re: Mathematica exports curves in pieces to Illustrator
  • Previous by thread: Re: why Pi is not recognized as a positive number?
  • Next by thread: RE: why Pi is not recognized as a positive number?