Although we can read in LR:
NaN (i.e. "Not a Number"): occurs if you attempted to perform an illegal mathematical operation, like getting the square root of a negative number. Any further calculation made with a NaN will lead to a NaN value. Str or Format methods return a string beginning with "NaN", e.g. "NaN(021)".
This is no true. There is an error, since if I write this code:
This error is not very important unless you pretend to detect NaN numbers in your program. Both Nan and Infinity use "#" when converting to string.
I've created a function like this:
Function IsNotANumber (x as double) as Boolean if Str(x).InStr("#") = 0 Then Return False else Return True end function
This works very well. But, can I trust Xojo will keep this conversion to string for ever?
Have you created your own function for this? How do you do it?
Should I use "IsNumeric"?
Thanks in advance,