kamagra how much to take

What the hell is NaN?

Someone who was doing a code review for me asked me this question, and how it related to .NET development in general. Funny misconception about NaN, it is not just limited to .NET compatible languages, but is actually an enter computer science concept, to represent an invalid file output based on invalid input operands. I have never used it for anything besides floating point calculations.

The code in question was a condition statement that was taking a SPListItem as a parameter, and was used to check whether the item was a double precision floating number. For this NaN was a definitely a good option! Here is the code:

  1. double isDouble(SPListItem ListItem)
  2. {
  3. if (this._yourField == SPFieldType.Number)
  4. {
  5. try
  6. {
  7. string iListName = ListItem[this._somestring].ToString();
  8. return double.Parse(iListName);
  9. }
  10. catch
  11. {
  12. return double.NaN;
  13. }
  14. }
  15. return double.NaN;
  16. }

I suppose that there are other ways that you could use a custom method to do the same type of test, but this is small and efficient.

Share

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>