patch 9.1.1684: min()/max() does not handle float data types
Problem: min()/max() does not handle float data types
(ubaldot)
Solution: Extend min() and max() to every comparable type
(LemonBoy)
Re-use the logic used for plain old comparison operators, this way we
gain support for float values and unify the logic handling the
comparisons.
fixes: #18052
closes: 18055
Signed-off-by: LemonBoy <thatlemon@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
committed by
Christian Brabandt
parent
b922b30cfe
commit
3b3b936125
@ -1,4 +1,4 @@
|
||||
*builtin.txt* For Vim version 9.1. Last change: 2025 Aug 23
|
||||
*builtin.txt* For Vim version 9.1. Last change: 2025 Aug 24
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@ -7626,7 +7626,7 @@ max({expr}) *max()*
|
||||
Can also be used as a |method|: >
|
||||
mylist->max()
|
||||
<
|
||||
Return type: |Number|
|
||||
Return type: any, depending on {expr}
|
||||
|
||||
|
||||
menu_info({name} [, {mode}]) *menu_info()*
|
||||
@ -7718,7 +7718,7 @@ min({expr}) *min()*
|
||||
Can also be used as a |method|: >
|
||||
mylist->min()
|
||||
<
|
||||
Return type: |Number|
|
||||
Return type: any, depending on {expr}
|
||||
|
||||
|
||||
mkdir({name} [, {flags} [, {prot}]]) *mkdir()* *E739*
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
*version9.txt* For Vim version 9.1. Last change: 2025 Aug 23
|
||||
*version9.txt* For Vim version 9.1. Last change: 2025 Aug 24
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@ -41752,6 +41752,7 @@ Others: ~
|
||||
feature, see |socketserver-clientserver|.
|
||||
- |CmdlineLeave| sets |v:char| to the character that caused exiting the
|
||||
Command-line.
|
||||
- |min()|/|max()| can handle all comparable data types.
|
||||
|
||||
Platform specific ~
|
||||
- MS-Winodws: Paths like "\Windows" and "/Windows" are now considered to be
|
||||
|
||||
Reference in New Issue
Block a user