From: asdf qwerty on 11 Feb 2010 06:11 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 11 Feb 2010 06:52 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 12 Feb 2010 04:44 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 12 Feb 2010 04:45 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.
|
Pages: 1 Prev: Translating this algorithm into mathematica code Next: Mathematica usage in finance |