assert_equal(6, 0x6)
assert_equal(15, 0xf)
assert_equal(255, 0xff)
+
+ const INFTY = 1.0 / 0.0
+ def Test()
+ assert_equal(1, isinf(INFTY))
+ assert_equal(-1, isinf(-INFTY))
+ enddef
+ Test()
END
v9.CheckDefAndScriptSuccess(lines)
enddef
--p;
if (*p == '-' || *p == '+')
{
- int negate = *p == '-';
- isn_T *isn;
- type_T *type;
-
- type = get_type_on_stack(cctx, 0);
- if (type != &t_float && need_type(type, &t_number,
+ type_T *type = get_type_on_stack(cctx, 0);
+ if (type->tt_type != VAR_FLOAT && need_type(type, &t_number,
-1, 0, cctx, FALSE, FALSE) == FAIL)
return FAIL;
// only '-' has an effect, for '+' we only check the type
- if (negate)
- {
- isn = generate_instr(cctx, ISN_NEGATENR);
- if (isn == NULL)
- return FAIL;
- }
+ if (*p == '-' && generate_instr(cctx, ISN_NEGATENR) == NULL)
+ return FAIL;
}
else if (numeric_only)
{