Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2009

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

Search the Archive

Re: Matrices, TraditionalForm and Two Equal Signs

  • To: mathgroup at smc.vnet.net
  • Subject: [mg100966] Re: Matrices, TraditionalForm and Two Equal Signs
  • From: C Rose <uk.org.microserf at googlemail.com>
  • Date: Thu, 18 Jun 2009 20:48:38 -0400 (EDT)
  • References: <h19i25$p00$1@smc.vnet.net> <h1cva7$jgv$1@smc.vnet.net>

Thanks for this solution.

Chris

> It looks like what's happening is that the equality is being
> simplified: Mathematica recognizes that a.b == N[a.b] is True, and so
> drops the last part.
>
> As you say, one way around this would be to use a Hold construct. It's
> a bit fiddly because you need the a.b and N[a.b] to evaluate before
> applying the Hold. The following is one way to do this (there is
> probably a neater way):
>
> HoldForm[#1 == #2 == #3] &[A B, a.b, N[a.b]] // TraditionalForm
>
> By using this anonymous function construct, the three arguments to
> Equal are first evaluated, then the HoldForm prevents further
> evaluation.
>
> Another, possibly simpler, solution would be to use a Row construct:
>
> Row[{A B, " \[Equal] ", a.b, " \[Equal] ", N[a.b]}] // TraditionalForm
>
> The downside here is that this can no longer be evaluated (whereas in
> the previous case you could use ReleaseHold) -- though this is
> probably not an issue.



  • Prev by Date: Re: How can I parse arguments of an expression unevaluated?
  • Next by Date: Strange Behaviour: CellAutoOverwrite
  • Previous by thread: Re: Matrices, TraditionalForm and Two Equal Signs
  • Next by thread: erroneous result when adding reals