Re: About numeric precision

From: Cheung <zuibeidemei_at_nyahnyahspammersnyahnyah>
Date: Fri Aug 03 2012 - 12:35:10 MDT

Thanks!

And if I read data from an ascii file, and I use the double array as
xxx = new((/a,b,/),double)
xxx = asciiread(x,x,x)

will that happen again?
or it depends on my data?

At 2012-08-04 02:29:24,"Andrew Mai" <mai@ucar.edu> wrote:
>On 08/03/2012 12:24 PM, Cheung wrote:
>
>> a = new(1,double)
>> a = 19800103. (plus a point)
>> print(a)
>> a will be 19800104
>
>You have converted a 32-bit float to a 64-bit float. 32-bit floats only have about 7 decimal places of accuracy.
>
>If, instead, you did:
>
>a = 19800103.d0
>print(a)
>
>you would get 19800103 as you expect.
>
>Andy

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Fri Aug 3 12:35:23 2012

This archive was generated by hypermail 2.1.8 : Fri Aug 03 2012 - 14:39:58 MDT