Today while I was doing a code review with my team mates, I noticed some code like this
When I asked them why do you type cast "null to double", the answer they gave was I got "Type mismatch: cannot convert from null to double". There are 2 possible solutions for this,
- Use Double instead of double, then you may use null.
- Use "not a number" (NaN) like this
No comments:
Post a Comment