浏览代码

Avoids a warning when lua_Number is 'float'

Roberto Ierusalimschy 1 年之前
父节点
当前提交
8b83417de9
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      lmathlib.c

+ 1 - 1
lmathlib.c

@@ -352,7 +352,7 @@ static lua_Number I2d (Rand64 x) {
   SRand64 sx = (SRand64)(trim64(x) >> shift64_FIG);
   SRand64 sx = (SRand64)(trim64(x) >> shift64_FIG);
   lua_Number res = (lua_Number)(sx) * scaleFIG;
   lua_Number res = (lua_Number)(sx) * scaleFIG;
   if (sx < 0)
   if (sx < 0)
-    res += 1.0;  /* correct the two's complement if negative */
+    res += l_mathop(1.0);  /* correct the two's complement if negative */
   lua_assert(0 <= res && res < 1);
   lua_assert(0 <= res && res < 1);
   return res;
   return res;
 }
 }