Re: inconsistency with Inequality testing and Floor
- To: mathgroup at smc.vnet.net
- Subject: [mg59955] Re: [mg59927] inconsistency with Inequality testing and Floor
- From: Andrzej Kozlowski <akoz at mimuw.edu.pl>
- Date: Fri, 26 Aug 2005 04:53:52 -0400 (EDT)
- References: <200508251034.GAA10208@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
This is indeed inconsistent but this inconsistency itself is consistent with the other inconsistencies inherent in the concept of inexact numbers, e.g. x<1 False 1-x>0 True x == 1 True 1-x==0 False and so on. You cannot expect inexact numbers, particularly "borderline cases" as in this example, to obey the usual laws of arithmetic. Andrzej Kozlowski On 25 Aug 2005, at 11:34, Brett Patterson wrote: > > 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 > >
- References:
- inconsistency with Inequality testing and Floor
- From: "Brett Patterson" <muckle.moose@gmail.com>
- inconsistency with Inequality testing and Floor