MathGroup Archive 2010

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

Search the Archive

Re: Quick way to return the boundaries of an inequality?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg111945] Re: Quick way to return the boundaries of an inequality?
  • From: Themis Matsoukas <tmatsoukas at me.com>
  • Date: Fri, 20 Aug 2010 07:07:33 -0400 (EDT)

Perhaps not the most elegant solution but should work if \[Theta]  is always bounded on both sides:

PickBounds[a_] := Module[
  {b, c},
  b = If[Depth[a] == 3, a, {a}];
  c = Table[Apply[List, b[[i]]], {i, 1, Length[b]}];
  Delete[c, Table[{i, 2}, {i, 1, Length[b]}]]
  ]

PickBounds[1.0848 <= \[Theta] <= 1.18296 || 3.64861 <= \[Theta] <= 3.70078]

{{1.0848, 1.18296}, {3.64861, 3.70078}}

PickBounds[1.0848 <= \[Theta] <= 1.18296]

{{1.0848, 1.18296}}

Themis


  • Prev by Date: Hanging indent in Print[] output?
  • Next by Date: Re: "Abort Evaluation" does not work
  • Previous by thread: Re: Quick way to return the boundaries of an inequality?
  • Next by thread: Re: Quick way to return the boundaries of an inequality?