From 78f5e83ded8b47eca01a7a692542704a43a6dcb9 Mon Sep 17 00:00:00 2001 From: Valentin Bartenev Date: Wed, 16 Nov 2016 12:49:53 +0300 Subject: [PATCH] Removed checking for range errors in Math.hypot(). It seems other interpreters do not return an exception in this case. --- njs/njs_math.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) 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; } } -- 2.47.3