Problem: using NOT with a float returns a float in legacy vim script
(kennypete)
Solution: Return a number instead of a float (Yegappan Lakshmanan)
fixes: #19282
closes: #19289
Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
}
if (rettv->v_type == VAR_FLOAT)
{
- if (vim9script)
- {
- rettv->v_type = VAR_BOOL;
- val = f == 0.0 ? VVAL_TRUE : VVAL_FALSE;
- type = VAR_BOOL;
- }
- else
- f = !f;
+ rettv->v_type = VAR_BOOL;
+ val = f == 0.0 ? VVAL_TRUE : VVAL_FALSE;
+ type = VAR_BOOL;
}
else
{
call assert_fails('let x %= 0.5', 'E734:')
call assert_fails('let x .= "f"', 'E734:')
let x = !3.14
- call assert_equal(0.0, x)
+ call assert_equal(0, x)
+ call assert_equal(1, !!1.0)
+ let x = !0.0
+ call assert_equal(1, x)
+ call assert_equal(0, !!0.0)
" integer and float operations
let x = 1
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 2123,
/**/
2122,
/**/