Mercurial > vim
diff runtime/doc/eval.txt @ 16213:2c33b119ba92 v8.1.1111
patch 8.1.1111: it is not easy to check for infinity
commit https://github.com/vim/vim/commit/fda1bff39f89775b20a2d88ef3903656d52f66ad
Author: Bram Moolenaar <Bram@vim.org>
Date: Thu Apr 4 13:44:37 2019 +0200
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 https://github.com/vim/vim/issues/3787)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Thu, 04 Apr 2019 13:45:04 +0200 |
parents | a23c883685cb |
children | bd49e1656c72 |
line wrap: on
line diff
--- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -2411,6 +2411,8 @@ inputsecret({prompt} [, {text}]) String 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.