Re: Another conversion question for Russ

NOTE: The netcdf-hdf mailing list is no longer active. The list archives are made available for historical reasons.

Hi Russ,

> > Quincey Koziol <koziol@xxxxxxxxxxxxx> writes:
> > 
> > > Hi Russ,
> > >     When an integer value is converted to a float, but the
> > > floating-point value doesn't have enough precision to hold the
> > > correct value, it gets rounded.  Is this an "overflow" from
> > > netcdf-3's perspective?  It will be an "overflow" in the
> > > implementation we are adding.
> > > 
> > >     Quincey
> > 
> > My understanding is that this is NOT an overflow for netcdf. Loss of
> > precision is not an error. Only values that are too large to convert
> > are range errors.
> > 
> > For example, I don't think netcdf will ever have a range problem
> > converting ints to floats. Russ, am I completely wrong about that?
> 
> You're right, loss of precision is not an overflow.  Again, the
> C/Fortran assignment model is followed, in which there is no error or
> warning when trying to assign a float value to an int, merely
> truncation.
    Ok, I'll include a parameter in the callback call that indicates why the
callback routine was called (overflow, loss of precision, etc.), which should
allow the nc4 overflow routine to make the correct judgement call.

    Quincey

  • 2003 messages navigation, sorted by:
    1. Thread
    2. Subject
    3. Author
    4. Date
    5. ↑ Table Of Contents
  • Search the netcdf-hdf archives: