Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2012

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

Search the Archive

Re: Converting from string to real

  • To: mathgroup at smc.vnet.net
  • Subject: [mg126789] Re: Converting from string to real
  • From: Bob Hanlon <hanlonr357 at gmail.com>
  • Date: Thu, 7 Jun 2012 05:21:45 -0400 (EDT)
  • Delivered-to: l-mathgroup@mail-archive0.wolfram.com
  • References: <201206060853.EAA17920@smc.vnet.net>

You are seeing the effect of the preference setting for the
PrintPrecision display option. All of the digits can be seen by
controlling the display (or changing the preference).

x = {ToExpression["109266.75"], Pi//N}

{109267.,3.14159}

x//InputForm

{109266.75, 3.141592653589793}

x//FullForm

List[109266.75`,3.141592653589793`]

NumberForm[x,8]

{109266.75,3.1415927}


Bob Hanlon


On Wed, Jun 6, 2012 at 4:53 AM, fcaleyo <fcaleyo at gmail.com> wrote:
> Hi guys, I've got a problem with ToExpression[].
> It seems to round large real numbers off, e.g.
> ToExpression["109266.75"] returns 109267., still a real, yet not exactly what the original string meant.
> Any idea to solve this?
> Many thanks
> fcaleyo
>



  • Prev by Date: Re: Converting from string to real
  • Next by Date: Re: Converting from string to real
  • Previous by thread: Re: Converting from string to real
  • Next by thread: Re: Converting from string to real