1
0
forked from aniani/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 #3787)
This commit is contained in:
Bram Moolenaar
2019-04-04 13:44:37 +02:00
parent e5e4e22c1c
commit fda1bff39f
4 changed files with 45 additions and 9 deletions

View File

@@ -2411,6 +2411,8 @@ inputsecret({prompt} [, {text}]) String like input() but hiding the text
insert({object}, {item} [, {idx}]) List insert {item} in {object} [before {idx}]
invert({expr}) Number bitwise invert
isdirectory({directory}) Number |TRUE| if {directory} is a directory
isinf({expr}) Number determine if {expr} is infinity value
(positive or negative)
islocked({expr}) Number |TRUE| if {expr} is locked
isnan({expr}) Number |TRUE| if {expr} is NaN
items({dict}) List key-value pairs in {dict}
@@ -5772,6 +5774,16 @@ isdirectory({directory}) *isdirectory()*
exist, or isn't a directory, the result is |FALSE|. {directory}
is any expression, which is used as a String.
isinf({expr}) *isinf()*
Return 1 if {expr} is a positive infinity, or -1 a negative
infinity, otherwise 0. >
:echo isinf(1.0 / 0.0)
< 1 >
:echo isinf(-1.0 / 0.0)
< -1
{only available when compiled with the |+float| feature}
islocked({expr}) *islocked()* *E786*
The result is a Number, which is |TRUE| when {expr} is the
name of a locked variable.