From: Valentin Bartenev Date: Wed, 16 Nov 2016 09:49:53 +0000 (+0300) Subject: Removed checking for range errors in Math.hypot(). X-Git-Tag: 0.1.6~23 X-Git-Url: http://www.kaiwu.me/postgresql/commit/?a=commitdiff_plain;h=78f5e83ded8b47eca01a7a692542704a43a6dcb9;p=njs.git Removed checking for range errors in Math.hypot(). It seems other interpreters do not return an exception in this case. --- diff --git a/njs/njs_math.c b/njs/njs_math.c index 66fc6a0f..2281e276 100644 --- a/njs/njs_math.c +++ b/njs/njs_math.c @@ -19,7 +19,6 @@ #include #include #include -#include static njs_ret_t @@ -216,14 +215,7 @@ njs_object_math_hypot(njs_vm_t *vm, njs_value_t *args, nxt_uint_t nargs, for (i = 2; i < nargs; i++) { num = hypot(num, args[i].data.u.number); - if (num == HUGE_VAL) { - /* HUGE_VAL is equal to INFINITY on IEEE-754 systems. */ - - if (nxt_slow_path(errno == ERANGE)) { - vm->exception = &njs_exception_range_error; - return NXT_ERROR; - } - + if (num == INFINITY) { break; } }