MathGroup Archive 2000

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

Search the Archive

Re: keeping fractions from being simplified?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg22503] Re: keeping fractions from being simplified?
  • From: "David Bailey" <db at salford-software.com>
  • Date: Sun, 5 Mar 2000 00:24:41 -0500 (EST)
  • Organization: University of Salford, Salford, Manchester, UK
  • References: <892phl$pjn@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

Gerhard Killesreiter <killesreiter at physik.uni-freiburg.de> wrote in message
news:892phl$pjn at smc.vnet.net...
>
> Hi there!
>
> I am using mathematica 3.0. I would like to keep fractions _not_
> simplified, e.g. 12/9 should stay 12/9 and not become 4/3. Can I set
> this behaviour globally, that is without stating Hold[12/9]?
> Any help is appreciated!
> Gerhard

I think the first question is what exactly you want to do with these
fractions. For example, do you want to multiply them together, in which case
do you want Times[12/9,9/10] to end up as 108/90 or what. If you need the
feature badly enough you could define your own objects - say frac[12,9]  and
then define some mathematical operations on these objects, for example:

frac /: (frac[a_, b_]frac[c_, d_]) := frac[a c, b d]

You could even use MakeBoxes to arrange for these objects to print like
fractions (or maybe slightly differently to avoid confusion with ordinary
fractions).

David Bailey
Salford Software




  • Prev by Date: Re: Rearranging a tensor
  • Next by Date: Re: Mathematica and Acrobat Distiller
  • Previous by thread: Re: keeping fractions from being simplified?
  • Next by thread: Trouble with backspace under Linux/i386