1
0

FLOOR,ROUND,CEILをより忠実な挙動にした

This commit is contained in:
otya128
2016-09-03 19:03:56 +09:00
parent ce6b5d18da
commit 25894bd009

View File

@@ -804,17 +804,32 @@ class BuiltinFunction
else else
return 0; return 0;
} }
static nothrow double FLOOR(double val) static Value FLOOR(Value val)
{ {
return val.floor; if (val.isInteger)
{
return val;
}
return Value(val.doubleValue.floor);
} }
static nothrow double ROUND(double val) static Value ROUND(Value val)
{ {
return val.round; if (val.isInteger)
{
return val;
}
return Value(val.doubleValue.round);
} }
static nothrow double CEIL(double val) static Value CEIL(Value val)
{ {
return val.ceil; if (val.isInteger)
{
return val;
}
return Value(val.doubleValue.ceil);
} }
static wstring MID(wstring str, int i, int len) static wstring MID(wstring str, int i, int len)
{ {