MathGroup Archive 2004

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

Search the Archive

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


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?