It seems std::ostringstream ignores NaN signs on Darwin while it prints them on Linux. This causes
that LLDB behaves differently on those platforms which is both confusing for users and it also
means we have to deal with that in our tests.
This patch manually implements the NaN/Inf printing (which are apparently implementation defined)
to make LLDB print the same thing on all platforms. The only output difference in practice seems to
be that we now print negative NaNs as -nan, but this potentially also changes the output on other
systems I haven't tested this on.
Seems like this could be part of the doxygen comment above?