MathGroup Archive 2005

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

Search the Archive

Re: Condition for pure functions

  • To: mathgroup at smc.vnet.net
  • Subject: [mg60292] Re: Condition for pure functions
  • From: Misa <misa at hol.gr>
  • Date: Sat, 10 Sep 2005 06:46:41 -0400 (EDT)
  • References: <de9dbs$qa3$1@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

Wonseok Shin wrote:
> Hello everyone,
> 
> Suppose that f[x] is defined as:
> 
> f[x_ /; x > 0] := Sin[x];
> f[x_ /; x <= 0] := Tan[x];
> 
> How can transform the above definition into a pure function?
> 
> I know
> 
> f = Which[# > 0, Sin[#], # <= 0, Tan[#]] &
> 
> is a one solution.  But is there any clever way to use Condition (/;)
> instead of Which[...] ?
> 
does anybody have some informations of Lobachevski. if yes then please 
contact me


  • Prev by Date: Re: Would a code generator from dynamic systems be feasible and useful?
  • Next by Date: Re: Looking for n for which all 2-partitions are prime partitions.
  • Previous by thread: Re: Matrix question
  • Next by thread: Re: Re: Condition for pure functions