MathGroup Archive 2005

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

Search the Archive

Re: Reals and Equal

  • To: mathgroup at smc.vnet.net
  • Subject: [mg62101] Re: Reals and Equal
  • From: lucb at ea.com
  • Date: Fri, 11 Nov 2005 02:52:13 -0500 (EST)
  • Sender: owner-wri-mathgroup at wolfram.com

you are really dealing with machine precision numbers here.
in the first case, Mathematica said that 0.5000000000000071` was equal to 0.5
and in the second case that 0.5000000000000072` was not equal to 0.5
Due to machine precision comparaison that seems like an ok behavior.
If you remove the . in a=1./2 and made it a=1/2 you would see that both test will return false because Mathematica will use the actual exact value.



Link to the forum page for this post:
http://www.mathematica-users.org/webMathematica/wiki/wiki.jsp?pageName=Special:Forum_ViewTopic&pid=5900#p5900
Posted through http://www.mathematica-users.org [[postId=5900]]



  • Prev by Date: Re: Timing runs for the last part of my previous post
  • Next by Date: Re: Mathematica 1
  • Previous by thread: Reals and Equal
  • Next by thread: Fitting numerical data