Services & Resources / Wolfram Forums
MathGroup Archive
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 1998

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

Search the Archive

Comparison Error. Is there an overall fix?

  • To: mathgroup at
  • Subject: [mg12678] Comparison Error. Is there an overall fix?
  • From: "Chris Farr" <farr at>
  • Date: Mon, 1 Jun 1998 23:16:50 -0400
  • Sender: owner-wri-mathgroup at

I'm having trouble with comparisons, see below:

In[10]:= x=0.9;

In[11]:= (1-x)y


The above obviously evaluates to 1.

In[12]:= (1-x)y <1

Out[12]= True

The above gives the wrong answer.

In[13]:= (1-x)y<1.

Out[13]= False

This gives the right answer, notice the decimal point after the 1.

Do I have to remember to put 1. on the right hand side each time?  What
 if, on occasion, the left hand side turns out to be "1", instead of
 Doing N[] is not a global fix, because sometimes my expression can be 
0.  In this case, N[0] is not "0.", it is just "0".  So, the N[] to
both  sides won't always work.

Is there some global way to correct for this kind of stuff????

Thanks in advance,


  • Prev by Date: Re: 3D graphs/coord. axes
  • Next by Date: Re: Missing link
  • Previous by thread: Re: 3D graphs/coord. axes
  • Next by thread: Re: Missing link