1
0

Fix ROUND, CEIL

This commit is contained in:
otya128
2016-12-20 21:55:47 +09:00
parent 4cf742902d
commit f396726f65

View File

@@ -1144,6 +1144,10 @@ class BuiltinFunction
} }
static Value FLOOR(Value val) static Value FLOOR(Value val)
{ {
if (!val.isNumber)
{
throw new TypeMismatch("FLOOR");
}
if (val.isInteger) if (val.isInteger)
{ {
return val; return val;
@@ -1153,6 +1157,10 @@ class BuiltinFunction
} }
static Value ROUND(Value val) static Value ROUND(Value val)
{ {
if (!val.isNumber)
{
throw new TypeMismatch("ROUND");
}
if (val.isInteger) if (val.isInteger)
{ {
return val; return val;
@@ -1162,6 +1170,10 @@ class BuiltinFunction
} }
static Value CEIL(Value val) static Value CEIL(Value val)
{ {
if (!val.isNumber)
{
throw new TypeMismatch("CEIL");
}
if (val.isInteger) if (val.isInteger)
{ {
return val; return val;