From: asdf qwerty on
Shouldn't Clip[Infinity] evaluate to 1? It remains unevaluated. I'm
trying to think of a reason why 1 wouldn't always be the correct
answer. Same with Clip[-Infinity], seems like it should be -1.

From: Patrick Scheibe on
Hi,

what about

Clip[Infinity] // Simplify

?

Cheers
Patrick

On Thu, 2010-02-11 at 05:18 -0500, asdf qwerty wrote:
> Shouldn't Clip[Infinity] evaluate to 1? It remains unevaluated. I'm
> trying to think of a reason why 1 wouldn't always be the correct
> answer. Same with Clip[-Infinity], seems like it should be -1.
>


From: Raffy on
On Feb 11, 3:52 am, Patrick Scheibe <psche...(a)trm.uni-leipzig.de>
wrote:
> Hi,
>
> what about
>
> Clip[Infinity] // Simplify
>
> ?
>
> Cheers
> Patrick
>
>
>
> On Thu, 2010-02-11 at 05:18 -0500, asdf qwerty wrote:
> > Shouldn't Clip[Infinity] evaluate to 1? It remains unevaluated. I'm
> > trying to think of a reason why 1 wouldn't always be the correct
> > answer. Same with Clip[-Infinity], seems like it should be -1.

You can fix by doing:

Unprotect[Clip];
Clip[x_List /; ! Developer`PackedArrayQ[x], a___] := Clip[#, a] & /@
x;
Clip[Infinity] = 1;
Clip[Infinity, ___, {_, max_}] := max;
Clip[-Infinity] = -1;
Clip[-Infinity, ___, {min_, _}] := min;
Protect[Clip];

From: asdf qwerty on
Heh, thanks :-)

On Feb 11, 3:52 am, Patrick Scheibe <psche...(a)trm.uni-leipzig.de>
wrote:
> Hi,
>
> what about
>
> Clip[Infinity] // Simplify
>
> ?
>
> Cheers
> Patrick
>
> On Thu, 2010-02-11 at 05:18 -0500, asdf qwerty wrote:
> > Shouldn't Clip[Infinity] evaluate to 1? It remains unevaluated. I'm
> > trying to think of a reason why 1 wouldn't always be the correct
> > answer. Same with Clip[-Infinity], seems like it should be -1.