mirror of
https://github.com/Unidata/netcdf-c.git
synced 2025-01-12 15:45:21 +08:00
Fix java generation for nan values, use Float.NaN and Double.NaN
This commit is contained in:
parent
ba5d3ca50a
commit
7aa25f4e7b
@ -50,10 +50,18 @@ j_constant(Generator* generator, NCConstant* con, Bytebuffer* buf,...)
|
||||
bbprintf(codetmp,"%d",con->value.int32v);
|
||||
break;
|
||||
case NC_FLOAT:
|
||||
bbprintf(codetmp,"%f",con->value.floatv);
|
||||
/* Special case for nan */
|
||||
if(isnan(con->value.floatv))
|
||||
bbprintf(codetmp,"Float.NaN");
|
||||
else
|
||||
bbprintf(codetmp,"%f",con->value.floatv);
|
||||
break;
|
||||
case NC_DOUBLE:
|
||||
bbprintf(codetmp,"%lf",con->value.doublev);
|
||||
/* Special case for nan */
|
||||
if(isnan(con->value.doublev))
|
||||
bbprintf(codetmp,"Double.NaN");
|
||||
else
|
||||
bbprintf(codetmp,"%lf",con->value.doublev);
|
||||
break;
|
||||
case NC_UBYTE:
|
||||
bbprintf(codetmp,"%hhu",con->value.uint8v);
|
||||
|
Loading…
Reference in New Issue
Block a user