Re: inconsistency with Inequality testing and Floor
- To: mathgroup at smc.vnet.net
- Subject: [mg59959] Re: inconsistency with Inequality testing and Floor
- From: "James Gilmore" <james.gilmore at yale.edu>
- Date: Fri, 26 Aug 2005 04:53:58 -0400 (EDT)
- Organization: Yale University
- References: <dek8a1$aao$1@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
Hi Brett, Convert the output of > In[1]:= x = 1.0 - 10^-($MachinePrecision) to INPUT FORM. You will notice that it is not 1 and therefore there is no inconsistency. This is a result of rounding in Output form. I hope all is well at UWA. Go Dockers! -- James Gilmore Graduate Student Department of Physics Yale University New Haven, CT 06520 USA "Brett Patterson" <muckle.moose at gmail.com> wrote in message 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 >