Fix MSVC compile warning with trunc/round, bug394.

This commit is contained in:
Wilson Snyder
2011-09-21 09:08:05 -04:00
parent 71306ceb1d
commit 094d676a8b
4 changed files with 21 additions and 4 deletions
+2 -2
View File
@@ -1475,12 +1475,12 @@ V3Number& V3Number::opIToRD (const V3Number& lhs) {
return setDouble(lhs.toSInt());
}
V3Number& V3Number::opRToIS (const V3Number& lhs) {
double v = trunc(lhs.toDouble());
double v = VL_TRUNC(lhs.toDouble());
vlsint32_t i = (vlsint32_t)v; // C converts from double to vlsint32
return setLongS(i);
}
V3Number& V3Number::opRToIRoundS (const V3Number& lhs) {
double v = round(lhs.toDouble());
double v = VL_ROUND(lhs.toDouble());
vlsint32_t i = (vlsint32_t)v; // C converts from double to vlsint32
return setLongS(i);
}