1
0

ACOSとASINに範囲チェックを追加

This commit is contained in:
otya128
2016-09-03 18:33:45 +09:00
parent acad5af755
commit 2705c0cd49

View File

@@ -141,10 +141,17 @@ class BuiltinFunction
{ {
return sin(arg1); return sin(arg1);
} }
static pure nothrow double ASIN(double arg1) static double ASIN(double arg1)
{
if (arg1 >= -1 && arg1 <= 1)
{ {
return asin(arg1); return asin(arg1);
} }
else
{
throw new OutOfRange();
}
}
static pure nothrow double SINH(double arg1) static pure nothrow double SINH(double arg1)
{ {
return sinh(arg1); return sinh(arg1);
@@ -153,10 +160,17 @@ class BuiltinFunction
{ {
return cos(arg1); return cos(arg1);
} }
static pure nothrow double ACOS(double arg1) static double ACOS(double arg1)
{
if (arg1 >= -1 && arg1 <= 1)
{ {
return acos(arg1); return acos(arg1);
} }
else
{
throw new OutOfRange();
}
}
static pure nothrow double COSH(double arg1) static pure nothrow double COSH(double arg1)
{ {
return cosh(arg1); return cosh(arg1);