Why do both Double and Float have NaN,Int but don't seem to have it?

I have a data like this

{
    "_double": 2.333,
    "_float":3.14159,
    "_int":314,
}

I will convert _ double to double (not accepted with Double ), and so on.
but the data given by the server sometimes looks like this

{
    "_double":null,
    "_float":null,
    "_int":null,
}

I want to treat this number differently, because the default value 0.0 and this is null are two cases that need to be handled differently. Therefore, it cannot be directly set to the default value.
because Double and Float have Double.NaN and Float.NaN I can set this by default, but there is no corresponding type for int .

Mar.01,2021

because NaN is a floating point number, as defined in the IEEE754 specification.

but from your description, you misused NaN and JSON.

Type of JSON:

JSON number:

Menu