diff --git a/include/yaml-cpp/emitter.h b/include/yaml-cpp/emitter.h index c58d227..f0cd2d8 100644 --- a/include/yaml-cpp/emitter.h +++ b/include/yaml-cpp/emitter.h @@ -178,7 +178,7 @@ inline Emitter& Emitter::WriteStreamable(T value) { } } - if ((float)((int) value ) == value ){ + if (static_cast(static_cast(value)) == value){ stream << std::fixed << std::setprecision(1) << value; }else if (!special) { stream << value;