Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2005
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2005

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

Search the Archive

Re: Eliminating Annoying Minus Signs

  • To: mathgroup at smc.vnet.net
  • Subject: [mg58767] Re: [mg58756] Eliminating Annoying Minus Signs
  • From: "David Park" <djmp at earthlink.net>
  • Date: Sun, 17 Jul 2005 13:03:12 -0400 (EDT)
  • Sender: owner-wri-mathgroup at wolfram.com

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


  • Prev by Date: formatting question
  • Next by Date: Re: Improper use of slot
  • Previous by thread: Re: Eliminating Annoying Minus Signs
  • Next by thread: Re: Eliminating Annoying Minus Signs