diff options
author | Bram Moolenaar <Bram@vim.org> | 2019-04-04 13:44:37 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2019-04-04 13:44:37 +0200 |
commit | fda1bff39f89775b20a2d88ef3903656d52f66ad (patch) | |
tree | 3676cb1f5c70fb693ee24e10da893ef01babe911 /runtime | |
parent | e5e4e22c1c15c8c22b14935affe969569acc8df9 (diff) | |
download | vim-git-fda1bff39f89775b20a2d88ef3903656d52f66ad.tar.gz |
patch 8.1.1111: it is not easy to check for infinityv8.1.1111
Problem: It is not easy to check for infinity.
Solution: Add isinf(). (Ozaki Kiichi, closes #3787)
Diffstat (limited to 'runtime')
-rw-r--r-- | runtime/doc/eval.txt | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt index a36794616..c764f9aa0 100644 --- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -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. |