[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[netCDF #YUZ-849018]: NetCDF float vs double in attribute
- To: mcginnis@xxxxxxxx
- Subject: [netCDF #YUZ-849018]: NetCDF float vs double in attribute
- From: "Unidata netCDF Support" <support-netcdf@xxxxxxxxxxxxxxxx>
- Date: Tue, 29 Apr 2008 08:32:23 -0600
- Delivered-to: support-netcdf@unidata.ucar.edu by laraine.unidata.ucar.edu (Postfix) with ESMTP id EDE14CB188; Tue, 29 Apr 2008 08:32:23 -0600 (MDT) id DF08CD4FBA; Tue, 29 Apr 2008 08:32:23 -0600 (MDT)
Seth,
If the attribute value is specified as -97.f, it is stored exactly as
a 32-bit float. If it were specified as -97.0, it would be stored
exactly as a 64-bit double. The values are exactly equal, whether you
compare them by converting the float to a double first or vice versa.
The reason this notation is used is to indicate the type of the
attribute without an explicit type declaration, by using the type of
the attribute value. This worked fine for the six netCDF-3 types, but
netCDF-4 will also permit explicit attribute type declarations in CDL.
--Russ
Russ Rew UCAR Unidata Program
russ@xxxxxxxxxxxxxxxx http://www.unidata.ucar.edu
Ticket Details
===================
Ticket ID: YUZ-849018
Department: Support netCDF
Priority: Normal
Status: Closed