How to check if a double is null?

前端 未结 6 1159
天涯浪人
天涯浪人 2020-12-01 13:58

I\'m querying a database and some of the results I\'m getting are null. I\'m setting these values to a variable with a datatype of double. Let\'s call the variable \"results

6条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-01 14:06

    To say that something "is null" means that it is a reference to the null value. Primitives (int, double, float, etc) are by definition not reference types, so they cannot have null values. You will need to find out what your database wrapper will do in this case.

提交回复
热议问题