Re: Re: Eliminating Annoying Minus Signs
- To: mathgroup at smc.vnet.net
- Subject: [mg58779] Re: [mg58770] Re: [mg58756] Eliminating Annoying Minus Signs
- From: Bob Hanlon <hanlonr at cox.net>
- Date: Mon, 18 Jul 2005 03:21:18 -0400 (EDT)
- Reply-to: hanlonr at cox.net
- Sender: owner-wri-mathgroup at wolfram.com
The attributes are documented, use ?? to see them:
??Numerator
??Denominator
Bob Hanlon
>
> From: yehuda ben-shimol <bsyehuda at gmail.com>
To: mathgroup at smc.vnet.net
> Date: 2005/07/17 Sun PM 01:03:15 EDT
> Subject: [mg58779] [mg58770] Re: [mg58756] Eliminating Annoying Minus Signs
>
> Hi David,
> Although not documented it seems that both Numerator and Denominator
> are listable so
> (-Numerator[#])/(-Denominator[#])&[test]
> or
> test//(-Numerator[#])/(-Denominator[#])&
> will do the same without mapping.
> yehuda
>
> On 7/17/05, David Park <djmp at earthlink.net> wrote:
> > Yehuda,
> >
> > Thanks. That seems pretty good.
> >
> > We could turn this into a routine that could be mapped onto terms more
> > generally in an expression.
> >
> > NDSignSwitch = (-Numerator[#])/(-Denominator[#]) &;
> >
> > test = {-((2*x)/(-1 + z)), -((2*y)/(-1 + z)), -1};
> >
> > NDSignSwitch /@ test
> > {(2*x)/(1 - z), (2*y)/(1 - z), -1}
> >
> > David Park
> > djmp at earthlink.net
> > http://home.earthlink.net/~djmp/
> >
> >
> >
> > From: yehuda ben-shimol [mailto:bsyehuda at gmail.com]
To: mathgroup at smc.vnet.net
> >
> > Hi David,
> > How about
> > (- Numerator /@ test)/(- Denominator /@ test)
> > this is not error prone.
> > I'm almost certaint that there is more efficient way of doing this.
> > I'll try to find it later
> > regards
> > yehuda
> >
> >
>
>