MathGroup Archive 2005

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

Search the Archive

Re: inconsistency with Inequality testing and Floor

  • To: mathgroup at smc.vnet.net
  • Subject: [mg59942] Re: inconsistency with Inequality testing and Floor
  • From: "Jens-Peer Kuska" <kuska at informatik.uni-leipzig.de>
  • Date: Fri, 26 Aug 2005 04:53:31 -0400 (EDT)
  • Organization: Uni Leipzig
  • References: <dek8a1$aao$1@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

Hi,

$MachinePrecision is a machine floating point 
number and

the result of x = 1.0 - 10^-($MachinePrecision)
is a machine number. If you use

x = 1 - 10^-(Round[$MachinePrecision])

x>=1 gives False

Regards

  Jens

"Brett Patterson" <muckle.moose at gmail.com> schrieb 
im Newsbeitrag news:dek8a1$aao$1 at smc.vnet.net...
|
| I have observed the following strange behaviour:
|
| ----------------------
| In[1]:=   x = 1.0 - 10^-($MachinePrecision)
|
| Out[1]=   1.
|
| In[2]:=   x >= 1
|
| Out[2]=   True
|
| In[3]:=   Floor[x]
|
| Out[3]=   0
| ----------------------
|
| It seems that the inequality test and Floor use 
different numerical
| methods.
| I think this behaviour is inconsistent.
| If the test "x >= 1" evaluates to True, then 
Floor[x] should evaluate
| to 1.
|
| Can anyone shed any light on this?
|
| Regards,
| Brett Patterson
|
| School of Physics, University of Western 
Australia; and
| Institute of Photonics, University of 
Strathclyde, Scotland
| 



  • Prev by Date: Re: Hi, a simple question, thanks
  • Next by Date: Re: format of "Solve" output
  • Previous by thread: Re: inconsistency with Inequality testing and Floor
  • Next by thread: Re: inconsistency with Inequality testing and Floor