MathGroup Archive 2014

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

Search the Archive

Re: standard floating point arithmetic in Mathematica?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg132483] Re: standard floating point arithmetic in Mathematica?
  • From: David Reiss <dbreiss at gmail.com>
  • Date: Fri, 28 Mar 2014 03:30:50 -0400 (EDT)
  • 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: <lh0pbt$m4l$1@smc.vnet.net>

Both CForm and FortranForm will do what you illustrate:

In[1]:= CForm[0.1+0.2]
Out[1]//CForm=
0.30000000000000004
In[2]:= FortranForm[0.1+0.2]
Out[2]//FortranForm=
0.30000000000000004



On Thursday, March 27, 2014 5:00:45 AM UTC-4, Alan wrote:
> I would like to illustrate some limitations with floating point calculations.  Can I force Mathematica to do floating point computations at a standard float size and the display the full results (as the same size float)?
> 
> 
> 
> E.g., if I enter
> 
> 0.1+0.2
> 
> I would like to see
> 
> 0.30000000000000004
> 
> 
> 
> Thanks,
> 
> Alan Isaac



  • Prev by Date: Re: Combinatorica versus new graphs in V8
  • Next by Date: Re: standard floating point arithmetic in Mathematica?
  • Previous by thread: Re: standard floating point arithmetic in Mathematica?
  • Next by thread: Re: standard floating point arithmetic in Mathematica?