MathGroup Archive 2001

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

Search the Archive

Re: Q: Is there an "inverse" of ToRules?

  • To: mathgroup at
  • Subject: [mg31067] Re: [mg31038] Q: Is there an "inverse" of ToRules?
  • From: Tomas Garza <tgarza01 at>
  • Date: Sat, 6 Oct 2001 03:33:00 -0400 (EDT)
  • References: <>
  • Sender: owner-wri-mathgroup at

You may define your own. Example:

b = Solve[x^2 - 2 == 0, x]
{{x -> -Sqrt[2]}, {x -> Sqrt[2]}}
ToExpression[StringReplace[ToString[b], "->" -> "=="]]
{{x == -Sqrt[2]}, {x == Sqrt[2]}}

But I think it is better to stick to the solution expressed in terms of
rules. It takes a while to get used to it, but it pays. The rule has a
definite meaning which can be used in a ReplaceAll operation, whereas
something like the last output, with two "Equal" functions for the same x,
can lead to confusion.

Tomas Garza
Mexico City

----- Original Message -----
From: "Mark S. Coleman" <mcoleman at>
To: mathgroup at
Subject: [mg31067] [mg31038] Q: Is there an "inverse" of ToRules?

> Greetings,
> Is there an "inverse" to the ToRules function? That is, a function
> that converts rules to equations (expressed in == form), which could
> then be used in the Solve function?
> Thanks,
> Mark

  • Prev by Date: Re: Possible Incorrect Summation
  • Next by Date: Re: Urgent but simple problem III
  • Previous by thread: Q: Is there an "inverse" of ToRules?
  • Next by thread: Re: Q: Is there an "inverse" of ToRules?