MathGroup Archive 2004

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

Search the Archive

Re: Basic conditional statement question.

  • To: mathgroup at
  • Subject: [mg48666] Re: [mg48653] Basic conditional statement question.
  • From: Bob Hanlon <hanlonr at>
  • Date: Thu, 10 Jun 2004 02:42:58 -0400 (EDT)
  • Reply-to: hanlonr at
  • Sender: owner-wri-mathgroup at

a /: a!=0=True;
a /: IntegerQ[a]=True;

If[a!=0 && IntegerQ[a], Print["such and such"]]

such and such

Bob Hanlon
> From: jujio77 at (Scott)
To: mathgroup at
> Date: 2004/06/09 Wed AM 04:17:30 EDT
> To: mathgroup at
> Subject: [mg48666] [mg48653] Basic conditional statement question.
> Here is a question I would think has a simple solution.  Let's say I
> have some variable "a" which is an integer, but I haven't defined it
> in Mathematica.  I want to run a conditional statement on it. 
> Basically
> If[a!=0,Print["such and such"]]
> When I do something like this, Mathematica I asume is spitting out a
> null statement, because it doesn't do anything.  So, how can I define
> "a" such that Mathematica knows it isn't =0 yet, still some integer.
> The reason I ask is I am calculating Christophel symbols (and such)
> and many of them =0, so I want to only output those that are not equal
> to zero.
> Thanks for any help,
> Scott

  • Prev by Date: Re: transforming exponential of sums into product of exponentials
  • Next by Date: AW: Combining plots
  • Previous by thread: Re: Basic conditional statement question.
  • Next by thread: Re: Basic conditional statement question.