Index: src/conversions-inl.h |
diff --git a/src/conversions-inl.h b/src/conversions-inl.h |
index bac15768270f4fe0808c31332e261dac81312dce..3b816019c1e79e54c972a347ba04fcaed3599551 100644 |
--- a/src/conversions-inl.h |
+++ b/src/conversions-inl.h |
@@ -67,6 +67,13 @@ inline unsigned int FastD2UI(double x) { |
} |
+inline float DoubleToFloat32(double x) { |
titzer
2014/09/22 11:24:54
I think you will need to assign the result to a vo
Benedikt Meurer
2014/09/22 11:37:53
Done.
|
+ // TODO(yanggou): This static_cast is implementation-defined behaviour in C++, |
+ // so we may need to do the conversion manually instead to match the spec. |
+ return static_cast<float>(x); |
+} |
+ |
+ |
inline double DoubleToInteger(double x) { |
if (std::isnan(x)) return 0; |
if (!std::isfinite(x) || x == 0) return x; |