Re: Clip[DirectedInfinity[1]] remains unevaluated?
- To: mathgroup at smc.vnet.net
- Subject: [mg107435] Re: Clip[DirectedInfinity[1]] remains unevaluated?
- From: Raffy <adraffy at gmail.com>
- Date: Fri, 12 Feb 2010 04:44:31 -0500 (EST)
- References: <201002111018.FAA28036@smc.vnet.net> <hl0r26$ua$1@smc.vnet.net>
On Feb 11, 3:52 am, Patrick Scheibe <psche... at 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];
- References:
- Clip[DirectedInfinity[1]] remains unevaluated?
- From: asdf qwerty <bradc355113@yahoo.com>
- Clip[DirectedInfinity[1]] remains unevaluated?