MathGroup Archive 2005

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

Search the Archive

Re: Condition for pure functions


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