The InOutString function is not really useful, in most cases it can
be done more simple with string operator+. This function is causing
issues on MSVC (perhaps the template param names) anyway.
On some platforms like MSVC, NaN prints as "-nan(ind)". This
is a bit needlessly ugly, so print "NaN" on all platforms
consistently.
This fixes a test failure on MSVC.