Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #16335

Re: gives 919.8359999999999?`

From Bob Hanlon <hanlonr357@gmail.com>
Newsgroups comp.soft-sys.math.mathematica
Subject Re: gives 919.8359999999999?`
Date 2013-12-10 09:00 +0000
Message-ID <l86l6t$oa6$1@smc.vnet.net> (permalink)
References <20131205080510.023806A20@smc.vnet.net>
Organization Time-Warner Telecom

Show all headers | View raw


916.536 + 3.3 // FullForm

TagBox[
StyleBox["919.8359999999999`",
ShowSpecialCharacters->False,
ShowStringCharacters->True,
NumberMarks->True],
FullForm]


Precision[916.536 + 3.3]


MachinePrecision


% // N


15.9546


NumberForm[916.536 + 3.3, 15]

TagBox[
InterpretationBox["\<\"919.836\"\>",
919.8359999999999,
AutoDelete->True],
NumberForm[#, 15]& ]


"NumberForm[expr, n] prints with approximate real numbers in expr given to
n - digit precision."


SetPrecision[916.536 + 3.3, 15]


919.836000000000


Precision[%]


15.



Bob Hanlon




On Sun, Dec 8, 2013 at 4:33 AM, Murray Eisenberg <murray@math.umass.edu>wrote:

> Then perhaps the original question should have been to reconcile:
>
>        FullForm[916.536 + 3.3]
>    919.8359999999999`
>
>        NumberForm[916.536 + 3.3, 15]
>   919.836
>
>
> On Dec 6, 2013, at 2:16 AM, Sseziwa Mukasa <mukasa@gmail.com> wrote:
>
> > Because by default non-integer values are stored as machine precision
> values and the values displayed are typically displayed up to 5 decimal
> places but FullForm displays a more accurate representation of the actual
> machine precision value.
> >
> > On Dec 5, 2013, at 3:05 AM, Guillermo Sanchez <
> guillermo.sanchez@hotmail.com> wrote:
> >
> >> FullForm[916.536 + 3.3] gives 919.8359999999999 instead of 919.836?
> >>
> >> Guillermo
> >>
> >
> >
>
> ---
> Murray Eisenberg
> murray@math.umass.edu
> Mathematics & Statistics Dept.
> Lederle Graduate Research Tower
> University of Massachusetts
> 710 North Pleasant Street
> Amherst, MA 01003-9305
>
>

Back to comp.soft-sys.math.mathematica | Previous | Next | Find similar | Unroll thread


Thread

Re: gives 919.8359999999999?` Bob Hanlon <hanlonr357@gmail.com> - 2013-12-10 09:00 +0000

csiph-web