MathGroup Archive 2007

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

Search the Archive

Re: IsExact

  • To: mathgroup at
  • Subject: [mg80617] Re: IsExact
  • From: carlos at
  • Date: Sun, 26 Aug 2007 23:19:50 -0400 (EDT)
  • References: <far9j8$477$>

Thanks to all who replied.  Several of you gave the solution

     IsExact[expr_] := Precision[expr]===Infinity

By analogy

     Isinexact[expr_] := Precision[expr]=!=Infinity

IsExact[c6] returns True for the dubious case {N[x]} but that
seems to be OK if x is undefined.  In any case both work
fine for the intended purpose, which is checking module
arguments.  Some modules of a G&C research program
only work properly for exact inputs.  For example:

    If [n<=0, Return[{}]]; rep=z->r*(s+1)/(s-1);
    If [IsInexact[a]||IsInexact[r], Print[modname,
        " error: float input"]; Return[Null]];
    k=FindLastNonzero[a]; If [k==0, Return[{0}]];
    If [norm, j=FindLastNonzero[b]; If [j>0,b=b/b[[j]] ]];

  • Prev by Date: Re: Improper Integral & Mathematica
  • Next by Date: Re: problem with parsing InputForm scientific notation (eg. 3.`*^-7)
  • Previous by thread: Re: IsExact
  • Next by thread: Re: 6.0 Get Graphics Coordinates...