vim-patch:8.1.1111: it is not easy to check for infinity

Problem:    It is not easy to check for infinity.
Solution:   Add isinf(). (Ozaki Kiichi, closes vim/vim#3787)
fda1bff39f
This commit is contained in:
Jan Edmund Lazo
2019-08-24 16:48:05 -04:00
parent 01b5499eea
commit 1dc088ea7d
4 changed files with 37 additions and 7 deletions

View File

@@ -11276,7 +11276,6 @@ static void f_has(typval_T *argvars, typval_T *rettv, FunPtr fptr)
#endif
"tablineat",
"tag_binary",
"tag_old_static",
"termguicolors",
"termresponse",
"textobjects",
@@ -12029,6 +12028,15 @@ static void f_islocked(typval_T *argvars, typval_T *rettv, FunPtr fptr)
clear_lval(&lv);
}
// "isinf()" function
static void f_isinf(typval_T *argvars, typval_T *rettv, FunPtr fptr)
{
if (argvars[0].v_type == VAR_FLOAT
&& xisinf(argvars[0].vval.v_float)) {
rettv->vval.v_number = argvars[0].vval.v_float > 0.0 ? 1 : -1;
}
}
// "isnan()" function
static void f_isnan(typval_T *argvars, typval_T *rettv, FunPtr fptr)
{