This routine is the same as StrToFloat except that it can also handle NAN and INF values. It will work with both ',' and '.' as decimal separator, but the code will run 2x faster for the currently default decimal separator. StrToVal is used also by StrToCplx function.