mirror of
https://github.com/Unidata/netcdf-c.git
synced 2025-03-01 17:06:03 +08:00
Use quiet comparison when converting from double to float
This commit is contained in:
parent
71392b3a2c
commit
7b7069980b
@ -1212,7 +1212,7 @@ nc4_convert_type(const void *src, void *dest, const nc_type src_type,
|
||||
case NC_FLOAT:
|
||||
for (dp = (double *)src, fp = dest; count < len; count++)
|
||||
{
|
||||
if (*dp > X_FLOAT_MAX || *dp < X_FLOAT_MIN)
|
||||
if (isgreater(*dp, X_FLOAT_MAX) || isless(*dp, X_FLOAT_MIN))
|
||||
(*range_error)++;
|
||||
*fp++ = *dp++;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user