Re: print() precision

From: Dennis Shea <shea_at_nyahnyahspammersnyahnyah>
Date: Wed Jul 31 2013 - 10:07:05 MDT

   xf = 0.4071155678
   xd = 0.4071155678d

   print("xf="+xf +" : "+sprintf("%13.6f", xf))
   print("xd="+xd +" : "+sprintf("%13.10f", xd))

==============

(0) xf=0.407116 : 0.407116
(0) xd=0.407116 : 0.4071155678

On 7/31/13 9:57 AM, Wei Huang wrote:
> Fan,
>
> Try
>
> print(0.407115567890123456789d)
>
> Wei
>
> huangwei@ucar.edu
> VETS/CISL
> National Center for Atmospheric Research
> P.O. Box 3000 (1850 Table Mesa Dr.)
> Boulder, CO 80307-3000 USA
> (303) 497-8924
>
>
>
>
>
>
> On Jul 31, 2013, at 9:41 AM, Fan Fang <Fan.Fang@nasa.gov> wrote:
>
>> It appear print() only does floats. IS there an easy way to print out
>> just what is fed?
>>
>> -Fan
>>
>> begin
>> print(0.4071155678)
>> end
>>
>> Copyright (C) 1995-2009 - All Rights Reserved
>> University Corporation for Atmospheric Research
>> NCAR Command Language Version 5.1.1
>> The use of this software is governed by a License Agreement.
>> See http://www.ncl.ucar.edu/ for more details.
>> (0) 0.4071156
>> _______________________________________________
>> ncl-talk mailing list
>> List instructions, subscriber options, unsubscribe:
>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Wed Jul 31 10:07:14 2013

This archive was generated by hypermail 2.1.8 : Thu Aug 01 2013 - 15:55:03 MDT