MathGroup Archive 2013

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

Search the Archive

Re: gives 919.8359999999999?`

  • To: mathgroup at smc.vnet.net
  • Subject: [mg132110] Re: gives 919.8359999999999?`
  • From: Murray Eisenberg <murray at math.umass.edu>
  • Date: Sun, 8 Dec 2013 04:34:18 -0500 (EST)
  • Delivered-to: l-mathgroup@mail-archive0.wolfram.com
  • Delivered-to: l-mathgroup@wolfram.com
  • Delivered-to: mathgroup-outx@smc.vnet.net
  • Delivered-to: mathgroup-newsendx@smc.vnet.net
  • References: <l7pbp3$gbk$1@smc.vnet.net> <20131206071706.6DBB46A41@smc.vnet.net>

Adding large floating point to small floating point hardly seems relevant here, given that the the larger number is only on the order of 3*10^2 times as large as the smaller.  Floating point errors in addition (and, more often perhaps, subtraction) due to relative differences in size typically arise when the ratio of orders of magnitude is much larger.

On the other hand, roundoff error in converting from decimal to internal binary, limitation of machine precision for the binary operation, and finally roundoff error in converting back to decimal, are surely the essential explanation here.

Or am I seriously wrong in this?

On Dec 6, 2013, at 2:17 AM, Nasser M. Abbasi <nma at 12000.org> wrote:

> On 12/5/2013 1:59 AM, Guillermo Sanchez wrote:
>> FullForm[916.536 + 3.3] gives 919.8359999999999 instead of 919.836?
>>
>> Guillermo
>>
>
> computers use computation using floating points. And the above is
> the result of adding large floating point to small floating point. 
>
> Same result in Mat*ab
>
> ---------------------
> EDU>> format long
> EDU>> 916.536 + 3.3
>
>      9.198359999999999e+02
> --------------------
>
> What you see on the screen with:
>
> ---------------------
> 916.536 + 3.3
>     919.836  <------------- OUT
> ---------------------
>
> Then the 919.836 is not the actual value inside the computer. If
> you point the mouse to the end of the outout cell above and hit
> enter, you'll get the actual value
>
>     919.8359999999999`
>
> which is the FullForm
>
> --Nasser
>
>
>

---
Murray Eisenberg                                    
murray at math.umass.edu
Mathematics & Statistics Dept.      
Lederle Graduate Research Tower           
University of Massachusetts 
710 North Pleasant Street  
Amherst, MA 01003-9305








  • Prev by Date: Re: gives 919.8359999999999?`
  • Next by Date: Mathematica Patches or Incremental Updates
  • Previous by thread: Re: Why FullForm[916.536 + 3.3] gives 919.8359999999999?`
  • Next by thread: Manipulate and Module