Lines Matching full:x
258 DUK_INTERNAL duk_double_t duk_js_tointeger_number(duk_double_t x) { in duk_js_tointeger_number() argument
259 duk_small_int_t c = (duk_small_int_t) DUK_FPCLASSIFY(x); in duk_js_tointeger_number()
267 return x; in duk_js_tointeger_number()
269 duk_small_int_t s = (duk_small_int_t) DUK_SIGNBIT(x); in duk_js_tointeger_number()
270 x = DUK_FLOOR(DUK_FABS(x)); /* truncate towards zero */ in duk_js_tointeger_number()
272 x = -x; in duk_js_tointeger_number()
274 return x; in duk_js_tointeger_number()
289 DUK_LOCAL duk_double_t duk__toint32_touint32_helper(duk_double_t x, duk_bool_t is_toint32) { in duk__toint32_touint32_helper() argument
290 duk_small_int_t c = (duk_small_int_t) DUK_FPCLASSIFY(x); in duk__toint32_touint32_helper()
298 /* x = sign(x) * floor(abs(x)), i.e. truncate towards zero, keep sign */ in duk__toint32_touint32_helper()
299 s = (duk_small_int_t) DUK_SIGNBIT(x); in duk__toint32_touint32_helper()
300 x = DUK_FLOOR(DUK_FABS(x)); in duk__toint32_touint32_helper()
302 x = -x; in duk__toint32_touint32_helper()
305 /* NOTE: fmod(x) result sign is same as sign of x, which in duk__toint32_touint32_helper()
309 x = DUK_FMOD(x, DUK_DOUBLE_2TO32); /* -> x in ]-2**32, 2**32[ */ in duk__toint32_touint32_helper()
311 if (x < 0.0) { in duk__toint32_touint32_helper()
312 x += DUK_DOUBLE_2TO32; in duk__toint32_touint32_helper()
314 /* -> x in [0, 2**32[ */ in duk__toint32_touint32_helper()
317 if (x >= DUK_DOUBLE_2TO31) { in duk__toint32_touint32_helper()
318 /* x in [2**31, 2**32[ */ in duk__toint32_touint32_helper()
320 x -= DUK_DOUBLE_2TO32; /* -> x in [-2**31,2**31[ */ in duk__toint32_touint32_helper()
324 return x; in duk__toint32_touint32_helper()
440 DUK_LOCAL duk_bool_t duk__js_equals_number(duk_double_t x, duk_double_t y) { in duk__js_equals_number() argument
443 duk_small_int_t cx = (duk_small_int_t) DUK_FPCLASSIFY(x); in duk__js_equals_number()
451 if (x == y) { in duk__js_equals_number()
462 if (x == y) { in duk__js_equals_number()
464 DUK_ASSERT(DUK_FPCLASSIFY(x) != DUK_FP_NAN); in duk__js_equals_number()
469 * of their signed, so if both x and y are zeroes, they in duk__js_equals_number()
472 DUK_ASSERT(!(DUK_FPCLASSIFY(x) == DUK_FP_ZERO && DUK_FPCLASSIFY(y) == DUK_FP_ZERO)); in duk__js_equals_number()
478 DUK_LOCAL duk_bool_t duk__js_samevalue_number(duk_double_t x, duk_double_t y) { in duk__js_samevalue_number() argument
480 duk_small_int_t cx = (duk_small_int_t) DUK_FPCLASSIFY(x); in duk__js_samevalue_number()
491 * signbit(x) == signbit(y) in duk__js_samevalue_number()
493 duk_small_int_t sx = (DUK_SIGNBIT(x) ? 1 : 0); in duk__js_samevalue_number()
499 * - both x and y are not NaNs (but one of them can be) in duk__js_samevalue_number()
500 * - both x and y are not zero (but one of them can be) in duk__js_samevalue_number()
501 * - x and y may be denormal or infinite in duk__js_samevalue_number()
504 return (x == y); in duk__js_samevalue_number()
506 duk_small_int_t cx = (duk_small_int_t) DUK_FPCLASSIFY(x); in duk__js_samevalue_number()
509 if (x == y) { in duk__js_samevalue_number()
511 DUK_ASSERT(DUK_FPCLASSIFY(x) != DUK_FP_NAN); in duk__js_samevalue_number()
519 * signbit(x) == signbit(y) in duk__js_samevalue_number()
521 duk_small_int_t sx = (DUK_SIGNBIT(x) ? 1 : 0); in duk__js_samevalue_number()
528 * of their signed, so if both x and y are zeroes, they in duk__js_samevalue_number()
531 DUK_ASSERT(!(DUK_FPCLASSIFY(x) == DUK_FP_ZERO && DUK_FPCLASSIFY(y) == DUK_FP_ZERO)); in duk__js_samevalue_number()
767 * Comparisons (x >= y, x > y, x <= y, x < y)
769 * E5 Section 11.8.5: implement 'x < y' and then use negate and eval_left_first
798 /* e.g. "x" < "xx" */ in duk_js_data_compare()
961 /* x == +Infinity */ in duk_js_compare_helper()
976 /* x == -Infinity */ in duk_js_compare_helper()