Final set of fixes for floating matchers approvals
This commit is contained in:
parent
a0dbc62955
commit
8dbaac61ff
5 changed files with 70 additions and 62 deletions
|
@ -17,6 +17,7 @@
|
|||
#include "catch_interfaces_config.h"
|
||||
#include "catch_context.h"
|
||||
|
||||
#include <cmath>
|
||||
#include <iomanip>
|
||||
|
||||
namespace Catch {
|
||||
|
@ -63,6 +64,10 @@ namespace Detail {
|
|||
|
||||
template<typename T>
|
||||
std::string fpToString( T value, int precision ) {
|
||||
if (std::isnan(value)) {
|
||||
return "nan";
|
||||
}
|
||||
|
||||
ReusableStringStream rss;
|
||||
rss << std::setprecision( precision )
|
||||
<< std::fixed
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue