From 2705c0cd4952d4c317ea1a0d610bb95fcc1826a5 Mon Sep 17 00:00:00 2001 From: otya128 Date: Sat, 3 Sep 2016 18:33:45 +0900 Subject: [PATCH] =?UTF-8?q?ACOS=E3=81=A8ASIN=E3=81=AB=E7=AF=84=E5=9B=B2?= =?UTF-8?q?=E3=83=81=E3=82=A7=E3=83=83=E3=82=AF=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SMILEBASIC/builtinfunctions.d | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/SMILEBASIC/builtinfunctions.d b/SMILEBASIC/builtinfunctions.d index 1663b19..777b696 100644 --- a/SMILEBASIC/builtinfunctions.d +++ b/SMILEBASIC/builtinfunctions.d @@ -141,9 +141,16 @@ class BuiltinFunction { return sin(arg1); } - static pure nothrow double ASIN(double arg1) + static double ASIN(double arg1) { - return asin(arg1); + if (arg1 >= -1 && arg1 <= 1) + { + return asin(arg1); + } + else + { + throw new OutOfRange(); + } } static pure nothrow double SINH(double arg1) { @@ -153,9 +160,16 @@ class BuiltinFunction { return cos(arg1); } - static pure nothrow double ACOS(double arg1) + static double ACOS(double arg1) { - return acos(arg1); + if (arg1 >= -1 && arg1 <= 1) + { + return acos(arg1); + } + else + { + throw new OutOfRange(); + } } static pure nothrow double COSH(double arg1) {