* Added percentage sign if needed when dumping nan and infinity. * Added unit tests. * Used clang-format for changed source files.