       RE: Comparison Error. Is ther

• To: mathgroup at smc.vnet.net
• Subject: [mg12714] RE: [mg12678] Comparison Error. Is ther
• Date: Wed, 3 Jun 1998 02:21:04 -0400
• Sender: owner-wri-mathgroup at wolfram.com

```Chris wrote:
|
|I'm having trouble with comparisons, see below: |
|In:= x=0.9;
|             y=10;
|
|In:= (1-x)y
|
|Out=1.
|
|The above obviously evaluates to 1. |
|In:= (1-x)y <1
|
|Out= True
|
|The above gives the wrong answer.
|
|In:= (1-x)y<1.
|
|Out= False
|
|This gives the right answer, notice the decimal point after the 1. |
|

In the lines below I present a paradox somewhat related to the problem
above.
First I let (x) be a number near (-Pi/2) with eight digits of precision.

In:=
x= -1.57079646`8;
y=Tan[x]

Out=
0.  x 10^6
(* Actually that's only the way it looks in a notebook.  *)

I think the result in Out  means the number is on the order of 10^6,
but  the leading digit is unknown.  Now you get really strange results
for the  tests below.

In:=
x1=6630000;
{x1<r, r<x1}

Out=
{False, False}

In:=
x2=x1+1670000;
{x2<r, r<x2}

Out=
{False, False}

In:=
{
r==x1+100000,
r==x1+200000,
r==x1+300000,
r==x1+400000}

Out=
{True, True, True, True}

What should we get for the results in Out, Out, Out ? I think
we should get  "Uncertain"  when two numeric values are compared,  and
we can't be certain that the result is True or False.
____________________
Ted Ersek

```

• Prev by Date: RE: Union[{0},{0.}] = {0,0.}?
• Next by Date: RE: Comparison Error. Is ther
• Previous by thread: Re: Finite Element Code in Mathematica
• Next by thread: RE: Comparison Error. Is ther