]> granicus.if.org Git - vim/commitdiff
patch 9.0.0491: no good reason to build without the float feature v9.0.0491
authorBram Moolenaar <Bram@vim.org>
Sat, 17 Sep 2022 20:08:33 +0000 (21:08 +0100)
committerBram Moolenaar <Bram@vim.org>
Sat, 17 Sep 2022 20:08:33 +0000 (21:08 +0100)
Problem:    No good reason to build without the float feature.
Solution:   Remove configure check for float and "#ifdef FEAT_FLOAT".

74 files changed:
runtime/doc/builtin.txt
runtime/doc/eval.txt
runtime/doc/mlang.txt
runtime/doc/various.txt
src/auto/configure
src/config.h.in
src/configure.ac
src/dict.c
src/errors.h
src/eval.c
src/evalfunc.c
src/ex_cmds.c
src/feature.h
src/float.c
src/gui_gtk_x11.c
src/gui_x11.c
src/if_lua.c
src/if_mzsch.c
src/if_py_both.h
src/if_ruby.c
src/json.c
src/list.c
src/locale.c
src/macros.h
src/message_test.c
src/os_mac_conv.c
src/os_vms_conf.h
src/profiler.c
src/session.c
src/strings.c
src/structs.h
src/syntax.c
src/testdir/runtest.vim
src/testdir/test_assert.vim
src/testdir/test_blob.vim
src/testdir/test_cscope.vim
src/testdir/test_eval_stuff.vim
src/testdir/test_execute_func.vim
src/testdir/test_expr.vim
src/testdir/test_float_func.vim
src/testdir/test_functions.vim
src/testdir/test_glob2regpat.vim
src/testdir/test_json.vim
src/testdir/test_listdict.vim
src/testdir/test_lua.vim
src/testdir/test_messages.vim
src/testdir/test_method.vim
src/testdir/test_perl.vim
src/testdir/test_python2.vim
src/testdir/test_python3.vim
src/testdir/test_random.vim
src/testdir/test_reltime.vim
src/testdir/test_ruby.vim
src/testdir/test_sort.vim
src/testdir/test_substitute.vim
src/testdir/test_terminal.vim
src/testdir/test_true_false.vim
src/testdir/test_user_func.vim
src/testdir/test_vim9_assign.vim
src/testdir/test_vim9_builtin.vim
src/testdir/test_vim9_disassemble.vim
src/testdir/test_vim9_expr.vim
src/testdir/test_vimscript.vim
src/testing.c
src/time.c
src/typval.c
src/version.c
src/vim9.h
src/vim9compile.c
src/vim9execute.c
src/vim9expr.c
src/vim9instr.c
src/vim9type.c
src/viminfo.c

index 53179ca85aba6bd7900204abebee75dc64111cd2..4a05fdc52828bb71d98f6eccf0648aeca7904749 100644 (file)
@@ -753,8 +753,6 @@ abs({expr})                                                 *abs()*
                Can also be used as a |method|: >
                        Compute()->abs()
 
-<              {only available when compiled with the |+float| feature}
-
 
 acos({expr})                                                   *acos()*
                Return the arc cosine of {expr} measured in radians, as a
@@ -770,8 +768,6 @@ acos({expr})                                                        *acos()*
                Can also be used as a |method|: >
                        Compute()->acos()
 
-<              {only available when compiled with the |+float| feature}
-
 
 add({object}, {expr})                                  *add()*
                Append the item {expr} to |List| or |Blob| {object}.  Returns
@@ -904,8 +900,6 @@ asin({expr})                                                *asin()*
 
                Can also be used as a |method|: >
                        Compute()->asin()
-<
-               {only available when compiled with the |+float| feature}
 
 
 assert_ functions are documented here: |assert-functions-details|
@@ -925,8 +919,6 @@ atan({expr})                                                *atan()*
 
                Can also be used as a |method|: >
                        Compute()->atan()
-<
-               {only available when compiled with the |+float| feature}
 
 
 atan2({expr1}, {expr2})                                        *atan2()*
@@ -943,8 +935,6 @@ atan2({expr1}, {expr2})                                     *atan2()*
 
                Can also be used as a |method|: >
                        Compute()->atan2(1)
-<
-               {only available when compiled with the |+float| feature}
 
 
 autocmd_add({acmds})                                   *autocmd_add()*
@@ -1428,8 +1418,6 @@ ceil({expr})                                                      *ceil()*
 
                Can also be used as a |method|: >
                        Compute()->ceil()
-<
-               {only available when compiled with the |+float| feature}
 
 
 ch_ functions are documented here: |channel-functions-details|
@@ -1801,8 +1789,6 @@ cos({expr})                                               *cos()*
 
                Can also be used as a |method|: >
                        Compute()->cos()
-<
-               {only available when compiled with the |+float| feature}
 
 
 cosh({expr})                                           *cosh()*
@@ -1818,8 +1804,6 @@ cosh({expr})                                              *cosh()*
 
                Can also be used as a |method|: >
                        Compute()->cosh()
-<
-               {only available when compiled with the |+float| feature}
 
 
 count({comp}, {expr} [, {ic} [, {start}]])                     *count()*
@@ -2405,8 +2389,6 @@ exp({expr})                                                       *exp()*
 
                Can also be used as a |method|: >
                        Compute()->exp()
-<
-               {only available when compiled with the |+float| feature}
 
 
 expand({string} [, {nosuf} [, {list}]])                                *expand()*
@@ -2807,8 +2789,6 @@ float2nr({expr})                                  *float2nr()*
 
                Can also be used as a |method|: >
                        Compute()->float2nr()
-<
-               {only available when compiled with the |+float| feature}
 
 
 floor({expr})                                                  *floor()*
@@ -2826,8 +2806,6 @@ floor({expr})                                                     *floor()*
 
                Can also be used as a |method|: >
                        Compute()->floor()
-<
-               {only available when compiled with the |+float| feature}
 
 
 fmod({expr1}, {expr2})                                 *fmod()*
@@ -2848,8 +2826,6 @@ fmod({expr1}, {expr2})                                    *fmod()*
 
                Can also be used as a |method|: >
                        Compute()->fmod(1.22)
-<
-               {only available when compiled with |+float| feature}
 
 
 fnameescape({string})                                  *fnameescape()*
@@ -5050,8 +5026,6 @@ isinf({expr})                                             *isinf()*
 
                Can also be used as a |method|: >
                        Compute()->isinf()
-<
-               {only available when compiled with the |+float| feature}
 
 islocked({expr})                                       *islocked()* *E786*
                The result is a Number, which is |TRUE| when {expr} is the
@@ -5080,8 +5054,6 @@ isnan({expr})                                             *isnan()*
 
                Can also be used as a |method|: >
                        Compute()->isnan()
-<
-               {only available when compiled with the |+float| feature}
 
 items({dict})                                          *items()*
                Return a |List| with all the key-value pairs of {dict}.  Each
@@ -5510,8 +5482,6 @@ log({expr})                                               *log()*
 
                Can also be used as a |method|: >
                        Compute()->log()
-<
-               {only available when compiled with the |+float| feature}
 
 
 log10({expr})                                          *log10()*
@@ -5526,8 +5496,6 @@ log10({expr})                                             *log10()*
 
                Can also be used as a |method|: >
                        Compute()->log10()
-<
-               {only available when compiled with the |+float| feature}
 
 luaeval({expr} [, {expr}])                                     *luaeval()*
                Evaluate Lua expression {expr} and return its result converted
@@ -5535,8 +5503,7 @@ luaeval({expr} [, {expr}])                                        *luaeval()*
                argument accessible as _A inside first {expr}.
                Strings are returned as they are.
                Boolean objects are converted to numbers.
-               Numbers are converted to |Float| values if vim was compiled
-               with |+float| and to numbers otherwise.
+               Numbers are converted to |Float| values.
                Dictionaries and lists obtained by vim.eval() are returned
                as-is.
                Other objects are returned as zero without any errors.
@@ -6483,8 +6450,6 @@ pow({x}, {y})                                             *pow()*
 
                Can also be used as a |method|: >
                        Compute()->pow(3)
-<
-               {only available when compiled with the |+float| feature}
 
 prevnonblank({lnum})                                   *prevnonblank()*
                Return the line number of the first line at or above {lnum}
@@ -7366,8 +7331,6 @@ round({expr})                                                     *round()*
 
                Can also be used as a |method|: >
                        Compute()->round()
-<
-               {only available when compiled with the |+float| feature}
 
 rubyeval({expr})                                       *rubyeval()*
                Evaluate Ruby expression {expr} and return its result
@@ -8536,8 +8499,6 @@ sin({expr})                                               *sin()*
 
                Can also be used as a |method|: >
                        Compute()->sin()
-<
-               {only available when compiled with the |+float| feature}
 
 
 sinh({expr})                                           *sinh()*
@@ -8553,8 +8514,6 @@ sinh({expr})                                              *sinh()*
 
                Can also be used as a |method|: >
                        Compute()->sinh()
-<
-               {only available when compiled with the |+float| feature}
 
 
 slice({expr}, {start} [, {end}])                       *slice()*
@@ -8821,8 +8780,6 @@ sqrt({expr})                                              *sqrt()*
 
                Can also be used as a |method|: >
                        Compute()->sqrt()
-<
-               {only available when compiled with the |+float| feature}
 
 
 srand([{expr}])                                                *srand()*
@@ -8896,8 +8853,6 @@ str2float({string} [, {quoted}])                          *str2float()*
 
                Can also be used as a |method|: >
                        let f = text->substitute(',', '', 'g')->str2float()
-<
-               {only available when compiled with the |+float| feature}
 
 str2list({string} [, {utf8}])                                  *str2list()*
                Return a list containing the number values which represent
@@ -9643,8 +9598,6 @@ tan({expr})                                               *tan()*
 
                Can also be used as a |method|: >
                        Compute()->tan()
-<
-               {only available when compiled with the |+float| feature}
 
 
 tanh({expr})                                           *tanh()*
@@ -9660,8 +9613,6 @@ tanh({expr})                                              *tanh()*
 
                Can also be used as a |method|: >
                        Compute()->tanh()
-<
-               {only available when compiled with the |+float| feature}
 
 
 tempname()                                     *tempname()* *temp-file-name*
@@ -9897,8 +9848,6 @@ trunc({expr})                                                     *trunc()*
                Can also be used as a |method|: >
                        Compute()->trunc()
 <
-               {only available when compiled with the |+float| feature}
-
                                                        *type()*
 type({expr})   The result is a Number representing the type of {expr}.
                Instead of using the number directly, it is better to use the
index e99e9baa0a821e4846fdaae2ca5e025ea4b1c12a..145d3bd76beca91b7fcf074ff7842d517123d03e 100644 (file)
@@ -54,7 +54,6 @@ Number                A 32 or 64 bit signed number.  |expr-number|
                Examples:  -123  0x10  0177  0o177 0b1011
 
 Float          A floating point number. |floating-point-format| *Float*
-               {only when compiled with the |+float| feature} *E1076*
                Examples: 123.456  1.15e-6  -1.1e3
 
 String         A NUL terminated string of 8-bit unsigned characters (bytes).
@@ -1441,7 +1440,6 @@ digits are ignored.
 {exp} is the exponent, power of 10.
 Only a decimal point is accepted, not a comma.  No matter what the current
 locale is.
-{only when compiled with the |+float| feature}
 
 Examples:
        123.456
index edab4d43cee1f77ace6993f2bcc91e52c7e4c2fc..724ec46a856e99af42afc6646f88400537d150c3 100644 (file)
@@ -82,9 +82,9 @@ use of "-" and "_".
                        characters. This sets $LC_COLLATE.
                        Without an argument all are set, and additionally
                        $LANG is set.
-                       When compiled with the |+float| feature the LC_NUMERIC
-                       value will always be set to "C", so that floating
-                       point numbers use '.' as the decimal point.
+                       If available the LC_NUMERIC value will always be set
+                       to "C", so that floating point numbers use '.' as the
+                       decimal point.
                        This will make a difference for items that depend on
                        the language (some messages, time and date format).
                        Not fully supported on all systems
index ac8b4afcd02e0650c7f5056de2725f562bb23137..6e4afec5b37d844a2ea9519f2684e59acc03a528 100644 (file)
@@ -381,7 +381,7 @@ N  *+find_in_path*  include file searches: |[I|, |:isearch|,
 N  *+folding*          |folding|
    *+footer*           |gui-footer|
    *+fork*             Unix only: |fork| shell commands
-   *+float*            Floating point support
+T  *+float*            Floating point support  Always enabled since 9.0.0491
 N  *+gettext*          message translations |multi-lang|
 -  *+GUI_Athena*       Unix only: Athena |GUI|
    *+GUI_neXtaw*       Unix only: neXtaw |GUI|
index 18836113be254677ed4b2a1f86c01aefc06ae8e4..8c770c8012b5484f7c103836768715f5ee05d6cd 100755 (executable)
@@ -13379,48 +13379,6 @@ _ACEOF
 
 fi
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for strtod() and other floating point functions" >&5
-$as_echo_n "checking for strtod() and other floating point functions... " >&6; }
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-#ifdef HAVE_MATH_H
-# include <math.h>
-#endif
-#if STDC_HEADERS
-# include <stdlib.h>
-# include <stddef.h>
-#endif
-
-int
-main ()
-{
-char *s; double d;
-    d = strtod("1.1", &s);
-    d = fabs(1.11);
-    d = ceil(1.11);
-    d = floor(1.11);
-    d = log10(1.11);
-    d = pow(1.11, 2.22);
-    d = sqrt(1.11);
-    d = sin(1.11);
-    d = cos(1.11);
-    d = atan(1.11);
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }; $as_echo "#define HAVE_FLOAT_FUNCS 1" >>confdefs.h
-
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for isinf()" >&5
 $as_echo_n "checking for isinf()... " >&6; }
index 5f0d6aef2ac6edd3b6e665bfea74f42e24402666..875d9afd54a6761690b7a7c54c620a0c2c1a36cf 100644 (file)
 #undef HAVE_FCHDIR
 #undef HAVE_FCHOWN
 #undef HAVE_FCHMOD
-#undef HAVE_FLOAT_FUNCS
 #undef HAVE_FSEEKO
 #undef HAVE_FSYNC
 #undef HAVE_FTRUNCATE
index 76eb56327cbf7ee519041fb586cc786094905b4f..b688032d0031fafa9a8e6421ee192a7ed4012523 100644 (file)
@@ -3952,32 +3952,8 @@ AC_LINK_IFELSE([AC_LANG_PROGRAM([
        AC_MSG_RESULT(yes); AC_DEFINE(HAVE_NL_LANGINFO_CODESET),
        AC_MSG_RESULT(no))
 
-dnl Need various functions for floating point support.  Only enable
-dnl floating point when they are all present.
+dnl Floating point support may require the "m" library
 AC_CHECK_LIB(m, strtod)
-AC_MSG_CHECKING([for strtod() and other floating point functions])
-AC_LINK_IFELSE([AC_LANG_PROGRAM([
-#ifdef HAVE_MATH_H
-# include <math.h>
-#endif
-#if STDC_HEADERS
-# include <stdlib.h>
-# include <stddef.h>
-#endif
-], [char *s; double d;
-    d = strtod("1.1", &s);
-    d = fabs(1.11);
-    d = ceil(1.11);
-    d = floor(1.11);
-    d = log10(1.11);
-    d = pow(1.11, 2.22);
-    d = sqrt(1.11);
-    d = sin(1.11);
-    d = cos(1.11);
-    d = atan(1.11);
-    ])],
-       AC_MSG_RESULT(yes); AC_DEFINE(HAVE_FLOAT_FUNCS),
-       AC_MSG_RESULT(no))
 
 dnl isinf() and isnan() need to include header files and may need -lm.
 AC_MSG_CHECKING([for isinf()])
index fa54c60c417aedd5844441ecce204a91406a8a94..1cb3e89a8dceb77f1bbde715b1fa0a0aba5c95b7 100644 (file)
@@ -984,13 +984,11 @@ eval_dict(char_u **arg, typval_T *rettv, evalarg_T *evalarg, int literal)
        }
        if (evaluate)
        {
-#ifdef FEAT_FLOAT
            if (tvkey.v_type == VAR_FLOAT)
            {
                tvkey.vval.v_string = typval_tostring(&tvkey, TRUE);
                tvkey.v_type = VAR_STRING;
            }
-#endif
            key = tv_get_string_buf_chk(&tvkey, buf);
            if (key == NULL)
            {
index 944dc43c5d09df48cc3338706f074db3c0d73e93..e2938765284052dd38c0c42b6486af54f0309028 100644 (file)
@@ -895,7 +895,7 @@ EXTERN char e_cannot_execute_shell_with_f_option[]
        INIT(= N_("E360: Cannot execute shell with -f option"));
 #endif
 // E361 unused
-#if defined(FEAT_EVAL) && defined(FEAT_FLOAT)
+#if defined(FEAT_EVAL)
 EXTERN char e_using_boolean_value_as_float[]
        INIT(= N_("E362: Using a boolean value as a Float"));
 #endif
@@ -2044,17 +2044,13 @@ EXTERN char e_cannot_use_percent_with_float[]
        // xgettext:no-c-format
        INIT(= N_("E804: Cannot use '%' with Float"));
 #endif
-#ifdef FEAT_FLOAT
 EXTERN char e_using_float_as_number[]
        INIT(= N_("E805: Using a Float as a Number"));
 EXTERN char e_using_float_as_string[]
        INIT(= N_("E806: Using a Float as a String"));
-#endif
-#ifdef FEAT_FLOAT
 EXTERN char e_expected_float_argument_for_printf[]
        INIT(= N_("E807: Expected Float argument for printf()"));
-#endif
-#if defined(FEAT_EVAL) && defined(FEAT_FLOAT)
+#if defined(FEAT_EVAL)
 EXTERN char e_number_or_float_required[]
        INIT(= N_("E808: Number or Float required"));
 #endif
@@ -2290,7 +2286,6 @@ EXTERN char e_number_required[]
 EXTERN char e_trailing_char_after_rsb_str_str[]
        INIT(= N_("E890: Trailing char after ']': %s]%s"));
 #endif
-#ifdef FEAT_FLOAT
 EXTERN char e_using_funcref_as_float[]
        INIT(= N_("E891: Using a Funcref as a Float"));
 EXTERN char e_using_string_as_float[]
@@ -2299,7 +2294,6 @@ EXTERN char e_using_list_as_float[]
        INIT(= N_("E893: Using a List as a Float"));
 EXTERN char e_using_dictionary_as_float[]
        INIT(= N_("E894: Using a Dictionary as a Float"));
-#endif
 #ifdef FEAT_MZSCHEME
 EXTERN char e_sorry_this_command_is_disabled_the_mzscheme_racket_base_module_could_not_be_loaded[]
        INIT(= N_("E895: Sorry, this command is disabled, the MzScheme's racket/base module could not be loaded."));
@@ -2340,10 +2334,8 @@ EXTERN char e_received_unknown_command_str[]
 EXTERN char e_not_an_open_channel[]
        INIT(= N_("E906: Not an open channel"));
 #endif
-#ifdef FEAT_FLOAT
 EXTERN char e_using_special_value_as_float[]
        INIT(= N_("E907: Using a special value as a Float"));
-#endif
 #ifdef FEAT_EVAL
 EXTERN char e_using_invalid_value_as_string_str[]
        INIT(= N_("E908: Using an invalid value as a String: %s"));
@@ -2537,10 +2529,8 @@ EXTERN char e_blob_literal_should_have_an_even_number_of_hex_characters[]
        INIT(= N_("E973: Blob literal should have an even number of hex characters"));
 EXTERN char e_using_blob_as_number[]
        INIT(= N_("E974: Using a Blob as a Number"));
-# ifdef FEAT_FLOAT
 EXTERN char e_using_blob_as_float[]
        INIT(= N_("E975: Using a Blob as a Float"));
-# endif
 EXTERN char e_using_blob_as_string[]
        INIT(= N_("E976: Using a Blob as a String"));
 EXTERN char e_can_only_compare_blob_with_blob[]
@@ -2775,10 +2765,7 @@ EXTERN char e_no_white_space_allowed_after_dot[]
        INIT(= N_("E1074: No white space allowed after dot"));
 EXTERN char e_namespace_not_supported_str[]
        INIT(= N_("E1075: Namespace not supported: %s"));
-# ifndef FEAT_FLOAT
-EXTERN char e_this_vim_is_not_compiled_with_float_support[]
-       INIT(= N_("E1076: This Vim is not compiled with float support"));
-# endif
+// E1076 was deleted
 EXTERN char e_missing_argument_type_for_str[]
        INIT(= N_("E1077: Missing argument type for %s"));
 #endif
index 3209d08dcca3f262d6dc8627a05e9c9c3f1152a7..948faa2ee5d7a4bc941b0d8a1d6ca1b869106d5c 100644 (file)
@@ -525,9 +525,7 @@ typval2string(typval_T *tv, int convert)
 {
     garray_T   ga;
     char_u     *retval;
-#ifdef FEAT_FLOAT
     char_u     numbuf[NUMBUFLEN];
-#endif
 
     if (convert && tv->v_type == VAR_LIST)
     {
@@ -541,13 +539,11 @@ typval2string(typval_T *tv, int convert)
        ga_append(&ga, NUL);
        retval = (char_u *)ga.ga_data;
     }
-#ifdef FEAT_FLOAT
     else if (convert && tv->v_type == VAR_FLOAT)
     {
        vim_snprintf((char *)numbuf, NUMBUFLEN, "%g", tv->vval.v_float);
        retval = vim_strsave(numbuf);
     }
-#endif
     else
        retval = vim_strsave(tv_get_string(tv));
     return retval;
@@ -1683,7 +1679,6 @@ tv_op(typval_T *tv1, typval_T *tv2, char_u *op)
                {
                    // nr += nr , nr -= nr , nr *=nr , nr /= nr , nr %= nr
                    n = tv_get_number(tv1);
-#ifdef FEAT_FLOAT
                    if (tv2->v_type == VAR_FLOAT)
                    {
                        float_T f = n;
@@ -1702,7 +1697,6 @@ tv_op(typval_T *tv1, typval_T *tv2, char_u *op)
                        tv1->vval.v_float = f;
                    }
                    else
-#endif
                    {
                        switch (*op)
                        {
@@ -1734,7 +1728,6 @@ tv_op(typval_T *tv1, typval_T *tv2, char_u *op)
                return failed ? FAIL : OK;
 
            case VAR_FLOAT:
-#ifdef FEAT_FLOAT
                {
                    float_T f;
 
@@ -1755,7 +1748,6 @@ tv_op(typval_T *tv1, typval_T *tv2, char_u *op)
                        case '/': tv1->vval.v_float /= f; break;
                    }
                }
-#endif
                return OK;
        }
     }
@@ -3238,9 +3230,7 @@ eval6(char_u **arg, typval_T *rettv, evalarg_T *evalarg)
        }
        if ((op != '+' || (rettv->v_type != VAR_LIST
                                                 && rettv->v_type != VAR_BLOB))
-#ifdef FEAT_FLOAT
                && (op == '.' || rettv->v_type != VAR_FLOAT)
-#endif
                && evaluate)
        {
            int         error = FALSE;
@@ -3293,14 +3283,12 @@ eval6(char_u **arg, typval_T *rettv, evalarg_T *evalarg)
                        || var2.v_type == VAR_JOB))
                    semsg(_(e_using_invalid_value_as_string_str),
                                                   vartype_name(var2.v_type));
-#ifdef FEAT_FLOAT
                else if (vim9script && var2.v_type == VAR_FLOAT)
                {
                    vim_snprintf((char *)buf2, NUMBUFLEN, "%g",
                                                            var2.vval.v_float);
                    s2 = buf2;
                }
-#endif
                else
                    s2 = tv_get_string_buf_chk(&var2, buf2);
                if (s2 == NULL)         // type error ?
@@ -3327,8 +3315,7 @@ eval6(char_u **arg, typval_T *rettv, evalarg_T *evalarg)
            {
                int             error = FALSE;
                varnumber_T     n1, n2;
-#ifdef FEAT_FLOAT
-               float_T     f1 = 0, f2 = 0;
+               float_T         f1 = 0, f2 = 0;
 
                if (rettv->v_type == VAR_FLOAT)
                {
@@ -3336,7 +3323,6 @@ eval6(char_u **arg, typval_T *rettv, evalarg_T *evalarg)
                    n1 = 0;
                }
                else
-#endif
                {
                    n1 = tv_get_number_chk(rettv, &error);
                    if (error)
@@ -3349,19 +3335,15 @@ eval6(char_u **arg, typval_T *rettv, evalarg_T *evalarg)
                        clear_tv(&var2);
                        return FAIL;
                    }
-#ifdef FEAT_FLOAT
                    if (var2.v_type == VAR_FLOAT)
                        f1 = n1;
-#endif
                }
-#ifdef FEAT_FLOAT
                if (var2.v_type == VAR_FLOAT)
                {
                    f2 = var2.vval.v_float;
                    n2 = 0;
                }
                else
-#endif
                {
                    n2 = tv_get_number_chk(&var2, &error);
                    if (error)
@@ -3370,14 +3352,11 @@ eval6(char_u **arg, typval_T *rettv, evalarg_T *evalarg)
                        clear_tv(&var2);
                        return FAIL;
                    }
-#ifdef FEAT_FLOAT
                    if (rettv->v_type == VAR_FLOAT)
                        f2 = n2;
-#endif
                }
                clear_tv(rettv);
 
-#ifdef FEAT_FLOAT
                // If there is a float on either side the result is a float.
                if (rettv->v_type == VAR_FLOAT || var2.v_type == VAR_FLOAT)
                {
@@ -3389,7 +3368,6 @@ eval6(char_u **arg, typval_T *rettv, evalarg_T *evalarg)
                    rettv->vval.v_float = f1;
                }
                else
-#endif
                {
                    if (op == '+')
                        n1 = n1 + n2;
@@ -3423,9 +3401,7 @@ eval7(
     evalarg_T  *evalarg,
     int                want_string)  // after "." operator
 {
-#ifdef FEAT_FLOAT
     int            use_float = FALSE;
-#endif
 
     /*
      * Get the first expression.
@@ -3444,9 +3420,7 @@ eval7(
        char_u      *p;
        int         op;
        varnumber_T n1, n2;
-#ifdef FEAT_FLOAT
        float_T     f1, f2;
-#endif
        int         error;
 
        // "*=", "/=" and "%=" are assignments
@@ -3469,14 +3443,11 @@ eval7(
            *arg = p;
        }
 
-#ifdef FEAT_FLOAT
        f1 = 0;
        f2 = 0;
-#endif
        error = FALSE;
        if (evaluate)
        {
-#ifdef FEAT_FLOAT
            if (rettv->v_type == VAR_FLOAT)
            {
                f1 = rettv->vval.v_float;
@@ -3484,7 +3455,6 @@ eval7(
                n1 = 0;
            }
            else
-#endif
                n1 = tv_get_number_chk(rettv, &error);
            clear_tv(rettv);
            if (error)
@@ -3508,7 +3478,6 @@ eval7(
 
        if (evaluate)
        {
-#ifdef FEAT_FLOAT
            if (var2.v_type == VAR_FLOAT)
            {
                if (!use_float)
@@ -3520,30 +3489,26 @@ eval7(
                n2 = 0;
            }
            else
-#endif
            {
                n2 = tv_get_number_chk(&var2, &error);
                clear_tv(&var2);
                if (error)
                    return FAIL;
-#ifdef FEAT_FLOAT
                if (use_float)
                    f2 = n2;
-#endif
            }
 
            /*
             * Compute the result.
             * When either side is a float the result is a float.
             */
-#ifdef FEAT_FLOAT
            if (use_float)
            {
                if (op == '*')
                    f1 = f1 * f2;
                else if (op == '/')
                {
-# ifdef VMS
+#ifdef VMS
                    // VMS crashes on divide by zero, work around it
                    if (f2 == 0.0)
                    {
@@ -3556,11 +3521,11 @@ eval7(
                    }
                    else
                        f1 = f1 / f2;
-# else
+#else
                    // We rely on the floating point library to handle divide
                    // by zero to result in "inf" and not a crash.
                    f1 = f1 / f2;
-# endif
+#endif
                }
                else
                {
@@ -3571,7 +3536,6 @@ eval7(
                rettv->vval.v_float = f1;
            }
            else
-#endif
            {
                int         failed = FALSE;
 
@@ -3858,11 +3822,7 @@ eval9(
        return FAIL;
     end_leader = *arg;
 
-    if (**arg == '.' && (!isdigit(*(*arg + 1))
-#ifdef FEAT_FLOAT
-           || in_old_script(2)
-#endif
-           ))
+    if (**arg == '.' && (!isdigit(*(*arg + 1)) || in_old_script(2)))
     {
        semsg(_(e_invalid_expression_str), *arg);
        ++*arg;
@@ -4129,13 +4089,11 @@ eval9_leader(
     varnumber_T val = 0;
     vartype_T  type = rettv->v_type;
     int                vim9script = in_vim9script();
-#ifdef FEAT_FLOAT
     float_T        f = 0.0;
 
     if (rettv->v_type == VAR_FLOAT)
        f = rettv->vval.v_float;
     else
-#endif
     {
        while (VIM_ISWHITE(end_leader[-1]))
            --end_leader;
@@ -4161,7 +4119,6 @@ eval9_leader(
                    ++end_leader;
                    break;
                }
-#ifdef FEAT_FLOAT
                if (rettv->v_type == VAR_FLOAT)
                {
                    if (vim9script)
@@ -4173,7 +4130,6 @@ eval9_leader(
                        f = !f;
                }
                else
-#endif
                {
                    val = !val;
                    type = VAR_BOOL;
@@ -4181,25 +4137,21 @@ eval9_leader(
            }
            else if (*end_leader == '-')
            {
-#ifdef FEAT_FLOAT
                if (rettv->v_type == VAR_FLOAT)
                    f = -f;
                else
-#endif
                {
                    val = -val;
                    type = VAR_NUMBER;
                }
            }
        }
-#ifdef FEAT_FLOAT
        if (rettv->v_type == VAR_FLOAT)
        {
            clear_tv(rettv);
            rettv->vval.v_float = f;
        }
        else
-#endif
        {
            clear_tv(rettv);
            if (vim9script)
@@ -4500,7 +4452,6 @@ eval_index(
        {
            int error = FALSE;
 
-#ifdef FEAT_FLOAT
            // allow for indexing with float
            if (vim9script && rettv->v_type == VAR_DICT
                                                   && var1.v_type == VAR_FLOAT)
@@ -4508,7 +4459,7 @@ eval_index(
                var1.vval.v_string = typval_tostring(&var1, TRUE);
                var1.v_type = VAR_STRING;
            }
-#endif
+
            if (vim9script && rettv->v_type == VAR_LIST)
                tv_get_number_chk(&var1, &error);
            else
@@ -4599,11 +4550,9 @@ check_can_index(typval_T *rettv, int evaluate, int verbose)
                emsg(_(e_cannot_index_a_funcref));
            return FAIL;
        case VAR_FLOAT:
-#ifdef FEAT_FLOAT
            if (verbose)
                emsg(_(e_using_float_as_string));
            return FAIL;
-#endif
        case VAR_BOOL:
        case VAR_SPECIAL:
        case VAR_JOB:
@@ -5696,12 +5645,10 @@ echo_string_core(
            break;
 
        case VAR_FLOAT:
-#ifdef FEAT_FLOAT
            *tofree = NULL;
            vim_snprintf((char *)numbuf, NUMBUFLEN, "%g", tv->vval.v_float);
            r = numbuf;
            break;
-#endif
 
        case VAR_BOOL:
        case VAR_SPECIAL:
index cab3213469954a58c4a937709e35e7b12d92b69a..f808d1970647183a91d733204d9698ca4163b612 100644 (file)
@@ -1512,12 +1512,7 @@ typedef struct
 #define FEARG_3    3       // base is the third argument
 #define FEARG_4    4       // base is the fourth argument
 
-#ifdef FEAT_FLOAT
-# define FLOAT_FUNC(name) name
-#else
-# define FLOAT_FUNC(name) NULL
-#endif
-#if defined(FEAT_FLOAT) && defined(HAVE_MATH_H)
+#if defined(HAVE_MATH_H)
 # define MATH_FUNC(name) name
 #else
 # define MATH_FUNC(name) NULL
@@ -1556,9 +1551,9 @@ typedef struct
 static funcentry_T global_functions[] =
 {
     {"abs",            1, 1, FEARG_1,      arg1_float_or_nr,
-                       ret_any,            FLOAT_FUNC(f_abs)},
+                       ret_any,            f_abs},
     {"acos",           1, 1, FEARG_1,      arg1_float_or_nr,
-                       ret_float,          FLOAT_FUNC(f_acos)},
+                       ret_float,          f_acos},
     {"add",            2, 2, FEARG_1,      arg2_listblob_item,
                        ret_first_arg,      f_add},
     {"and",            2, 2, FEARG_1,      arg2_number,
@@ -1576,7 +1571,7 @@ static funcentry_T global_functions[] =
     {"argv",           0, 2, 0,            arg2_number,
                        ret_argv,           f_argv},
     {"asin",           1, 1, FEARG_1,      arg1_float_or_nr,
-                       ret_float,          FLOAT_FUNC(f_asin)},
+                       ret_float,          f_asin},
     {"assert_beeps",   1, 1, FEARG_1,      arg1_string,
                        ret_number_bool,    f_assert_beeps},
     {"assert_equal",   2, 3, FEARG_2,      NULL,
@@ -1604,9 +1599,9 @@ static funcentry_T global_functions[] =
     {"assert_true",    1, 2, FEARG_1,      NULL,
                        ret_number_bool,    f_assert_true},
     {"atan",           1, 1, FEARG_1,      arg1_float_or_nr,
-                       ret_float,          FLOAT_FUNC(f_atan)},
+                       ret_float,          f_atan},
     {"atan2",          2, 2, FEARG_1,      arg2_float_or_nr,
-                       ret_float,          FLOAT_FUNC(f_atan2)},
+                       ret_float,          f_atan2},
     {"autocmd_add",    1, 1, FEARG_1,      arg1_list_any,
                        ret_number_bool,    f_autocmd_add},
     {"autocmd_delete", 1, 1, FEARG_1,      arg1_list_any,
@@ -1676,7 +1671,7 @@ static funcentry_T global_functions[] =
     {"call",           2, 3, FEARG_1,      arg3_any_list_dict,
                        ret_any,            f_call},
     {"ceil",           1, 1, FEARG_1,      arg1_float_or_nr,
-                       ret_float,          FLOAT_FUNC(f_ceil)},
+                       ret_float,          f_ceil},
     {"ch_canread",     1, 1, FEARG_1,      arg1_chan_or_job,
                        ret_number_bool,    JOB_FUNC(f_ch_canread)},
     {"ch_close",       1, 1, FEARG_1,      arg1_chan_or_job,
@@ -1744,9 +1739,9 @@ static funcentry_T global_functions[] =
     {"copy",           1, 1, FEARG_1,      NULL,
                        ret_copy,           f_copy},
     {"cos",            1, 1, FEARG_1,      arg1_float_or_nr,
-                       ret_float,          FLOAT_FUNC(f_cos)},
+                       ret_float,          f_cos},
     {"cosh",           1, 1, FEARG_1,      arg1_float_or_nr,
-                       ret_float,          FLOAT_FUNC(f_cosh)},
+                       ret_float,          f_cosh},
     {"count",          2, 4, FEARG_1,      arg24_count,
                        ret_number,         f_count},
     {"cscope_connection",0,3, 0,           arg3_number_string_string,
@@ -1804,7 +1799,7 @@ static funcentry_T global_functions[] =
     {"exists_compiled",        1, 1, FEARG_1,      arg1_string,
                        ret_number_bool,    f_exists_compiled},
     {"exp",            1, 1, FEARG_1,      arg1_float_or_nr,
-                       ret_float,          FLOAT_FUNC(f_exp)},
+                       ret_float,          f_exp},
     {"expand",         1, 3, FEARG_1,      arg3_string_bool_bool,
                        ret_any,            f_expand},
     {"expandcmd",      1, 2, FEARG_1,      arg2_string_dict,
@@ -1832,11 +1827,11 @@ static funcentry_T global_functions[] =
     {"flattennew",     1, 2, FEARG_1,      arg2_list_any_number,
                        ret_list_any,       f_flattennew},
     {"float2nr",       1, 1, FEARG_1,      arg1_float_or_nr,
-                       ret_number,         FLOAT_FUNC(f_float2nr)},
+                       ret_number,         f_float2nr},
     {"floor",          1, 1, FEARG_1,      arg1_float_or_nr,
-                       ret_float,          FLOAT_FUNC(f_floor)},
+                       ret_float,          f_floor},
     {"fmod",           2, 2, FEARG_1,      arg2_float_or_nr,
-                       ret_float,          FLOAT_FUNC(f_fmod)},
+                       ret_float,          f_fmod},
     {"fnameescape",    1, 1, FEARG_1,      arg1_string,
                        ret_string,         f_fnameescape},
     {"fnamemodify",    2, 2, FEARG_1,      arg2_string,
@@ -2088,9 +2083,9 @@ static funcentry_T global_functions[] =
     {"localtime",      0, 0, 0,            NULL,
                        ret_number,         f_localtime},
     {"log",            1, 1, FEARG_1,      arg1_float_or_nr,
-                       ret_float,          FLOAT_FUNC(f_log)},
+                       ret_float,          f_log},
     {"log10",          1, 1, FEARG_1,      arg1_float_or_nr,
-                       ret_float,          FLOAT_FUNC(f_log10)},
+                       ret_float,          f_log10},
     {"luaeval",                1, 2, FEARG_1,      arg2_string_any,
                        ret_any,
 #ifdef FEAT_LUA
@@ -2216,7 +2211,7 @@ static funcentry_T global_functions[] =
     {"popup_show",     1, 1, FEARG_1,      arg1_number,
                        ret_void,           PROP_FUNC(f_popup_show)},
     {"pow",            2, 2, FEARG_1,      arg2_float_or_nr,
-                       ret_float,          FLOAT_FUNC(f_pow)},
+                       ret_float,          f_pow},
     {"prevnonblank",   1, 1, FEARG_1,      arg1_lnum,
                        ret_number,         f_prevnonblank},
     {"printf",         1, 19, FEARG_2,     arg119_printf,
@@ -2300,7 +2295,7 @@ static funcentry_T global_functions[] =
     {"reltime",                0, 2, FEARG_1,      arg2_list_number,
                        ret_list_any,       f_reltime},
     {"reltimefloat",   1, 1, FEARG_1,      arg1_list_number,
-                       ret_float,          FLOAT_FUNC(f_reltimefloat)},
+                       ret_float,          f_reltimefloat},
     {"reltimestr",     1, 1, FEARG_1,      arg1_list_number,
                        ret_string,         f_reltimestr},
     {"remote_expr",    2, 4, FEARG_1,      arg24_remote_expr,
@@ -2326,7 +2321,7 @@ static funcentry_T global_functions[] =
     {"reverse",                1, 1, FEARG_1,      arg1_list_or_blob,
                        ret_first_arg,      f_reverse},
     {"round",          1, 1, FEARG_1,      arg1_float_or_nr,
-                       ret_float,          FLOAT_FUNC(f_round)},
+                       ret_float,          f_round},
     {"rubyeval",       1, 1, FEARG_1,      arg1_string,
                        ret_any,
 #ifdef FEAT_RUBY
@@ -2438,9 +2433,9 @@ static funcentry_T global_functions[] =
     {"simplify",       1, 1, FEARG_1,      arg1_string,
                        ret_string,         f_simplify},
     {"sin",            1, 1, FEARG_1,      arg1_float_or_nr,
-                       ret_float,          FLOAT_FUNC(f_sin)},
+                       ret_float,          f_sin},
     {"sinh",           1, 1, FEARG_1,      arg1_float_or_nr,
-                       ret_float,          FLOAT_FUNC(f_sinh)},
+                       ret_float,          f_sinh},
     {"slice",          2, 3, FEARG_1,      arg23_slice,
                        ret_slice,          f_slice},
     {"sort",           1, 3, FEARG_1,      arg13_sortuniq,
@@ -2462,13 +2457,13 @@ static funcentry_T global_functions[] =
     {"split",          1, 3, FEARG_1,      arg3_string_string_bool,
                        ret_list_string,    f_split},
     {"sqrt",           1, 1, FEARG_1,      arg1_float_or_nr,
-                       ret_float,          FLOAT_FUNC(f_sqrt)},
+                       ret_float,          f_sqrt},
     {"srand",          0, 1, FEARG_1,      arg1_number,
                        ret_list_number,    f_srand},
     {"state",          0, 1, FEARG_1,      arg1_string,
                        ret_string,         f_state},
     {"str2float",      1, 2, FEARG_1,      arg2_string_bool,
-                       ret_float,          FLOAT_FUNC(f_str2float)},
+                       ret_float,          f_str2float},
     {"str2list",       1, 2, FEARG_1,      arg2_string_bool,
                        ret_list_number,    f_str2list},
     {"str2nr",         1, 3, FEARG_1,      arg3_string_number_bool,
@@ -2546,9 +2541,9 @@ static funcentry_T global_functions[] =
     {"taglist",                1, 2, FEARG_1,      arg2_string,
                        ret_list_dict_any,  f_taglist},
     {"tan",            1, 1, FEARG_1,      arg1_float_or_nr,
-                       ret_float,          FLOAT_FUNC(f_tan)},
+                       ret_float,          f_tan},
     {"tanh",           1, 1, FEARG_1,      arg1_float_or_nr,
-                       ret_float,          FLOAT_FUNC(f_tanh)},
+                       ret_float,          f_tanh},
     {"tempname",       0, 0, 0,            NULL,
                        ret_string,         f_tempname},
     {"term_dumpdiff",  2, 3, FEARG_1,      arg3_string_string_dict,
@@ -2680,7 +2675,7 @@ static funcentry_T global_functions[] =
     {"trim",           1, 3, FEARG_1,      arg3_string_string_number,
                        ret_string,         f_trim},
     {"trunc",          1, 1, FEARG_1,      arg1_float_or_nr,
-                       ret_float,          FLOAT_FUNC(f_trunc)},
+                       ret_float,          f_trunc},
     {"type",           1, 1, FEARG_1,      NULL,
                        ret_number,         f_type},
     {"typename",       1, 1, FEARG_1,      NULL,
@@ -3670,10 +3665,8 @@ f_empty(typval_T *argvars, typval_T *rettv)
            n = argvars[0].vval.v_number == 0;
            break;
        case VAR_FLOAT:
-#ifdef FEAT_FLOAT
            n = argvars[0].vval.v_float == 0.0;
            break;
-#endif
        case VAR_LIST:
            n = argvars[0].vval.v_list == NULL
                                        || argvars[0].vval.v_list->lv_len == 0;
@@ -5644,13 +5637,7 @@ f_has(typval_T *argvars, typval_T *rettv)
                0
 #endif
                },
-       {"float",
-#ifdef FEAT_FLOAT
-               1
-#else
-               0
-#endif
-               },
+       {"float", 1},
        {"folding",
 #ifdef FEAT_FOLDING
                1
index ebcd441c81073df67f8899abeb6e81cf097b4a0e..9fdbe955e0f95b73c0c2f3865e7ec5b63875d180 100644 (file)
@@ -14,9 +14,7 @@
 #include "vim.h"
 #include "version.h"
 
-#ifdef FEAT_FLOAT
-# include <float.h>
-#endif
+#include <float.h>
 
 static int linelen(int *has_tab);
 static void do_filter(linenr_T line1, linenr_T line2, exarg_T *eap, char_u *cmd, int do_in, int do_out);
@@ -275,9 +273,7 @@ static int  sort_lc;        // sort using locale
 static int     sort_ic;        // ignore case
 static int     sort_nr;        // sort on number
 static int     sort_rx;        // sort on regex instead of skipping it
-#ifdef FEAT_FLOAT
 static int     sort_flt;       // sort on floating number
-#endif
 
 static int     sort_abort;     // flag to indicate if sorting has been interrupted
 
@@ -296,9 +292,7 @@ typedef struct
            varnumber_T value;          // value if sorting by integer
            int is_number;              // TRUE when line contains a number
        } num;
-#ifdef FEAT_FLOAT
        float_T value_flt;              // value if sorting by float
-#endif
     } st_u;
 } sorti_T;
 
@@ -334,11 +328,9 @@ sort_compare(const void *s1, const void *s2)
            result = l1.st_u.num.value == l2.st_u.num.value ? 0
                             : l1.st_u.num.value > l2.st_u.num.value ? 1 : -1;
     }
-#ifdef FEAT_FLOAT
     else if (sort_flt)
        result = l1.st_u.value_flt == l2.st_u.value_flt ? 0
                             : l1.st_u.value_flt > l2.st_u.value_flt ? 1 : -1;
-#endif
     else
     {
        // We need to copy one line into "sortbuf1", because there is no
@@ -399,9 +391,7 @@ ex_sort(exarg_T *eap)
        goto sortend;
 
     sort_abort = sort_ic = sort_lc = sort_rx = sort_nr = 0;
-#ifdef FEAT_FLOAT
     sort_flt = 0;
-#endif
 
     for (p = eap->arg; *p != NUL; ++p)
     {
@@ -418,13 +408,11 @@ ex_sort(exarg_T *eap)
            sort_nr = 1;
            ++format_found;
        }
-#ifdef FEAT_FLOAT
        else if (*p == 'f')
        {
            sort_flt = 1;
            ++format_found;
        }
-#endif
        else if (*p == 'b')
        {
            sort_what = STR2NR_BIN + STR2NR_FORCE;
@@ -521,11 +509,7 @@ ex_sort(exarg_T *eap)
            if (regmatch.regprog != NULL)
                end_col = 0;
 
-       if (sort_nr
-#ifdef FEAT_FLOAT
-               || sort_flt
-#endif
-               )
+       if (sort_nr || sort_flt)
        {
            // Make sure vim_str2nr doesn't read any digits past the end
            // of the match, by temporarily terminating the string there
@@ -558,7 +542,6 @@ ex_sort(exarg_T *eap)
                        NULL, 0, FALSE);
                }
            }
-#ifdef FEAT_FLOAT
            else
            {
                s = skipwhite(p);
@@ -572,7 +555,6 @@ ex_sort(exarg_T *eap)
                    nrs[lnum - eap->line1].st_u.value_flt =
                                                      strtod((char *)s, NULL);
            }
-#endif
            *s2 = c;
        }
        else
index 26296d337e2e0b0986f38ffb164dafaf172acf8f..5eacd5e953dbd7ab554553283c67341e2add099a 100644 (file)
  * +wildignore         'wildignore' and 'backupskip' options
  * +wildmenu           'wildmenu' option
  * +builtin_terms      all builtin termcap entries included
+ * +float              Floating point variables.
  *
  * Obsolete:
  * +tag_old_static     Old style static tags: "file:tag  file  ..".
 /*
  * +eval               Built-in script language and expression evaluation,
  *                     ":let", ":if", etc.
- * +float              Floating point variables.
  */
 #ifdef FEAT_NORMAL
 # define FEAT_EVAL
-# if defined(HAVE_FLOAT_FUNCS) || defined(MSWIN) || defined(MACOS_X)
-#  define FEAT_FLOAT
-# endif
 #endif
 
 #ifdef FEAT_EVAL
index aa7d697c6fd12d1118b47a8f0a6004fbec5205c9..04bb8a121ee5530c77b67a05a94742468054e73f 100644 (file)
@@ -14,7 +14,7 @@
 
 #include "vim.h"
 
-#if (defined(FEAT_EVAL) && defined(FEAT_FLOAT)) || defined(PROTO)
+#if defined(FEAT_EVAL) || defined(PROTO)
 
 #ifdef VMS
 # include <float.h>
index 21a6ed1090f4130b4bc16441993a3a73a2fe3713..3cdf22260ab988e490115a47d923cb042e291170 100644 (file)
@@ -3598,7 +3598,7 @@ gui_mch_init(void)
     {
        gnome_program_init(VIMPACKAGE, VIM_VERSION_SHORT,
                           LIBGNOMEUI_MODULE, gui_argc, gui_argv, NULL);
-# if defined(FEAT_FLOAT) && defined(LC_NUMERIC)
+# if defined(LC_NUMERIC)
        {
            char *p = setlocale(LC_NUMERIC, NULL);
 
index 7293ac4900a6cac96bb7baaa7a703db398002025..fa81875437156ead17b9dc831a22356e0d4cd9f3 100644 (file)
@@ -1184,7 +1184,7 @@ gui_mch_init_check(void)
                cmdline_options, XtNumber(cmdline_options),
                CARDINAL &gui_argc, gui_argv);
 
-# if defined(FEAT_FLOAT) && defined(LC_NUMERIC)
+# if defined(LC_NUMERIC)
     {
        // The call to XtOpenDisplay() may have set the locale from the
        // environment. Set LC_NUMERIC to "C" to make sure that strtod() uses a
index 4463ac069351cb1bedefb521fe1f39eae388c812..4900534b4c695a78853c56cba1e547439afae93b 100644 (file)
@@ -559,11 +559,9 @@ luaV_pushtypval(lua_State *L, typval_T *tv)
        case VAR_NUMBER:
            lua_pushinteger(L, (int) tv->vval.v_number);
            break;
-#ifdef FEAT_FLOAT
        case VAR_FLOAT:
            lua_pushnumber(L, (lua_Number) tv->vval.v_float);
            break;
-#endif
        case VAR_LIST:
            luaV_pushlist(L, tv->vval.v_list);
            break;
@@ -619,7 +617,6 @@ luaV_totypval(lua_State *L, int pos, typval_T *tv)
            tv->vval.v_string = vim_strsave((char_u *) lua_tostring(L, pos));
            break;
        case LUA_TNUMBER:
-#ifdef FEAT_FLOAT
        {
            const lua_Number n = lua_tonumber(L, pos);
 
@@ -635,10 +632,6 @@ luaV_totypval(lua_State *L, int pos, typval_T *tv)
                tv->vval.v_number = (varnumber_T)n;
            }
        }
-#else
-           tv->v_type = VAR_NUMBER;
-           tv->vval.v_number = (varnumber_T) lua_tointeger(L, pos);
-#endif
            break;
        case LUA_TFUNCTION:
        {
index 0c100fe26ae1e128399113169e82f4adfc9194bd..8788fb3034b902905ee0cd6a9d1e73975c2bd1c1 100644 (file)
@@ -3009,13 +3009,11 @@ vim_to_mzscheme_impl(typval_T *vim_value, int depth, Scheme_Hash_Table *visited)
        result = scheme_make_integer((long)vim_value->vval.v_number);
        MZ_GC_CHECK();
     }
-# ifdef FEAT_FLOAT
     else if (vim_value->v_type == VAR_FLOAT)
     {
        result = scheme_make_double((double)vim_value->vval.v_float);
        MZ_GC_CHECK();
     }
-# endif
     else if (vim_value->v_type == VAR_LIST)
     {
        list_T          *list = vim_value->vval.v_list;
@@ -3208,13 +3206,11 @@ mzscheme_to_vim_impl(Scheme_Object *obj, typval_T *tv, int depth,
        tv->v_type = VAR_BOOL;
        tv->vval.v_number = SCHEME_TRUEP(obj);
     }
-# ifdef FEAT_FLOAT
     else if (SCHEME_DBLP(obj))
     {
        tv->v_type = VAR_FLOAT;
        tv->vval.v_float = SCHEME_DBL_VAL(obj);
     }
-# endif
     else if (SCHEME_BYTE_STRINGP(obj))
     {
        tv->v_type = VAR_STRING;
index b7276c53dbfc90193e40baafd706b816d6ab89dc..2857cc705aaf57281dce0e648286b855c1adce36 100644 (file)
@@ -761,7 +761,6 @@ VimToPython(typval_T *our_tv, int depth, PyObject *lookup_dict)
        sprintf(buf, "%ld", (long)our_tv->vval.v_number);
        ret = PyString_FromString((char *)buf);
     }
-#ifdef FEAT_FLOAT
     else if (our_tv->v_type == VAR_FLOAT)
     {
        char buf[NUMBUFLEN];
@@ -769,7 +768,6 @@ VimToPython(typval_T *our_tv, int depth, PyObject *lookup_dict)
        sprintf(buf, "%f", our_tv->vval.v_float);
        ret = PyString_FromString((char *)buf);
     }
-#endif
     else if (our_tv->v_type == VAR_LIST)
     {
        list_T          *list = our_tv->vval.v_list;
@@ -6329,13 +6327,11 @@ _ConvertFromPyObject(PyObject *obj, typval_T *tv, PyObject *lookup_dict)
     }
     else if (PyDict_Check(obj))
        return convert_dl(obj, tv, pydict_to_tv, lookup_dict);
-#ifdef FEAT_FLOAT
     else if (PyFloat_Check(obj))
     {
        tv->v_type = VAR_FLOAT;
        tv->vval.v_float = (float_T) PyFloat_AsDouble(obj);
     }
-#endif
     else if (PyObject_HasAttrString(obj, "keys"))
        return convert_dl(obj, tv, pymap_to_tv, lookup_dict);
     // PyObject_GetIter can create built-in iterator for any sequence object
@@ -6388,9 +6384,7 @@ ConvertToPyObject(typval_T *tv)
        case VAR_NUMBER:
            return PyLong_FromLong((long) tv->vval.v_number);
        case VAR_FLOAT:
-#ifdef FEAT_FLOAT
            return PyFloat_FromDouble((double) tv->vval.v_float);
-#endif
        case VAR_LIST:
            return NEW_LIST(tv->vval.v_list);
        case VAR_DICT:
index 3a92fa8cf95ae02251fb73719d25c346c5f13cd6..7632cbf05496a8df8449579413d22f4512504b96 100644 (file)
@@ -1221,12 +1221,10 @@ vim_to_ruby(typval_T *tv)
     {
        result = INT2NUM(tv->vval.v_number);
     }
-# ifdef FEAT_FLOAT
     else if (tv->v_type == VAR_FLOAT)
     {
        result = rb_float_new(tv->vval.v_float);
     }
-# endif
     else if (tv->v_type == VAR_LIST)
     {
        list_T      *list = tv->vval.v_list;
@@ -1932,12 +1930,10 @@ ruby_convert_to_vim_value(VALUE val, typval_T *rettv)
            rettv->v_type = VAR_NUMBER;
            rettv->vval.v_number = (varnumber_T)NUM2LONG(val);
            break;
-#ifdef FEAT_FLOAT
        case T_FLOAT:
            rettv->v_type = VAR_FLOAT;
            rettv->vval.v_float = (float_T)NUM2DBL(val);
            break;
-#endif
        default:
            val = rb_obj_as_string(val);
            // FALLTHROUGH
index 47bf9904a312a589938a358e382d0c24b4a7a231..80120acb303235c223095d7ec2eaea5256e19668 100644 (file)
@@ -409,8 +409,7 @@ json_encode_item(garray_T *gap, typval_T *val, int copyID, int options)
            break;
 
        case VAR_FLOAT:
-#ifdef FEAT_FLOAT
-# if defined(HAVE_MATH_H)
+#if defined(HAVE_MATH_H)
            if (isnan(val->vval.v_float))
                ga_concat(gap, (char_u *)"NaN");
            else if (isinf(val->vval.v_float))
@@ -421,14 +420,13 @@ json_encode_item(garray_T *gap, typval_T *val, int copyID, int options)
                    ga_concat(gap, (char_u *)"Infinity");
            }
            else
-# endif
+#endif
            {
                vim_snprintf((char *)numbuf, NUMBUFLEN, "%g",
                                                           val->vval.v_float);
                ga_concat(gap, numbuf);
            }
            break;
-#endif
        case VAR_UNKNOWN:
        case VAR_ANY:
        case VAR_VOID:
@@ -861,7 +859,6 @@ json_decode_item(js_read_T *reader, typval_T *res, int options)
                            }
                        }
                        sp = skipdigits(sp);
-#ifdef FEAT_FLOAT
                        if (*sp == '.' || *sp == 'e' || *sp == 'E')
                        {
                            if (cur_item == NULL)
@@ -878,7 +875,6 @@ json_decode_item(js_read_T *reader, typval_T *res, int options)
                            }
                        }
                        else
-#endif
                        {
                            varnumber_T nr;
 
@@ -934,7 +930,6 @@ json_decode_item(js_read_T *reader, typval_T *res, int options)
                        retval = OK;
                        break;
                    }
-#ifdef FEAT_FLOAT
                    if (STRNICMP((char *)p, "NaN", 3) == 0)
                    {
                        reader->js_used += 3;
@@ -968,19 +963,19 @@ json_decode_item(js_read_T *reader, typval_T *res, int options)
                        retval = OK;
                        break;
                    }
-#endif
                    // check for truncated name
                    len = (int)(reader->js_end
                                         - (reader->js_buf + reader->js_used));
                    if (
                            (len < 5 && STRNICMP((char *)p, "false", len) == 0)
-#ifdef FEAT_FLOAT
-                           || (len < 9 && STRNICMP((char *)p, "-Infinity", len) == 0)
-                           || (len < 8 && STRNICMP((char *)p, "Infinity", len) == 0)
+                           || (len < 9
+                                && STRNICMP((char *)p, "-Infinity", len) == 0)
+                           || (len < 8
+                                 && STRNICMP((char *)p, "Infinity", len) == 0)
                            || (len < 3 && STRNICMP((char *)p, "NaN", len) == 0)
-#endif
-                           || (len < 4 && (STRNICMP((char *)p, "true", len) == 0
-                                      ||  STRNICMP((char *)p, "null", len) == 0)))
+                           || (len < 4
+                                 && (STRNICMP((char *)p, "true", len) == 0
+                                   || STRNICMP((char *)p, "null", len) == 0)))
 
                        retval = MAYBE;
                    else
@@ -998,7 +993,6 @@ json_decode_item(js_read_T *reader, typval_T *res, int options)
            if (top_item != NULL && top_item->jd_type == JSON_OBJECT_KEY
                    && cur_item != NULL)
            {
-#ifdef FEAT_FLOAT
                if (cur_item->v_type == VAR_FLOAT)
                {
                    // cannot use a float as a key
@@ -1006,7 +1000,6 @@ json_decode_item(js_read_T *reader, typval_T *res, int options)
                    retval = FAIL;
                    goto theend;
                }
-#endif
                top_item->jd_key = tv_get_string_buf_chk(cur_item, key_buf);
                if (top_item->jd_key == NULL)
                {
index c9697e0514339555bab0c76570fb5b48a807d26e..a0af50953c8f3ede6be8d58fb31d5adebcc56cb4 100644 (file)
@@ -1876,9 +1876,7 @@ typedef struct
     int                item_compare_lc;
     int                item_compare_numeric;
     int                item_compare_numbers;
-#ifdef FEAT_FLOAT
     int                item_compare_float;
-#endif
     char_u     *item_compare_func;
     partial_T  *item_compare_partial;
     dict_T     *item_compare_selfdict;
@@ -1915,7 +1913,6 @@ item_compare(const void *s1, const void *s2)
        return v1 == v2 ? 0 : v1 > v2 ? 1 : -1;
     }
 
-#ifdef FEAT_FLOAT
     if (sortinfo->item_compare_float)
     {
        float_T v1 = tv_get_float(tv1);
@@ -1923,7 +1920,6 @@ item_compare(const void *s1, const void *s2)
 
        return v1 == v2 ? 0 : v1 > v2 ? 1 : -1;
     }
-#endif
 
     // tv2string() puts quotes around a string and allocates memory.  Don't do
     // that for string variables. Use a single quote when comparing with a
@@ -2160,9 +2156,7 @@ parse_sort_uniq_args(typval_T *argvars, sortinfo_T *info)
     info->item_compare_lc = FALSE;
     info->item_compare_numeric = FALSE;
     info->item_compare_numbers = FALSE;
-#ifdef FEAT_FLOAT
     info->item_compare_float = FALSE;
-#endif
     info->item_compare_func = NULL;
     info->item_compare_partial = NULL;
     info->item_compare_selfdict = NULL;
@@ -2215,13 +2209,11 @@ parse_sort_uniq_args(typval_T *argvars, sortinfo_T *info)
                info->item_compare_func = NULL;
                info->item_compare_numbers = TRUE;
            }
-#ifdef FEAT_FLOAT
            else if (STRCMP(info->item_compare_func, "f") == 0)
            {
                info->item_compare_func = NULL;
                info->item_compare_float = TRUE;
            }
-#endif
            else if (STRCMP(info->item_compare_func, "i") == 0)
            {
                info->item_compare_func = NULL;
index 1c72c43e4ae8201f6d384b54e63b8a70dba8cbc7..d0378ffb501a08fbccaae36a236d227ae572bb0a 100644 (file)
@@ -225,7 +225,7 @@ init_locale(void)
     // Tell Gtk not to change our locale settings.
     gtk_disable_setlocale();
 # endif
-# if defined(FEAT_FLOAT) && defined(LC_NUMERIC)
+# if defined(LC_NUMERIC)
     // Make sure strtod() uses a decimal point, not a comma.
     setlocale(LC_NUMERIC, "C");
 # endif
@@ -333,7 +333,7 @@ ex_language(exarg_T *eap)
 # endif
        {
            loc = setlocale(what, (char *)name);
-# if defined(FEAT_FLOAT) && defined(LC_NUMERIC)
+# if defined(LC_NUMERIC)
            // Make sure strtod() uses a decimal point, not a comma.
            setlocale(LC_NUMERIC, "C");
 # endif
index aa61d900fff76da746289ba8ccc120cc8a4a5be4..16aab2e6e1c60e82c4ea53c3db6a83110df5a909 100644 (file)
 # define MESSAGE_QUEUE
 #endif
 
-#if defined(FEAT_EVAL) && defined(FEAT_FLOAT)
+#if defined(FEAT_EVAL)
 # include <float.h>
 # if defined(HAVE_MATH_H)
    // for isnan() and isinf()
index 940c1cc0b0fd9e3f2c1a152e35ca4edbd6dd729c..6f71aff9204b106ea6024394882e30e184c51188 100644 (file)
@@ -211,7 +211,6 @@ test_vim_snprintf(void)
        assert(bsize == 0 || STRNCMP(buf, "001100", bsize_int) == 0);
        assert(bsize == 0 || buf[MIN(n, bsize_int)] == '\0');
 
-#ifdef FEAT_FLOAT
        n = vim_snprintf(buf, bsize, "%f", 1.234);
        assert(n == 8);
        assert(bsize == 0 || STRNCMP(buf, "1.234000", bsize_int) == 0);
@@ -241,7 +240,6 @@ test_vim_snprintf(void)
        assert(n == 9);
        assert(bsize == 0 || STRNCMP(buf, "-0.000000", bsize_int) == 0);
        assert(bsize == 0 || buf[MIN(n, bsize_int)] == '\0');
-#endif
 
        n = vim_snprintf(buf, bsize, "%s", "漢語");
        assert(n == 6);
index 211b235313f325beabbc615ad8447643faac64cd..a699ce0d9313e53b38be051f1dc2887ef418e47b 100644 (file)
@@ -585,7 +585,7 @@ mac_lang_init(void)
 #   ifdef HAVE_LOCALE_H
            setlocale(LC_ALL, "");
 #   endif
-#   if defined(FEAT_FLOAT) && defined(LC_NUMERIC)
+#   if defined(LC_NUMERIC)
            // Make sure strtod() uses a decimal point, not a comma.
            setlocale(LC_NUMERIC, "C");
 #   endif
index 8a933b69721124f8a3f5f13ba25b270884526181..7de117c704327dfe88c02efacee915f094820603 100644 (file)
 #define HAVE_SETENV
 #define HAVE_SETJMP_H
 #define HAVE_MATH_H
-#define HAVE_FLOAT_FUNCS
 #define HAVE_GETTIMEOFDAY
 #define HAVE_PWD_H
 #define HAVE_NETDB_H
index 9c9fa9dbc22e1b5eee89f51a9c6af0091901e61e..03348dff33b5a75dfc4c7e19d9c8f9eccdef9dd0 100644 (file)
@@ -90,23 +90,21 @@ profile_msg(proftime_T *tm)
     return buf;
 }
 
-# if defined(FEAT_FLOAT) || defined(PROTO)
 /*
  * Return a float that represents the time in "tm".
  */
     float_T
 profile_float(proftime_T *tm)
 {
-#  ifdef MSWIN
+# ifdef MSWIN
     LARGE_INTEGER   fr;
 
     QueryPerformanceFrequency(&fr);
     return (float_T)tm->QuadPart / (float_T)fr.QuadPart;
-#  else
+# else
     return (float_T)tm->tv_sec + (float_T)tm->tv_usec / 1000000.0;
-#  endif
-}
 # endif
+}
 
 /*
  * Put the time "msec" past now in "tm".
@@ -173,7 +171,7 @@ profile_zero(proftime_T *tm)
 
 # endif  // FEAT_PROFILE || FEAT_RELTIME
 
-#if defined(FEAT_SYN_HL) && defined(FEAT_RELTIME) && defined(FEAT_FLOAT) && defined(FEAT_PROFILE)
+#if defined(FEAT_SYN_HL) && defined(FEAT_RELTIME) && defined(FEAT_PROFILE)
 # if defined(HAVE_MATH_H)
 #  include <math.h>
 # endif
index ddf5d21d117ab8b5c848a8db5bd94882fa4c8a2b..b65f5ae77097f5cd26b6a1df3dc6a84f71b42b9a 100644 (file)
@@ -577,7 +577,6 @@ store_session_globals(FILE *fd)
                }
                vim_free(p);
            }
-#ifdef FEAT_FLOAT
            else if (this_var->di_tv.v_type == VAR_FLOAT
                    && var_flavour(this_var->di_key) == VAR_FLAVOUR_SESSION)
            {
@@ -594,7 +593,6 @@ store_session_globals(FILE *fd)
                        || put_eol(fd) == FAIL)
                    return FAIL;
            }
-#endif
        }
     }
     return OK;
index 55ee69ab11dca79460d36a1336cf0868eb08ba0a..3befb86eae08795e52748ba0dcd7d6d4dfe12278 100644 (file)
@@ -1895,7 +1895,6 @@ tv_str(typval_T *tvs, int *idxp, char_u **tofree)
     return s;
 }
 
-# ifdef FEAT_FLOAT
 /*
  * Get float argument from "idxp" entry in "tvs".  First entry is 1.
  */
@@ -1919,11 +1918,9 @@ tv_float(typval_T *tvs, int *idxp)
     }
     return f;
 }
-# endif
 
 #endif
 
-#ifdef FEAT_FLOAT
 /*
  * Return the representation of infinity for printf() function:
  * "-inf", "inf", "+inf", " inf", "-INF", "INF", "+INF" or " INF".
@@ -1945,7 +1942,6 @@ infinity_str(int positive,
        idx += 4;
     return table[idx];
 }
-#endif
 
 /*
  * This code was included to provide a portable vsnprintf() and snprintf().
@@ -2079,13 +2075,9 @@ vim_vsnprintf_typval(
            char    length_modifier = '\0';
 
            // temporary buffer for simple numeric->string conversion
-# if defined(FEAT_FLOAT)
-#  define TMP_LEN 350  // On my system 1e308 is the biggest number possible.
+# define TMP_LEN 350   // On my system 1e308 is the biggest number possible.
                        // That sounds reasonable to use as the maximum
                        // printable.
-# else
-#  define TMP_LEN 66
-# endif
            char    tmp[TMP_LEN];
 
            // string address in case of string argument
@@ -2637,7 +2629,6 @@ vim_vsnprintf_typval(
                    break;
                }
 
-# ifdef FEAT_FLOAT
            case 'f':
            case 'F':
            case 'e':
@@ -2653,9 +2644,9 @@ vim_vsnprintf_typval(
                    int         remove_trailing_zeroes = FALSE;
 
                    f =
-#  if defined(FEAT_EVAL)
+# if defined(FEAT_EVAL)
                        tvs != NULL ? tv_float(tvs, &arg_idx) :
-#  endif
+# endif
                            va_arg(ap, double);
                    abs_f = f < 0 ? -f : f;
 
@@ -2672,11 +2663,11 @@ vim_vsnprintf_typval(
                    }
 
                    if ((fmt_spec == 'f' || fmt_spec == 'F') &&
-#  ifdef VAX
+# ifdef VAX
                            abs_f > 1.0e38
-#  else
+# else
                            abs_f > 1.0e307
-#  endif
+# endif
                            )
                    {
                        // Avoid a buffer overflow
@@ -2801,7 +2792,6 @@ vim_vsnprintf_typval(
                    str_arg = tmp;
                    break;
                }
-# endif
 
            default:
                // unrecognized conversion specifier, keep format string
index f7901ebe8869b28f0dd3f65e6460f61864da58e9..c532dde443f40c86a66dc98b2aeb4a577878654b 100644 (file)
@@ -1460,9 +1460,7 @@ typedef struct
     union
     {
        varnumber_T     v_number;       // number value
-#ifdef FEAT_FLOAT
        float_T         v_float;        // floating number value
-#endif
        char_u          *v_string;      // string value (can be NULL!)
        list_T          *v_list;        // list value (can be NULL!)
        dict_T          *v_dict;        // dict value (can be NULL!)
index c68e001be916e723ed5ad0fe4ae172b83f7e5132..ea8d541de075d3ca98d2d131ecea6213bf9b0f19 100644 (file)
@@ -6694,7 +6694,7 @@ syntime_report(void)
 {
     int                idx;
     synpat_T   *spp;
-# if defined(FEAT_RELTIME) && defined(FEAT_FLOAT)
+# if defined(FEAT_RELTIME)
     proftime_T tm;
 # endif
     int                len;
@@ -6724,7 +6724,7 @@ syntime_report(void)
            p->match = spp->sp_time.match;
            total_count += spp->sp_time.count;
            p->slowest = spp->sp_time.slowest;
-# if defined(FEAT_RELTIME) && defined(FEAT_FLOAT)
+# if defined(FEAT_RELTIME)
            profile_divide(&spp->sp_time.total, spp->sp_time.count, &tm);
            p->average = tm;
 # endif
@@ -6758,10 +6758,8 @@ syntime_report(void)
        msg_puts(profile_msg(&p->slowest));
        msg_puts(" ");
        msg_advance(38);
-# ifdef FEAT_FLOAT
        msg_puts(profile_msg(&p->average));
        msg_puts(" ");
-# endif
        msg_advance(50);
        msg_outtrans(highlight_group_name(p->id - 1));
        msg_puts(" ");
index 68c3dd3eff8520c3250e5981027b9d3827db4e13..1946282f8a67c88a2568a5db2418f96cb46584b2 100644 (file)
@@ -283,11 +283,11 @@ func RunTheTest(test)
   if has('reltime')
     let message ..= repeat(' ', 50 - len(message))
     let time = reltime(func_start)
-    if has('float') && reltimefloat(time) > 0.1
+    if reltimefloat(time) > 0.1
       let message = s:t_bold .. message
     endif
     let message ..= ' in ' .. reltimestr(time) .. ' seconds'
-    if has('float') && reltimefloat(time) > 0.1
+    if reltimefloat(time) > 0.1
       let message ..= s:t_normal
     endif
   endif
index 5d4abaa8a981af8789b4bc80e10b477dbf4a6188..b666c011e340f849c34a7bda06ffc73987c3d923 100644 (file)
@@ -352,21 +352,19 @@ func Test_assert_inrange()
 
   call assert_fails('call assert_inrange(1, 1)', 'E119:')
 
-  if has('float')
-    call assert_equal(0, assert_inrange(7.0, 7, 7))
-    call assert_equal(0, assert_inrange(7, 7.0, 7))
-    call assert_equal(0, assert_inrange(7, 7, 7.0))
-    call assert_equal(0, assert_inrange(5, 7, 5.0))
-    call assert_equal(0, assert_inrange(5, 7, 6.0))
-    call assert_equal(0, assert_inrange(5, 7, 7.0))
-
-    call assert_equal(1, assert_inrange(5, 7, 4.0))
-    call assert_match("Expected range 5.0 - 7.0, but got 4.0", v:errors[0])
-    call remove(v:errors, 0)
-    call assert_equal(1, assert_inrange(5, 7, 8.0))
-    call assert_match("Expected range 5.0 - 7.0, but got 8.0", v:errors[0])
-    call remove(v:errors, 0)
-  endif
+  call assert_equal(0, assert_inrange(7.0, 7, 7))
+  call assert_equal(0, assert_inrange(7, 7.0, 7))
+  call assert_equal(0, assert_inrange(7, 7, 7.0))
+  call assert_equal(0, assert_inrange(5, 7, 5.0))
+  call assert_equal(0, assert_inrange(5, 7, 6.0))
+  call assert_equal(0, assert_inrange(5, 7, 7.0))
+
+  call assert_equal(1, assert_inrange(5, 7, 4.0))
+  call assert_match("Expected range 5.0 - 7.0, but got 4.0", v:errors[0])
+  call remove(v:errors, 0)
+  call assert_equal(1, assert_inrange(5, 7, 8.0))
+  call assert_match("Expected range 5.0 - 7.0, but got 8.0", v:errors[0])
+  call remove(v:errors, 0)
 endfunc
 
 func Test_assert_with_msg()
index b0239fd61055c4b4c09a16fcdde4891162ff615c..ce8c3d09f7164bbc2382f02815c78bd671ca3885 100644 (file)
@@ -669,9 +669,7 @@ func Test_blob_lock()
 endfunc
 
 func Test_blob_sort()
-  if has('float')
-    call v9.CheckLegacyAndVim9Failure(['call sort([1.0, 0z11], "f")'], 'E975:')
-  endif
+  call v9.CheckLegacyAndVim9Failure(['call sort([1.0, 0z11], "f")'], 'E975:')
   call v9.CheckLegacyAndVim9Failure(['call sort([11, 0z11], "N")'], 'E974:')
 endfunc
 
index d70103ca2d57f56b9bd49eabfd0564533ae20955..d29949c4e4259ddd915e2219321beaa47788e811 100644 (file)
@@ -122,25 +122,23 @@ func Test_cscopeWithCscopeConnections()
     call assert_fails('cs find', 'E560:')
     call assert_fails('cs find x', 'E560:')
 
-    if has('float')
-      " Test: Find places where this symbol is assigned a value
-      " this needs a cscope >= 15.8
-      " unfortunately, Travis has cscope version 15.7
-      let cscope_version = systemlist('cscope --version')[0]
-      let cs_version = str2float(matchstr(cscope_version, '\d\+\(\.\d\+\)\?'))
-      if cs_version >= 15.8
-        for cmd in ['cs find a item', 'cs find 9 item']
-          let a = execute(cmd)
-          call assert_equal(['', '(1 of 4): <<test_mf_hash>> item = LALLOC_CLEAR_ONE(mf_hashitem_T);'], split(a, '\n', 1))
-          call assert_equal('  item = LALLOC_CLEAR_ONE(mf_hashitem_T);', getline('.'))
-          cnext
-          call assert_equal('  item = mf_hash_find(&ht, key);', getline('.'))
-          cnext
-          call assert_equal('      item = mf_hash_find(&ht, key);', getline('.'))
-          cnext
-          call assert_equal('  item = mf_hash_find(&ht, key);', getline('.'))
-        endfor
-      endif
+    " Test: Find places where this symbol is assigned a value
+    " this needs a cscope >= 15.8
+    " unfortunately, Travis has cscope version 15.7
+    let cscope_version = systemlist('cscope --version')[0]
+    let cs_version = str2float(matchstr(cscope_version, '\d\+\(\.\d\+\)\?'))
+    if cs_version >= 15.8
+      for cmd in ['cs find a item', 'cs find 9 item']
+        let a = execute(cmd)
+        call assert_equal(['', '(1 of 4): <<test_mf_hash>> item = LALLOC_CLEAR_ONE(mf_hashitem_T);'], split(a, '\n', 1))
+        call assert_equal('    item = LALLOC_CLEAR_ONE(mf_hashitem_T);', getline('.'))
+        cnext
+        call assert_equal('    item = mf_hash_find(&ht, key);', getline('.'))
+        cnext
+        call assert_equal('        item = mf_hash_find(&ht, key);', getline('.'))
+        cnext
+        call assert_equal('    item = mf_hash_find(&ht, key);', getline('.'))
+      endfor
     endif
 
     " Test: leading whitespace is not removed for cscope find text
index 7d8421b7250d54f0a0dcd39338a729c2faeff781..33ab45fcd4a16e6fa59e34d1df278e963abef02b 100644 (file)
@@ -240,11 +240,9 @@ func Test_string_concatenation()
   let a..=b
   call assert_equal('ab', a)
 
-  if has('float')
-    let a = 'A'
-    let b = 1.234
-    call assert_equal('A1.234', a .. b)
-  endif
+  let a = 'A'
+  let b = 1.234
+  call assert_equal('A1.234', a .. b)
 endfunc
 
 " Test fix for issue #4507
@@ -266,10 +264,8 @@ func Test_string_concat_scriptversion2()
   call assert_fails('let a .= b', 'E985:')
   call assert_fails('let vers = 1.2.3', 'E488:')
 
-  if has('float')
-    let f = .5
-    call assert_equal(0.5, f)
-  endif
+  let f = .5
+  call assert_equal(0.5, f)
 endfunc
 
 scriptversion 1
@@ -283,9 +279,7 @@ func Test_string_concat_scriptversion1()
   let vers = 1.2.3
   call assert_equal('123', vers)
 
-  if has('float')
-    call assert_fails('let f = .5', 'E15:')
-  endif
+  call assert_fails('let f = .5', 'E15:')
 endfunc
 
 scriptversion 3
index 3a8580e98d31e58a5a46d2320e1ddc2f226d928e..b25f211f8b935bd11ea2bb539b15ff2bb6ba0c63 100644 (file)
@@ -38,11 +38,9 @@ func Test_execute_string()
   call assert_equal("\nsomething", execute('echo "something"', 'silent'))
   call assert_equal("\nsomething", execute('echo "something"', 'silent!'))
   call assert_equal("", execute('burp', 'silent!'))
-  if has('float')
-    call assert_fails('call execute(3.4)', 'E492:')
-    call assert_equal("\nx", execute("echo \"x\"", 3.4))
-    call v9.CheckDefExecAndScriptFailure(['execute("echo \"x\"", 3.4)'], ['E1013: Argument 2: type mismatch, expected string but got float', 'E1174:'])
-  endif
+  call assert_fails('call execute(3.4)', 'E492:')
+  call assert_equal("\nx", execute("echo \"x\"", 3.4))
+  call v9.CheckDefExecAndScriptFailure(['execute("echo \"x\"", 3.4)'], ['E1013: Argument 2: type mismatch, expected string but got float', 'E1174:'])
 endfunc
 
 func Test_execute_list()
index 3cd2a0d0da9bdb29aa1fb6bc711e89580eae72a5..8e2345d7f4943c79576a3cff67b801666329e2cb 100644 (file)
@@ -77,9 +77,7 @@ func Test_op_falsy()
       call assert_equal(0z00, 0z00 ?? 456)
       call assert_equal([1], [1] ?? 456)
       call assert_equal({'one': 1}, {'one': 1} ?? 456)
-      if has('float')
-        call assert_equal(0.1, 0.1 ?? 456)
-      endif
+      call assert_equal(0.1, 0.1 ?? 456)
 
       call assert_equal(456, v:false ?? 456)
       call assert_equal(456, 0 ?? 456)
@@ -87,9 +85,7 @@ func Test_op_falsy()
       call assert_equal(456, 0z ?? 456)
       call assert_equal(456, [] ?? 456)
       call assert_equal(456, {} ?? 456)
-      if has('float')
-        call assert_equal(456, 0.0 ?? 456)
-      endif
+      call assert_equal(456, 0.0 ?? 456)
   END
   call v9.CheckLegacyAndVim9Success(lines)
 endfunc
@@ -200,10 +196,8 @@ func Test_compare_with_null()
   call assert_false(s:value == v:null)
   let s:value = 0
   call assert_true(s:value == v:null)
-  if has('float')
-    let s:value = 0.0
-    call assert_true(s:value == v:null)
-  endif
+  let s:value = 0.0
+  call assert_true(s:value == v:null)
   let s:value = ''
   call assert_false(s:value == v:null)
   let s:value = 0z
@@ -467,116 +461,114 @@ func Test_printf_misc()
 endfunc
 
 func Test_printf_float()
-  if has('float')
-    let lines =<< trim END
-        call assert_equal('1.000000', printf('%f', 1))
-        call assert_equal('1.230000', printf('%f', 1.23))
-        call assert_equal('1.230000', printf('%F', 1.23))
-        call assert_equal('9999999.9', printf('%g', 9999999.9))
-        call assert_equal('9999999.9', printf('%G', 9999999.9))
-        call assert_equal('1.00000001e7', printf('%.8g', 10000000.1))
-        call assert_equal('1.00000001E7', printf('%.8G', 10000000.1))
-        call assert_equal('1.230000e+00', printf('%e', 1.23))
-        call assert_equal('1.230000E+00', printf('%E', 1.23))
-        call assert_equal('1.200000e-02', printf('%e', 0.012))
-        call assert_equal('-1.200000e-02', printf('%e', -0.012))
-        call assert_equal('0.33', printf('%.2f', 1.0 / 3.0))
-        call assert_equal('  0.33', printf('%6.2f', 1.0 / 3.0))
-        call assert_equal(' -0.33', printf('%6.2f', -1.0 / 3.0))
-        call assert_equal('000.33', printf('%06.2f', 1.0 / 3.0))
-        call assert_equal('-00.33', printf('%06.2f', -1.0 / 3.0))
-        call assert_equal('-00.33', printf('%+06.2f', -1.0 / 3.0))
-        call assert_equal('+00.33', printf('%+06.2f', 1.0 / 3.0))
-        call assert_equal(' 00.33', printf('% 06.2f', 1.0 / 3.0))
-        call assert_equal('000.33', printf('%06.2g', 1.0 / 3.0))
-        call assert_equal('-00.33', printf('%06.2g', -1.0 / 3.0))
-        call assert_equal('0.33', printf('%3.2f', 1.0 / 3.0))
-        call assert_equal('003.33e-01', printf('%010.2e', 1.0 / 3.0))
-        call assert_equal(' 03.33e-01', printf('% 010.2e', 1.0 / 3.0))
-        call assert_equal('+03.33e-01', printf('%+010.2e', 1.0 / 3.0))
-        call assert_equal('-03.33e-01', printf('%010.2e', -1.0 / 3.0))
-
-        #" When precision is 0, the dot should be omitted.
-        call assert_equal('  2', printf('%3.f', 7.0 / 3.0))
-        call assert_equal('  2', printf('%3.g', 7.0 / 3.0))
-        call assert_equal('  2e+00', printf('%7.e', 7.0 / 3.0))
-
-        #" Float zero can be signed.
-        call assert_equal('+0.000000', printf('%+f', 0.0))
-        call assert_equal('0.000000', printf('%f', 1.0 / (1.0 / 0.0)))
-        call assert_equal('-0.000000', printf('%f', 1.0 / (-1.0 / 0.0)))
-        call assert_equal('0.0', printf('%s', 1.0 / (1.0 / 0.0)))
-        call assert_equal('-0.0', printf('%s', 1.0 / (-1.0 / 0.0)))
-        call assert_equal('0.0', printf('%S', 1.0 / (1.0 / 0.0)))
-        call assert_equal('-0.0', printf('%S', 1.0 / (-1.0 / 0.0)))
-
-        #" Float infinity can be signed.
-        call assert_equal('inf', printf('%f', 1.0 / 0.0))
-        call assert_equal('-inf', printf('%f', -1.0 / 0.0))
-        call assert_equal('inf', printf('%g', 1.0 / 0.0))
-        call assert_equal('-inf', printf('%g', -1.0 / 0.0))
-        call assert_equal('inf', printf('%e', 1.0 / 0.0))
-        call assert_equal('-inf', printf('%e', -1.0 / 0.0))
-        call assert_equal('INF', printf('%F', 1.0 / 0.0))
-        call assert_equal('-INF', printf('%F', -1.0 / 0.0))
-        call assert_equal('INF', printf('%E', 1.0 / 0.0))
-        call assert_equal('-INF', printf('%E', -1.0 / 0.0))
-        call assert_equal('INF', printf('%E', 1.0 / 0.0))
-        call assert_equal('-INF', printf('%G', -1.0 / 0.0))
-        call assert_equal('+inf', printf('%+f', 1.0 / 0.0))
-        call assert_equal('-inf', printf('%+f', -1.0 / 0.0))
-        call assert_equal(' inf', printf('% f',  1.0 / 0.0))
-        call assert_equal('   inf', printf('%6f', 1.0 / 0.0))
-        call assert_equal('  -inf', printf('%6f', -1.0 / 0.0))
-        call assert_equal('   inf', printf('%6g', 1.0 / 0.0))
-        call assert_equal('  -inf', printf('%6g', -1.0 / 0.0))
-        call assert_equal('  +inf', printf('%+6f', 1.0 / 0.0))
-        call assert_equal('   inf', printf('% 6f', 1.0 / 0.0))
-        call assert_equal('  +inf', printf('%+06f', 1.0 / 0.0))
-        call assert_equal('inf   ', printf('%-6f', 1.0 / 0.0))
-        call assert_equal('-inf  ', printf('%-6f', -1.0 / 0.0))
-        call assert_equal('+inf  ', printf('%-+6f', 1.0 / 0.0))
-        call assert_equal(' inf  ', printf('%- 6f', 1.0 / 0.0))
-        call assert_equal('-INF  ', printf('%-6F', -1.0 / 0.0))
-        call assert_equal('+INF  ', printf('%-+6F', 1.0 / 0.0))
-        call assert_equal(' INF  ', printf('%- 6F', 1.0 / 0.0))
-        call assert_equal('INF   ', printf('%-6G', 1.0 / 0.0))
-        call assert_equal('-INF  ', printf('%-6G', -1.0 / 0.0))
-        call assert_equal('INF   ', printf('%-6E', 1.0 / 0.0))
-        call assert_equal('-INF  ', printf('%-6E', -1.0 / 0.0))
-        call assert_equal('inf', printf('%s', 1.0 / 0.0))
-        call assert_equal('-inf', printf('%s', -1.0 / 0.0))
-
-        #" Test special case where max precision is truncated at 340.
-        call assert_equal('1.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000', printf('%.330f', 1.0))
-        call assert_equal('1.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000', printf('%.340f', 1.0))
-        call assert_equal('1.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000', printf('%.350f', 1.0))
-
-        #" Float nan (not a number) has no sign.
-        call assert_equal('nan', printf('%f', sqrt(-1.0)))
-        call assert_equal('nan', printf('%f', 0.0 / 0.0))
-        call assert_equal('nan', printf('%f', -0.0 / 0.0))
-        call assert_equal('nan', printf('%g', 0.0 / 0.0))
-        call assert_equal('nan', printf('%e', 0.0 / 0.0))
-        call assert_equal('NAN', printf('%F', 0.0 / 0.0))
-        call assert_equal('NAN', printf('%G', 0.0 / 0.0))
-        call assert_equal('NAN', printf('%E', 0.0 / 0.0))
-        call assert_equal('NAN', printf('%F', -0.0 / 0.0))
-        call assert_equal('NAN', printf('%G', -0.0 / 0.0))
-        call assert_equal('NAN', printf('%E', -0.0 / 0.0))
-        call assert_equal('   nan', printf('%6f', 0.0 / 0.0))
-        call assert_equal('   nan', printf('%06f', 0.0 / 0.0))
-        call assert_equal('nan   ', printf('%-6f', 0.0 / 0.0))
-        call assert_equal('nan   ', printf('%- 6f', 0.0 / 0.0))
-        call assert_equal('nan', printf('%s', 0.0 / 0.0))
-        call assert_equal('nan', printf('%s', -0.0 / 0.0))
-        call assert_equal('nan', printf('%S', 0.0 / 0.0))
-        call assert_equal('nan', printf('%S', -0.0 / 0.0))
-    END
-    call v9.CheckLegacyAndVim9Success(lines)
-
-    call v9.CheckLegacyAndVim9Failure(['echo printf("%f", "a")'], 'E807:')
-  endif
+  let lines =<< trim END
+      call assert_equal('1.000000', printf('%f', 1))
+      call assert_equal('1.230000', printf('%f', 1.23))
+      call assert_equal('1.230000', printf('%F', 1.23))
+      call assert_equal('9999999.9', printf('%g', 9999999.9))
+      call assert_equal('9999999.9', printf('%G', 9999999.9))
+      call assert_equal('1.00000001e7', printf('%.8g', 10000000.1))
+      call assert_equal('1.00000001E7', printf('%.8G', 10000000.1))
+      call assert_equal('1.230000e+00', printf('%e', 1.23))
+      call assert_equal('1.230000E+00', printf('%E', 1.23))
+      call assert_equal('1.200000e-02', printf('%e', 0.012))
+      call assert_equal('-1.200000e-02', printf('%e', -0.012))
+      call assert_equal('0.33', printf('%.2f', 1.0 / 3.0))
+      call assert_equal('  0.33', printf('%6.2f', 1.0 / 3.0))
+      call assert_equal(' -0.33', printf('%6.2f', -1.0 / 3.0))
+      call assert_equal('000.33', printf('%06.2f', 1.0 / 3.0))
+      call assert_equal('-00.33', printf('%06.2f', -1.0 / 3.0))
+      call assert_equal('-00.33', printf('%+06.2f', -1.0 / 3.0))
+      call assert_equal('+00.33', printf('%+06.2f', 1.0 / 3.0))
+      call assert_equal(' 00.33', printf('% 06.2f', 1.0 / 3.0))
+      call assert_equal('000.33', printf('%06.2g', 1.0 / 3.0))
+      call assert_equal('-00.33', printf('%06.2g', -1.0 / 3.0))
+      call assert_equal('0.33', printf('%3.2f', 1.0 / 3.0))
+      call assert_equal('003.33e-01', printf('%010.2e', 1.0 / 3.0))
+      call assert_equal(' 03.33e-01', printf('% 010.2e', 1.0 / 3.0))
+      call assert_equal('+03.33e-01', printf('%+010.2e', 1.0 / 3.0))
+      call assert_equal('-03.33e-01', printf('%010.2e', -1.0 / 3.0))
+
+      #" When precision is 0, the dot should be omitted.
+      call assert_equal('  2', printf('%3.f', 7.0 / 3.0))
+      call assert_equal('  2', printf('%3.g', 7.0 / 3.0))
+      call assert_equal('  2e+00', printf('%7.e', 7.0 / 3.0))
+
+      #" Float zero can be signed.
+      call assert_equal('+0.000000', printf('%+f', 0.0))
+      call assert_equal('0.000000', printf('%f', 1.0 / (1.0 / 0.0)))
+      call assert_equal('-0.000000', printf('%f', 1.0 / (-1.0 / 0.0)))
+      call assert_equal('0.0', printf('%s', 1.0 / (1.0 / 0.0)))
+      call assert_equal('-0.0', printf('%s', 1.0 / (-1.0 / 0.0)))
+      call assert_equal('0.0', printf('%S', 1.0 / (1.0 / 0.0)))
+      call assert_equal('-0.0', printf('%S', 1.0 / (-1.0 / 0.0)))
+
+      #" Float infinity can be signed.
+      call assert_equal('inf', printf('%f', 1.0 / 0.0))
+      call assert_equal('-inf', printf('%f', -1.0 / 0.0))
+      call assert_equal('inf', printf('%g', 1.0 / 0.0))
+      call assert_equal('-inf', printf('%g', -1.0 / 0.0))
+      call assert_equal('inf', printf('%e', 1.0 / 0.0))
+      call assert_equal('-inf', printf('%e', -1.0 / 0.0))
+      call assert_equal('INF', printf('%F', 1.0 / 0.0))
+      call assert_equal('-INF', printf('%F', -1.0 / 0.0))
+      call assert_equal('INF', printf('%E', 1.0 / 0.0))
+      call assert_equal('-INF', printf('%E', -1.0 / 0.0))
+      call assert_equal('INF', printf('%E', 1.0 / 0.0))
+      call assert_equal('-INF', printf('%G', -1.0 / 0.0))
+      call assert_equal('+inf', printf('%+f', 1.0 / 0.0))
+      call assert_equal('-inf', printf('%+f', -1.0 / 0.0))
+      call assert_equal(' inf', printf('% f',  1.0 / 0.0))
+      call assert_equal('   inf', printf('%6f', 1.0 / 0.0))
+      call assert_equal('  -inf', printf('%6f', -1.0 / 0.0))
+      call assert_equal('   inf', printf('%6g', 1.0 / 0.0))
+      call assert_equal('  -inf', printf('%6g', -1.0 / 0.0))
+      call assert_equal('  +inf', printf('%+6f', 1.0 / 0.0))
+      call assert_equal('   inf', printf('% 6f', 1.0 / 0.0))
+      call assert_equal('  +inf', printf('%+06f', 1.0 / 0.0))
+      call assert_equal('inf   ', printf('%-6f', 1.0 / 0.0))
+      call assert_equal('-inf  ', printf('%-6f', -1.0 / 0.0))
+      call assert_equal('+inf  ', printf('%-+6f', 1.0 / 0.0))
+      call assert_equal(' inf  ', printf('%- 6f', 1.0 / 0.0))
+      call assert_equal('-INF  ', printf('%-6F', -1.0 / 0.0))
+      call assert_equal('+INF  ', printf('%-+6F', 1.0 / 0.0))
+      call assert_equal(' INF  ', printf('%- 6F', 1.0 / 0.0))
+      call assert_equal('INF   ', printf('%-6G', 1.0 / 0.0))
+      call assert_equal('-INF  ', printf('%-6G', -1.0 / 0.0))
+      call assert_equal('INF   ', printf('%-6E', 1.0 / 0.0))
+      call assert_equal('-INF  ', printf('%-6E', -1.0 / 0.0))
+      call assert_equal('inf', printf('%s', 1.0 / 0.0))
+      call assert_equal('-inf', printf('%s', -1.0 / 0.0))
+
+      #" Test special case where max precision is truncated at 340.
+      call assert_equal('1.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000', printf('%.330f', 1.0))
+      call assert_equal('1.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000', printf('%.340f', 1.0))
+      call assert_equal('1.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000', printf('%.350f', 1.0))
+
+      #" Float nan (not a number) has no sign.
+      call assert_equal('nan', printf('%f', sqrt(-1.0)))
+      call assert_equal('nan', printf('%f', 0.0 / 0.0))
+      call assert_equal('nan', printf('%f', -0.0 / 0.0))
+      call assert_equal('nan', printf('%g', 0.0 / 0.0))
+      call assert_equal('nan', printf('%e', 0.0 / 0.0))
+      call assert_equal('NAN', printf('%F', 0.0 / 0.0))
+      call assert_equal('NAN', printf('%G', 0.0 / 0.0))
+      call assert_equal('NAN', printf('%E', 0.0 / 0.0))
+      call assert_equal('NAN', printf('%F', -0.0 / 0.0))
+      call assert_equal('NAN', printf('%G', -0.0 / 0.0))
+      call assert_equal('NAN', printf('%E', -0.0 / 0.0))
+      call assert_equal('   nan', printf('%6f', 0.0 / 0.0))
+      call assert_equal('   nan', printf('%06f', 0.0 / 0.0))
+      call assert_equal('nan   ', printf('%-6f', 0.0 / 0.0))
+      call assert_equal('nan   ', printf('%- 6f', 0.0 / 0.0))
+      call assert_equal('nan', printf('%s', 0.0 / 0.0))
+      call assert_equal('nan', printf('%s', -0.0 / 0.0))
+      call assert_equal('nan', printf('%S', 0.0 / 0.0))
+      call assert_equal('nan', printf('%S', -0.0 / 0.0))
+  END
+  call v9.CheckLegacyAndVim9Success(lines)
+
+  call v9.CheckLegacyAndVim9Failure(['echo printf("%f", "a")'], 'E807:')
 endfunc
 
 func Test_printf_errors()
@@ -585,10 +577,8 @@ func Test_printf_errors()
   call v9.CheckLegacyAndVim9Failure(['echo printf("%d", 1, 2)'], 'E767:')
   call v9.CheckLegacyAndVim9Failure(['echo printf("%*d", 1)'], 'E766:')
   call v9.CheckLegacyAndVim9Failure(['echo printf("%s")'], 'E766:')
-  if has('float')
-    call v9.CheckLegacyAndVim9Failure(['echo printf("%d", 1.2)'], 'E805:')
-    call v9.CheckLegacyAndVim9Failure(['echo printf("%f")'], 'E766:')
-  endif
+  call v9.CheckLegacyAndVim9Failure(['echo printf("%d", 1.2)'], 'E805:')
+  call v9.CheckLegacyAndVim9Failure(['echo printf("%f")'], 'E766:')
 endfunc
 
 func Test_printf_64bit()
@@ -607,9 +597,7 @@ func Test_printf_spec_s()
       call assert_equal("abcdefgi", printf('%s', "abcdefgi"))
 
       #" float
-      if has('float')
-        call assert_equal("1.23", printf('%s', 1.23))
-      endif
+      call assert_equal("1.23", printf('%s', 1.23))
 
       #" list
       VAR lvalue = [1, 'two', ['three', 4]]
@@ -878,8 +866,6 @@ endfunc
 
 " Test for float value comparison
 func Test_float_compare()
-  CheckFeature float
-
   let lines =<< trim END
       call assert_true(1.2 == 1.2)
       call assert_true(1.0 != 1.2)
index 8ef1b9d5eafef83e0d90e37ddf12e05505eb6eef..acc2e11e0ad78a3c771f7b8b33813ab648772b37 100644 (file)
@@ -1,7 +1,6 @@
 " test float functions
 
 source check.vim
-CheckFeature float
 import './vim9.vim' as v9
 
 func Test_abs()
index 4c71e227ae2856e48535ac63c64565c0bf8b839b..ba6b790c0266e7d9b529337a7f476bfb8912f8d1 100644 (file)
@@ -54,14 +54,12 @@ func Test_empty()
   call assert_equal(0, empty(1))
   call assert_equal(0, empty(-1))
 
-  if has('float')
-    call assert_equal(1, empty(0.0))
-    call assert_equal(1, empty(-0.0))
-    call assert_equal(0, empty(1.0))
-    call assert_equal(0, empty(-1.0))
-    call assert_equal(0, empty(1.0/0.0))
-    call assert_equal(0, empty(0.0/0.0))
-  endif
+  call assert_equal(1, empty(0.0))
+  call assert_equal(1, empty(-0.0))
+  call assert_equal(0, empty(1.0))
+  call assert_equal(0, empty(-1.0))
+  call assert_equal(0, empty(1.0/0.0))
+  call assert_equal(0, empty(0.0/0.0))
 
   call assert_equal(1, empty([]))
   call assert_equal(0, empty(['a']))
@@ -90,9 +88,7 @@ endfunc
 
 func Test_test_void()
   call assert_fails('echo 1 == test_void()', 'E1031:')
-  if has('float')
-    call assert_fails('echo 1.0 == test_void()', 'E1031:')
-  endif
+  call assert_fails('echo 1.0 == test_void()', 'E1031:')
   call assert_fails('let x = json_encode(test_void())', 'E685:')
   call assert_fails('let x = copy(test_void())', 'E685:')
   call assert_fails('let x = copy([test_void()])', 'E1031:')
@@ -175,10 +171,8 @@ func Test_strwidth()
     call assert_fails('call strwidth({})', 'E731:')
   endfor
 
-  if has('float')
-    call assert_equal(3, strwidth(1.2))
-    call v9.CheckDefAndScriptFailure(['echo strwidth(1.2)'], ['E1013: Argument 1: type mismatch, expected string but got float', 'E1174: String required for argument 1'])
-  endif
+  call assert_equal(3, strwidth(1.2))
+  call v9.CheckDefAndScriptFailure(['echo strwidth(1.2)'], ['E1013: Argument 1: type mismatch, expected string but got float', 'E1174: String required for argument 1'])
 
   set ambiwidth&
 endfunc
@@ -242,10 +236,8 @@ func Test_str2nr()
 
   call assert_fails('call str2nr([])', 'E730:')
   call assert_fails('call str2nr({->2})', 'E729:')
-  if has('float')
-    call assert_equal(1, str2nr(1.2))
-    call v9.CheckDefAndScriptFailure(['echo str2nr(1.2)'], ['E1013: Argument 1: type mismatch, expected string but got float', 'E1174: String required for argument 1'])
-  endif
+  call assert_equal(1, str2nr(1.2))
+  call v9.CheckDefAndScriptFailure(['echo str2nr(1.2)'], ['E1013: Argument 1: type mismatch, expected string but got float', 'E1174: String required for argument 1'])
   call assert_fails('call str2nr(10, [])', 'E745:')
 endfunc
 
@@ -504,10 +496,8 @@ func Test_simplify()
   call assert_fails('call simplify({->0})', 'E729:')
   call assert_fails('call simplify([])', 'E730:')
   call assert_fails('call simplify({})', 'E731:')
-  if has('float')
-    call assert_equal('1.2', simplify(1.2))
-    call v9.CheckDefAndScriptFailure(['echo simplify(1.2)'], ['E1013: Argument 1: type mismatch, expected string but got float', 'E1174: String required for argument 1'])
-  endif
+  call assert_equal('1.2', simplify(1.2))
+  call v9.CheckDefAndScriptFailure(['echo simplify(1.2)'], ['E1013: Argument 1: type mismatch, expected string but got float', 'E1174: String required for argument 1'])
 endfunc
 
 func Test_pathshorten()
index 17ae3fcf2ae250a4b105f95b52a64b86bb7947ac..965ca5c4a737026a0c198a23b5c712d2b0784594 100644 (file)
@@ -3,10 +3,8 @@
 import './vim9.vim' as v9
 
 func Test_glob2regpat_invalid()
-  if has('float')
-    call assert_equal('^1\.33$', glob2regpat(1.33))
-    call v9.CheckDefAndScriptFailure(['echo glob2regpat(1.2)'], ['E1013: Argument 1: type mismatch, expected string but got float', 'E1174: String required for argument 1'])
-  endif
+  call assert_equal('^1\.33$', glob2regpat(1.33))
+  call v9.CheckDefAndScriptFailure(['echo glob2regpat(1.2)'], ['E1013: Argument 1: type mismatch, expected string but got float', 'E1174: String required for argument 1'])
   call assert_fails('call glob2regpat("}")', 'E219:')
   call assert_fails('call glob2regpat("{")', 'E220:')
 endfunc
index 3ee783703336d89e0bbd9d03ddb10c2aee0c367b..96eddc23d5e0a7f19e32e6007518b2b0220169e7 100644 (file)
@@ -21,16 +21,14 @@ let s:jsonmb = '"s¢cÄ´gÑ‘"'
 let s:varmb = "s¢cÄ´gÑ‘"
 let s:jsonnr = '1234'
 let s:varnr = 1234
-if has('float')
-  let s:jsonfl = '12.34'
-  let s:varfl = 12.34
-  let s:jsonneginf = '-Infinity'
-  let s:jsonposinf = 'Infinity'
-  let s:varneginf = -1.0 / 0.0
-  let s:varposinf = 1.0 / 0.0
-  let s:jsonnan = 'NaN'
-  let s:varnan = 0.0 / 0.0
-endif
+let s:jsonfl = '12.34'
+let s:varfl = 12.34
+let s:jsonneginf = '-Infinity'
+let s:jsonposinf = 'Infinity'
+let s:varneginf = -1.0 / 0.0
+let s:varposinf = 1.0 / 0.0
+let s:jsonnan = 'NaN'
+let s:varnan = 0.0 / 0.0
 
 let s:jsonl1 = '[1,"a",3]'
 let s:varl1 = [1, "a", 3]
@@ -82,12 +80,10 @@ func Test_json_encode()
   " no test for surrogate pair, json_encode() doesn't create them.
 
   call assert_equal(s:jsonnr, json_encode(s:varnr))
-  if has('float')
-    call assert_equal(s:jsonfl, json_encode(s:varfl))
-    call assert_equal(s:jsonneginf, json_encode(s:varneginf))
-    call assert_equal(s:jsonposinf, json_encode(s:varposinf))
-    call assert_equal(s:jsonnan, json_encode(s:varnan))
-  endif
+  call assert_equal(s:jsonfl, json_encode(s:varfl))
+  call assert_equal(s:jsonneginf, json_encode(s:varneginf))
+  call assert_equal(s:jsonposinf, json_encode(s:varposinf))
+  call assert_equal(s:jsonnan, json_encode(s:varnan))
 
   call assert_equal(s:jsonl1, json_encode(s:varl1))
   call assert_equal(s:jsonl2, json_encode(s:varl2))
@@ -133,9 +129,7 @@ func Test_json_decode()
   call assert_equal(s:varsp2, json_decode(s:jsonsp2))
 
   call assert_equal(s:varnr, json_decode(s:jsonnr))
-  if has('float')
-    call assert_equal(s:varfl, json_decode(s:jsonfl))
-  endif
+  call assert_equal(s:varfl, json_decode(s:jsonfl))
 
   call assert_equal(s:varl1, json_decode(s:jsonl1))
   call assert_equal(s:varl2x, json_decode(s:jsonl2))
@@ -189,9 +183,7 @@ func Test_json_decode()
   call assert_fails('call json_decode("{\"n\":1,")', "E491:")
   call assert_fails('call json_decode("{\"n\",1}")', "E491:")
   call assert_fails('call json_decode("{-}")', "E491:")
-  if has('float')
-    call assert_fails('call json_decode("{3.14:1}")', "E806:")
-  endif
+  call assert_fails('call json_decode("{3.14:1}")', "E806:")
 
   call assert_fails('call json_decode("[foobar]")', "E491:")
   call assert_fails('call json_decode("[")', "E491:")
@@ -230,12 +222,10 @@ func Test_js_encode()
   " no test for surrogate pair, js_encode() doesn't create them.
 
   call assert_equal(s:jsonnr, js_encode(s:varnr))
-  if has('float')
-    call assert_equal(s:jsonfl, js_encode(s:varfl))
-    call assert_equal(s:jsonneginf, js_encode(s:varneginf))
-    call assert_equal(s:jsonposinf, js_encode(s:varposinf))
-    call assert_equal(s:jsonnan, js_encode(s:varnan))
-  endif
+  call assert_equal(s:jsonfl, js_encode(s:varfl))
+  call assert_equal(s:jsonneginf, js_encode(s:varneginf))
+  call assert_equal(s:jsonposinf, js_encode(s:varposinf))
+  call assert_equal(s:jsonnan, js_encode(s:varnan))
 
   call assert_equal(s:jsonl1, js_encode(s:varl1))
   call assert_equal(s:jsonl2, js_encode(s:varl2))
@@ -270,12 +260,10 @@ func Test_js_decode()
   call assert_equal(s:varsp2, js_decode(s:jsonsp2))
 
   call assert_equal(s:varnr, js_decode(s:jsonnr))
-  if has('float')
-    call assert_equal(s:varfl, js_decode(s:jsonfl))
-    call assert_equal(s:varneginf, js_decode(s:jsonneginf))
-    call assert_equal(s:varposinf, js_decode(s:jsonposinf))
-    call assert_true(isnan(js_decode(s:jsonnan)))
-  endif
+  call assert_equal(s:varfl, js_decode(s:jsonfl))
+  call assert_equal(s:varneginf, js_decode(s:jsonneginf))
+  call assert_equal(s:varposinf, js_decode(s:jsonposinf))
+  call assert_true(isnan(js_decode(s:jsonnan)))
 
   call assert_equal(s:varl1, js_decode(s:jsonl1))
   call assert_equal(s:varl2x, js_decode(s:jsonl2))
index 63ba47fabe1d07d6c3630a69b13b6cb1b845749c..4476e2be2564f4a001eadb00f98a3884441616e9 100644 (file)
@@ -966,20 +966,18 @@ func Test_reverse_sort_uniq()
       call assert_equal(['-0', 'A11', 2, 'xaaa', 4, 'foo', 'foo6', 'foo', [0, 1, 2], 'x8', [0, 1, 2], 1.5], uniq(copy(l)))
       call assert_equal([1.5, [0, 1, 2], 'x8', [0, 1, 2], 'foo', 'foo6', 'foo', 4, 'xaaa', 2, 2, 'A11', '-0'], reverse(l))
       call assert_equal([1.5, [0, 1, 2], 'x8', [0, 1, 2], 'foo', 'foo6', 'foo', 4, 'xaaa', 2, 2, 'A11', '-0'], reverse(reverse(l)))
-      if has('float')
-        call assert_equal(['-0', 'A11', 'foo', 'foo', 'foo6', 'x8', 'xaaa', 1.5, 2, 2, 4, [0, 1, 2], [0, 1, 2]], sort(l))
-        call assert_equal([[0, 1, 2], [0, 1, 2], 4, 2, 2, 1.5, 'xaaa', 'x8', 'foo6', 'foo', 'foo', 'A11', '-0'], reverse(sort(l)))
-        call assert_equal(['-0', 'A11', 'foo', 'foo', 'foo6', 'x8', 'xaaa', 1.5, 2, 2, 4, [0, 1, 2], [0, 1, 2]], sort(reverse(sort(l))))
-        call assert_equal(['-0', 'A11', 'foo', 'foo6', 'x8', 'xaaa', 1.5, 2, 4, [0, 1, 2]], uniq(sort(l)))
-
-        LET l = [7, 9, 'one', 18, 12, 22, 'two', 10.0e-16, -1, 'three', 0xff, 0.22, 'four']
-        call assert_equal([-1, 'one', 'two', 'three', 'four', 1.0e-15, 0.22, 7, 9, 12, 18, 22, 255], sort(copy(l), 'n'))
-
-        LET l = [7, 9, 18, 12, 22, 10.0e-16, -1, 0xff, 0, -0, 0.22, 'bar', 'BAR', 'Bar', 'Foo', 'FOO', 'foo', 'FOOBAR', {}, []]
-        call assert_equal(['bar', 'BAR', 'Bar', 'Foo', 'FOO', 'foo', 'FOOBAR', -1, 0, 0, 0.22, 1.0e-15, 12, 18, 22, 255, 7, 9, [], {}], sort(copy(l), 'i'))
-        call assert_equal(['bar', 'BAR', 'Bar', 'Foo', 'FOO', 'foo', 'FOOBAR', -1, 0, 0, 0.22, 1.0e-15, 12, 18, 22, 255, 7, 9, [], {}], sort(copy(l), 'i'))
-        call assert_equal(['BAR', 'Bar', 'FOO', 'FOOBAR', 'Foo', 'bar', 'foo', -1, 0, 0, 0.22, 1.0e-15, 12, 18, 22, 255, 7, 9, [], {}], sort(copy(l)))
-      endif
+      call assert_equal(['-0', 'A11', 'foo', 'foo', 'foo6', 'x8', 'xaaa', 1.5, 2, 2, 4, [0, 1, 2], [0, 1, 2]], sort(l))
+      call assert_equal([[0, 1, 2], [0, 1, 2], 4, 2, 2, 1.5, 'xaaa', 'x8', 'foo6', 'foo', 'foo', 'A11', '-0'], reverse(sort(l)))
+      call assert_equal(['-0', 'A11', 'foo', 'foo', 'foo6', 'x8', 'xaaa', 1.5, 2, 2, 4, [0, 1, 2], [0, 1, 2]], sort(reverse(sort(l))))
+      call assert_equal(['-0', 'A11', 'foo', 'foo6', 'x8', 'xaaa', 1.5, 2, 4, [0, 1, 2]], uniq(sort(l)))
+
+      LET l = [7, 9, 'one', 18, 12, 22, 'two', 10.0e-16, -1, 'three', 0xff, 0.22, 'four']
+      call assert_equal([-1, 'one', 'two', 'three', 'four', 1.0e-15, 0.22, 7, 9, 12, 18, 22, 255], sort(copy(l), 'n'))
+
+      LET l = [7, 9, 18, 12, 22, 10.0e-16, -1, 0xff, 0, -0, 0.22, 'bar', 'BAR', 'Bar', 'Foo', 'FOO', 'foo', 'FOOBAR', {}, []]
+      call assert_equal(['bar', 'BAR', 'Bar', 'Foo', 'FOO', 'foo', 'FOOBAR', -1, 0, 0, 0.22, 1.0e-15, 12, 18, 22, 255, 7, 9, [], {}], sort(copy(l), 'i'))
+      call assert_equal(['bar', 'BAR', 'Bar', 'Foo', 'FOO', 'foo', 'FOOBAR', -1, 0, 0, 0.22, 1.0e-15, 12, 18, 22, 255, 7, 9, [], {}], sort(copy(l), 'i'))
+      call assert_equal(['BAR', 'Bar', 'FOO', 'FOOBAR', 'Foo', 'bar', 'foo', -1, 0, 0, 0.22, 1.0e-15, 12, 18, 22, 255, 7, 9, [], {}], sort(copy(l)))
   END
   call v9.CheckLegacyAndVim9Success(lines)
 
@@ -1173,9 +1171,7 @@ func Test_listdict_extend()
   let l = [1, 2, 3]
   call assert_fails("call extend(l, [4, 5, 6], 4)", 'E684:')
   call assert_fails("call extend(l, [4, 5, 6], -4)", 'E684:')
-  if has('float')
-    call assert_fails("call extend(l, [4, 5, 6], 1.2)", 'E805:')
-  endif
+  call assert_fails("call extend(l, [4, 5, 6], 1.2)", 'E805:')
 
   " Test extend() with dictionaries.
 
@@ -1203,9 +1199,7 @@ func Test_listdict_extend()
   call assert_fails("call extend(d, {'b': 0, 'c':'C'}, 'error')", 'E737:')
   call assert_fails("call extend(d, {'b': 0}, [])", 'E730:')
   call assert_fails("call extend(d, {'b': 0, 'c':'C'}, 'xxx')", 'E475:')
-  if has('float')
-    call assert_fails("call extend(d, {'b': 0, 'c':'C'}, 1.2)", 'E475:')
-  endif
+  call assert_fails("call extend(d, {'b': 0, 'c':'C'}, 1.2)", 'E475:')
   call assert_equal({'a': 'A', 'b': 'B'}, d)
 
   call assert_fails("call extend([1, 2], 1)", 'E712:')
index 7fcd13d7dafad16266e1b33e6c33db5103b845ff..2a08607ff1fe213c6b6a446d20e30e192a45e756 100644 (file)
@@ -10,7 +10,6 @@ func Test_skip_lua()
 endfunc
 
 CheckFeature lua
-CheckFeature float
 
 " Depending on the lua version, the error messages are different.
 let [s:major, s:minor, s:patch] = luaeval('vim.lua_version')->split('\.')->map({-> str2nr(v:val)})
index 6dc9a5b801672d5e4423404e0b4986643761b663..e35fb0c383f58f3abf9eeff62e55329f64e0a5fc 100644 (file)
@@ -74,9 +74,7 @@ func Test_echomsg()
   call assert_equal("\n[1, 2, []]", execute(':echomsg [1, 2, test_null_list()]'))
   call assert_equal("\n{}", execute(':echomsg {}'))
   call assert_equal("\n{'a': 1, 'b': 2}", execute(':echomsg {"a": 1, "b": 2}'))
-  if has('float')
-    call assert_equal("\n1.23", execute(':echomsg 1.23'))
-  endif
+  call assert_equal("\n1.23", execute(':echomsg 1.23'))
   call assert_match("function('<lambda>\\d*')", execute(':echomsg {-> 1234}'))
 endfunc
 
@@ -86,9 +84,7 @@ func Test_echoerr()
   call assert_equal("\n12345 IgNoRe", execute(':echoerr 12345 "IgNoRe"'))
   call assert_equal("\n[1, 2, 'IgNoRe']", execute(':echoerr [1, 2, "IgNoRe"]'))
   call assert_equal("\n{'IgNoRe': 2, 'a': 1}", execute(':echoerr {"a": 1, "IgNoRe": 2}'))
-  if has('float')
-    call assert_equal("\n1.23 IgNoRe", execute(':echoerr 1.23 "IgNoRe"'))
-  endif
+  call assert_equal("\n1.23 IgNoRe", execute(':echoerr 1.23 "IgNoRe"'))
   eval '<lambda>'->test_ignore_error()
   call assert_match("function('<lambda>\\d*')", execute(':echoerr {-> 1234}'))
   call test_ignore_error('RESET')
index d31cce187676843d7b17826a7ccb2bbb77d96b4c..29734e049854351fd1bfbd76c8719229249ae510 100644 (file)
@@ -121,7 +121,6 @@ func Test_method_funcref()
 endfunc
 
 func Test_method_float()
-  CheckFeature float
   eval 1.234->string()->assert_equal('1.234')
   eval -1.234->string()->assert_equal('-1.234')
 endfunc
index cf4ca757303d7fe676dc7edb1439b0c3c22a9568..681aaae733c281e6d6b37283a5e909c7074063ea 100644 (file)
@@ -163,11 +163,7 @@ func Test_perleval()
   call assert_equal(0, perleval('0'))
   call assert_equal(2, perleval('2'))
   call assert_equal(-2, perleval('-2'))
-  if has('float')
-    call assert_equal(2.5, perleval('2.5'))
-  else
-    call assert_equal(2, perleval('2.5'))
-  end
+  call assert_equal(2.5, perleval('2.5'))
 
   sandbox call assert_equal(2, perleval('2'))
 
index af1e340faeb41b019a004297d25890208fe5e49a..066b4bd88f453669f6e9cbfa903ab0e56b4138f9 100644 (file)
@@ -686,7 +686,6 @@ func Test_python_function_call()
 endfunc
 
 func Test_python_float()
-  CheckFeature float
   let l = [0.0]
   py l = vim.bindeval('l')
   py l.extend([0.0])
@@ -785,9 +784,7 @@ func Test_python_pyeval()
   py v = vim.eval('test_null_function()')
   call assert_equal(v:none, pyeval('v'))
 
-  if has('float')
-    call assert_equal(0.0, pyeval('0.0'))
-  endif
+  call assert_equal(0.0, pyeval('0.0'))
 
   " Evaluate an invalid values
   call AssertException(['let v = pyeval(''"\0"'')'], 'E859:')
index 437da513b0f91adff0c308f57fb1f7a191b0de40..58082278c132cb3dbfdf8ce7c47442ac4b07aa0b 100644 (file)
@@ -286,16 +286,14 @@ endfunc
 " Test vim.eval() with various types.
 func Test_python3_vim_val()
   call assert_equal("\n8",             execute('py3 print(vim.eval("3+5"))'))
-  if has('float')
-    call assert_equal("\n3.140000",    execute('py3 print(vim.eval("1.01+2.13"))'))
-    call assert_equal("\n0.000000",    execute('py3 print(vim.eval("0.0/(1.0/0.0)"))'))
-    call assert_equal("\n0.000000",    execute('py3 print(vim.eval("0.0/(1.0/0.0)"))'))
-    call assert_equal("\n-0.000000",   execute('py3 print(vim.eval("0.0/(-1.0/0.0)"))'))
-    " Commented out: output of infinity and nan depend on platforms.
-    " call assert_equal("\ninf",         execute('py3 print(vim.eval("1.0/0.0"))'))
-    " call assert_equal("\n-inf",        execute('py3 print(vim.eval("-1.0/0.0"))'))
-    " call assert_equal("\n-nan",        execute('py3 print(vim.eval("0.0/0.0"))'))
-  endif
+  call assert_equal("\n3.140000",    execute('py3 print(vim.eval("1.01+2.13"))'))
+  call assert_equal("\n0.000000",    execute('py3 print(vim.eval("0.0/(1.0/0.0)"))'))
+  call assert_equal("\n0.000000",    execute('py3 print(vim.eval("0.0/(1.0/0.0)"))'))
+  call assert_equal("\n-0.000000",   execute('py3 print(vim.eval("0.0/(-1.0/0.0)"))'))
+  " Commented out: output of infinity and nan depend on platforms.
+  " call assert_equal("\ninf",         execute('py3 print(vim.eval("1.0/0.0"))'))
+  " call assert_equal("\n-inf",        execute('py3 print(vim.eval("-1.0/0.0"))'))
+  " call assert_equal("\n-nan",        execute('py3 print(vim.eval("0.0/0.0"))'))
   call assert_equal("\nabc",           execute('py3 print(vim.eval("\"abc\""))'))
   call assert_equal("\n['1', '2']",    execute('py3 print(vim.eval("[1, 2]"))'))
   call assert_equal("\n{'1': '2'}",    execute('py3 print(vim.eval("{1:2}"))'))
@@ -879,7 +877,6 @@ func Test_python3_function_call()
 endfunc
 
 func Test_python3_float()
-  CheckFeature float
   let l = [0.0]
   py3 l = vim.bindeval('l')
   py3 l.extend([0.0])
@@ -982,9 +979,7 @@ func Test_python3_pyeval()
   py3 v = vim.eval('test_null_function()')
   call assert_equal(v:none, py3eval('v'))
 
-  if has('float')
-    call assert_equal(0.0, py3eval('0.0'))
-  endif
+  call assert_equal(0.0, py3eval('0.0'))
 
   " Evaluate an invalid values
   call AssertException(['let v = py3eval(''"\0"'')'], 'E859:')
index 1457310bd67cfbe71337113bb7893f6c8f18dceb..afb3044e7f2fa258e352ddd3356ce3e6b64af4e1 100644 (file)
@@ -26,9 +26,7 @@ func Test_Rand()
   call assert_equal(1001954530, rand())
   call test_srand_seed()
 
-  if has('float')
-    call assert_fails('echo srand(1.2)', 'E805:')
-  endif
+  call assert_fails('echo srand(1.2)', 'E805:')
   call assert_fails('echo srand([1])', 'E745:')
   call assert_fails('echo rand("burp")', 'E475:')
   call assert_fails('echo rand([1, 2, 3])', 'E730:')
index 2f2e7aed7ed5b0421a966d471cd628e678248759..54104d511ec8daf07fa7fdb6437f2c084630d416 100644 (file)
@@ -2,7 +2,6 @@
 
 source check.vim
 CheckFeature reltime
-CheckFeature float
 
 func Test_reltime()
   let g:test_is_flaky = 1
index 321ec4032a908efa43a837b8defadcad75cd2561..224dffb994f2716f9ec7759950c7e7f70952214d 100644 (file)
@@ -304,10 +304,8 @@ func Test_ruby_Vim_evaluate()
   " on versions of Ruby.
   call assert_match('^Integer\|Fixnum$', rubyeval('Vim::evaluate("123").class'))
 
-  if has('float')
-    call assert_equal(1.23,       rubyeval('Vim::evaluate("1.23")'))
-    call assert_equal('Float',    rubyeval('Vim::evaluate("1.23").class'))
-  endif
+  call assert_equal(1.23,       rubyeval('Vim::evaluate("1.23")'))
+  call assert_equal('Float',    rubyeval('Vim::evaluate("1.23").class'))
 
   call assert_equal('foo',      rubyeval('Vim::evaluate("\"foo\"")'))
   call assert_equal('String',   rubyeval('Vim::evaluate("\"foo\"").class'))
index 783ca9ed7a352a4fed660595d9d503d3e1e84969..124948e2696ec55aa6b3463641467697d0424637 100644 (file)
@@ -62,7 +62,6 @@ func Test_sort_numbers()
 endfunc
 
 func Test_sort_float()
-  CheckFeature float
   call assert_equal([0.28, 3, 13.5], sort([13.5, 0.28, 3], 'f'))
 endfunc
 
@@ -72,8 +71,6 @@ func Test_sort_nested()
 endfunc
 
 func Test_sort_default()
-  CheckFeature float
-
   " docs say omitted, empty or zero argument sorts on string representation.
   call assert_equal(['2', 'A', 'AA', 'a', 1, 3.3], sort([3.3, 1, "2", "A", "a", "AA"]))
   call assert_equal(['2', 'A', 'AA', 'a', 1, 3.3], sort([3.3, 1, "2", "A", "a", "AA"], ''))
@@ -1336,34 +1333,32 @@ func Test_sort_cmd()
           \ ]
     endif
   endif
-  if has('float')
-    let tests += [
-          \ {
-          \    'name' : 'float',
-          \    'cmd' : 'sort f',
-          \    'input' : [
-          \    '1.234',
-          \    '0.88',
-          \    '  +  123.456',
-          \    '1.15e-6',
-          \    '-1.1e3',
-          \    '-1.01e3',
-          \    '',
-          \    ''
-          \    ],
-          \    'expected' : [
-          \    '',
-          \    '',
-          \    '-1.1e3',
-          \    '-1.01e3',
-          \    '1.15e-6',
-          \    '0.88',
-          \    '1.234',
-          \    '  +  123.456'
-          \    ]
-          \ },
-          \ ]
-  endif
+  let tests += [
+        \ {
+        \    'name' : 'float',
+        \    'cmd' : 'sort f',
+        \    'input' : [
+        \      '1.234',
+        \      '0.88',
+        \      '  +  123.456',
+        \      '1.15e-6',
+        \      '-1.1e3',
+        \      '-1.01e3',
+        \      '',
+        \      ''
+        \    ],
+        \    'expected' : [
+        \      '',
+        \      '',
+        \      '-1.1e3',
+        \      '-1.01e3',
+        \      '1.15e-6',
+        \      '0.88',
+        \      '1.234',
+        \      '  +  123.456'
+        \    ]
+        \ },
+        \ ]
 
   for t in tests
     enew!
index 9bbe99763cae3e6269ce0459d3eb8e87f47c4c87..1e73ba69b95c3deda125ffa2eb13d313cb4f38f4 100644 (file)
@@ -464,8 +464,6 @@ func Test_substitute_partial()
 endfunc
 
 func Test_substitute_float()
-  CheckFeature float
-
   call assert_equal('number 1.23', substitute('number ', '$', { -> 1.23 }, ''))
   vim9 assert_equal('number 1.23', substitute('number ', '$', () => 1.23, ''))
 endfunc
index 81e659ea5da2907d6a96859cb60d94a60a6e6353..fd427fe8096e1021e12c00ccf21f29539653de8c 100644 (file)
@@ -478,9 +478,7 @@ func Test_terminal_size()
 
   call assert_fails("call term_start(cmd, {'term_rows': -1})", 'E475:')
   call assert_fails("call term_start(cmd, {'term_rows': 1001})", 'E475:')
-  if has('float')
-    call assert_fails("call term_start(cmd, {'term_rows': 10.0})", 'E805:')
-  endif
+  call assert_fails("call term_start(cmd, {'term_rows': 10.0})", 'E805:')
 
   call delete('Xtext')
 endfunc
index 2071f5ebd0a304261da357ac459460bdb29b909f..4e95441a81635615f7a3df4bebb11fd13a894b4a 100644 (file)
@@ -43,9 +43,7 @@ func Test_if()
   call assert_fails('if [1]', 'E745:')
   call assert_fails('if {1: 1}', 'E728:')
   call assert_fails('if function("string")', 'E703:')
-  if has('float')
-    call assert_fails('if 1.3")', 'E805:')
-  endif
+  call assert_fails('if 1.3")', 'E805:')
 endfunc
 
 function Try_arg_true_false(expr, false_val, true_val)
@@ -117,7 +115,6 @@ func Test_true_false_arg()
 endfunc
 
 function Try_arg_non_zero(expr, false_val, true_val)
-  CheckFeature float
   for v in ['v:false', '0', '[1]', '{2:3}', '3.4'] 
     let r = eval(substitute(a:expr, '%v%', v, ''))
     call assert_equal(a:false_val, r, 'result for ' . v . ' is not ' . a:false_val . ' but ' . r)
index 4721175e770f1e279eb5d46384d6807028c755f7..4a74bc0be810191bd454d5cdbe589a7a81e0a942 100644 (file)
@@ -129,11 +129,9 @@ func MakeBadFunc()
 endfunc
 
 func Test_default_arg()
-  if has('float')
-    call assert_equal(1.0, Log(10))
-    call assert_equal(log(10), Log(10, exp(1)))
-    call assert_fails("call Log(1,2,3)", 'E118:')
-  endif
+  call assert_equal(1.0, Log(10))
+  call assert_equal(log(10), Log(10, exp(1)))
+  call assert_fails("call Log(1,2,3)", 'E118:')
 
   let res = Args(1)
   call assert_equal(res.mandatory, 1)
index 11d7425e6570287f4f1b611bd44e96e933413681..730212d109dbd5e83c9911ca149dfb379879f60f 100644 (file)
@@ -96,9 +96,7 @@ def Test_assignment()
 
     # calling job_start() is in test_vim9_fails.vim, it causes leak reports
   endif
-  if has('float')
-    var float1: float = 3.4
-  endif
+  var float1: float = 3.4
   var Funky1: func
   var Funky2: func = function('len')
   var Party2: func = funcref('g:Test_syntax')
@@ -147,17 +145,15 @@ def Test_assignment()
   &ts %= 4
   assert_equal(2, &ts)
 
-  if has('float')
-    var f100: float = 100.0
-    f100 /= 5
-    assert_equal(20.0, f100)
+  var f100: float = 100.0
+  f100 /= 5
+  assert_equal(20.0, f100)
 
-    var f200: float = 200.0
-    f200 /= 5.0
-    assert_equal(40.0, f200)
+  var f200: float = 200.0
+  f200 /= 5.0
+  assert_equal(40.0, f200)
 
-    v9.CheckDefFailure(['var nr: number = 200', 'nr /= 5.0'], 'E1012:')
-  endif
+  v9.CheckDefFailure(['var nr: number = 200', 'nr /= 5.0'], 'E1012:')
 
   lines =<< trim END
     &ts = 6
@@ -227,11 +223,9 @@ def Test_assignment()
   g:inc_counter += 1
   assert_equal(2, g:inc_counter)
 
-  if has('float')
-    var f: float
-    f += 1
-    assert_equal(1.0, f)
-  endif
+  var f: float
+  f += 1
+  assert_equal(1.0, f)
 
   $SOME_ENV_VAR ..= 'more'
   assert_equal('somemore', $SOME_ENV_VAR)
@@ -250,20 +244,16 @@ def Test_assignment()
 enddef
 
 def Test_float_and_number()
-  if !has('float')
-    MissingFeature float
-  else
-    var lines =<< trim END
-         var f: float
-         f += 2
-         f -= 1
-         assert_equal(1.0, f)
-         ++f
-         --f
-         assert_equal(1.0, f)
-    END
-    v9.CheckDefAndScriptSuccess(lines)
-  endif
+  var lines =<< trim END
+       var f: float
+       f += 2
+       f -= 1
+       assert_equal(1.0, f)
+       ++f
+       --f
+       assert_equal(1.0, f)
+  END
+  v9.CheckDefAndScriptSuccess(lines)
 enddef
 
 let g:someNumber = 43
@@ -1314,10 +1304,8 @@ def Test_assignment_default()
   var thenumber: number
   assert_equal(0, thenumber)
 
-  if has('float')
-    var thefloat: float
-    assert_equal(0.0, thefloat)
-  endif
+  var thefloat: float
+  assert_equal(0.0, thefloat)
 
   var thestring: string
   assert_equal('', thestring)
index dccd99bb321cad431b62506dc85e396edc5df6fb..fb21683c09c248beaa577bfbbf5783423a671d91 100644 (file)
@@ -69,11 +69,9 @@ def Test_abs()
   assert_equal(2, abs(-2))
   assert_equal(3, abs(3))
   v9.CheckDefAndScriptFailure(['abs("text")'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1219: Float or Number required for argument 1'])
-  if has('float')
-    assert_equal(0, abs(0))
-    assert_equal(2.0, abs(-2.0))
-    assert_equal(3.0, abs(3.0))
-  endif
+  assert_equal(0, abs(0))
+  assert_equal(2.0, abs(-2.0))
+  assert_equal(3.0, abs(3.0))
 enddef
 
 def Test_add()
@@ -1283,8 +1281,6 @@ enddef
 
 " Test for float functions argument type
 def Test_float_funcs_args()
-  CheckFeature float
-
   # acos()
   v9.CheckDefAndScriptFailure(['acos("a")'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1219: Float or Number required for argument 1'])
   assert_equal('1.570796', string(acos(0.0)))
@@ -4064,15 +4060,11 @@ def Test_state()
 enddef
 
 def Test_str2float()
-  if !has('float')
-    CheckFeature float
-  else
-    str2float("1.00")->assert_equal(1.00)
-    str2float("2e-2")->assert_equal(0.02)
-    str2float('')->assert_equal(0.0)
+  str2float("1.00")->assert_equal(1.00)
+  str2float("2e-2")->assert_equal(0.02)
+  str2float('')->assert_equal(0.0)
 
-    v9.CheckDefAndScriptFailure(['str2float(123)'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1'])
-  endif
+  v9.CheckDefAndScriptFailure(['str2float(123)'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1'])
 enddef
 
 def Test_str2list()
@@ -4585,9 +4577,7 @@ def Test_trim()
 enddef
 
 def Test_typename()
-  if has('float')
-    assert_equal('func([unknown], [unknown]): float', typename(function('pow')))
-  endif
+  assert_equal('func([unknown], [unknown]): float', typename(function('pow')))
   assert_equal('func(...): unknown', test_null_partial()->typename())
   assert_equal('list<unknown>', test_null_list()->typename())
   assert_equal('dict<unknown>', test_null_dict()->typename())
index 67cd9095d81dac112a1ed7d79a548b0c684b0a20..d4a520f147e90194c83dc9448026a587a29984eb 100644 (file)
@@ -309,9 +309,7 @@ def s:ScriptFuncPush()
   var localbool = true
   var localspec = v:none
   var localblob = 0z1234
-  if has('float')
-    var localfloat = 1.234
-  endif
+  var localfloat = 1.234
 enddef
 
 def Test_disassemble_push()
@@ -1742,13 +1740,11 @@ def s:Computing()
   anyres = g:number / 7
   anyres = g:number % 7
 
-  if has('float')
-    var fl = 3.0
-    var flres = fl + 7.0
-    flres = fl - 7.0
-    flres = fl * 7.0
-    flres = fl / 7.0
-  endif
+  var fl = 3.0
+  var flres = fl + 7.0
+  flres = fl - 7.0
+  flres = fl * 7.0
+  flres = fl / 7.0
 enddef
 
 def Test_disassemble_computing()
@@ -1783,24 +1779,22 @@ def Test_disassemble_computing()
         'anyres = g:number % 7.*' ..
         '\d OPANY %.*',
         instr)
-  if has('float')
-    assert_match('Computing.*' ..
-        'var fl = 3.0.*' ..
-        '\d PUSHF 3.0.*' ..
-        '\d STORE $3.*' ..
-        'var flres = fl + 7.0.*' ..
-        '\d LOAD $3.*' ..
-        '\d PUSHF 7.0.*' ..
-        '\d OPFLOAT +.*' ..
-        '\d STORE $4.*' ..
-        'flres = fl - 7.0.*' ..
-        '\d OPFLOAT -.*' ..
-        'flres = fl \* 7.0.*' ..
-        '\d OPFLOAT \*.*' ..
-        'flres = fl / 7.0.*' ..
-        '\d OPFLOAT /.*',
-        instr)
-  endif
+  assert_match('Computing.*' ..
+      'var fl = 3.0.*' ..
+      '\d PUSHF 3.0.*' ..
+      '\d STORE $3.*' ..
+      'var flres = fl + 7.0.*' ..
+      '\d LOAD $3.*' ..
+      '\d PUSHF 7.0.*' ..
+      '\d OPFLOAT +.*' ..
+      '\d STORE $4.*' ..
+      'flres = fl - 7.0.*' ..
+      '\d OPFLOAT -.*' ..
+      'flres = fl \* 7.0.*' ..
+      '\d OPFLOAT \*.*' ..
+      'flres = fl / 7.0.*' ..
+      '\d OPFLOAT /.*',
+      instr)
 enddef
 
 def s:AddListBlob()
@@ -2178,19 +2172,17 @@ def Test_disassemble_compare()
         ['77 isnot g:xx', 'COMPAREANY isnot'],
         ]
   var floatDecl = ''
-  if has('float')
-    cases->extend([
-        ['1.1 == aFloat', 'COMPAREFLOAT =='],
-        ['1.1 != aFloat', 'COMPAREFLOAT !='],
-        ['1.1 > aFloat', 'COMPAREFLOAT >'],
-        ['1.1 < aFloat', 'COMPAREFLOAT <'],
-        ['1.1 >= aFloat', 'COMPAREFLOAT >='],
-        ['1.1 <= aFloat', 'COMPAREFLOAT <='],
-        ['1.1 =~ aFloat', 'COMPAREFLOAT =\~'],
-        ['1.1 !~ aFloat', 'COMPAREFLOAT !\~'],
-        ])
-    floatDecl = 'var aFloat = 2.2'
-  endif
+  cases->extend([
+      ['1.1 == aFloat', 'COMPAREFLOAT =='],
+      ['1.1 != aFloat', 'COMPAREFLOAT !='],
+      ['1.1 > aFloat', 'COMPAREFLOAT >'],
+      ['1.1 < aFloat', 'COMPAREFLOAT <'],
+      ['1.1 >= aFloat', 'COMPAREFLOAT >='],
+      ['1.1 <= aFloat', 'COMPAREFLOAT <='],
+      ['1.1 =~ aFloat', 'COMPAREFLOAT =\~'],
+      ['1.1 !~ aFloat', 'COMPAREFLOAT !\~'],
+      ])
+  floatDecl = 'var aFloat = 2.2'
 
   var nr = 1
   for case in cases
index 9bb053fe7639b1197704f37270ef31b456ce6ead..44e221a90ffebc995dbb129f0e2b2b5a7039c2a6 100644 (file)
@@ -18,9 +18,7 @@ def Test_expr1_ternary()
       assert_equal('one', 1 ?
                             'one' :
                             'two')
-      if has('float')
-        assert_equal('one', !!0.1 ? 'one' : 'two')
-      endif
+      assert_equal('one', !!0.1 ? 'one' : 'two')
       assert_equal('one', !!'x' ? 'one' : 'two')
       assert_equal('one', !!'x'
                             ? 'one'
@@ -33,9 +31,7 @@ def Test_expr1_ternary()
 
       assert_equal('two', false ? 'one' : 'two')
       assert_equal('two', 0 ? 'one' : 'two')
-      if has('float')
-        assert_equal('two', !!0.0 ? 'one' : 'two')
-      endif
+      assert_equal('two', !!0.0 ? 'one' : 'two')
       assert_equal('two', !!'' ? 'one' : 'two')
       assert_equal('two', !!0z ? 'one' : 'two')
       assert_equal('two', !![] ? 'one' : 'two')
@@ -208,9 +204,7 @@ func Test_expr1_ternary_fails()
   call v9.CheckDefExecAndScriptFailure(["var x = true ? xxx : 'foo'"], ['E1001:', 'E121:'], 1)
   call v9.CheckDefExecAndScriptFailure(["var x = false ? 'foo' : xxx"], ['E1001:', 'E121:'], 1)
 
-  if has('float')
-    call v9.CheckDefAndScriptFailure(["var x = 0.1 ? 'one' : 'two'"], 'E805:', 1)
-  endif
+  call v9.CheckDefAndScriptFailure(["var x = 0.1 ? 'one' : 'two'"], 'E805:', 1)
 
   " missing argument detected even when common type is used
   call v9.CheckDefAndScriptFailure([
@@ -227,18 +221,14 @@ def Test_expr1_falsy()
       assert_equal('yes', 'yes' ?? 456)
       assert_equal([1], [1] ?? 456)
       assert_equal({one: 1}, {one: 1} ?? 456)
-      if has('float')
-        assert_equal(0.1, 0.1 ?? 456)
-      endif
+      assert_equal(0.1, 0.1 ?? 456)
 
       assert_equal(456, v:false ?? 456)
       assert_equal(456, 0 ?? 456)
       assert_equal(456, '' ?? 456)
       assert_equal(456, [] ?? 456)
       assert_equal(456, {} ?? 456)
-      if has('float')
-        assert_equal(456, 0.0 ?? 456)
-      endif
+      assert_equal(456, 0.0 ?? 456)
   END
   v9.CheckDefAndScriptSuccess(lines)
 
@@ -567,9 +557,7 @@ let anull = v:null
 let anint = 10
 let theone = 1
 let thefour = 4
-if has('float')
-  let afloat = 0.1
-endif
+let afloat = 0.1
 let astring = 'asdf'
 let ablob = 0z01ab
 let alist = [2, 3, 4]
@@ -605,20 +593,18 @@ def Test_expr4_equal()
       assert_equal(true, g:anint == 10)
       assert_equal(false, 61 == g:anint)
 
-      if has('float')
-        var ff = 0.3
-        assert_equal(true, ff == 0.3)
-        assert_equal(false, 0.4 == ff)
-        assert_equal(true, 0.1 == g:afloat)
-        assert_equal(false, g:afloat == 0.3)
-
-        ff = 3.0
-        assert_equal(true, ff == 3)
-        assert_equal(true, 3 == ff)
-        ff = 3.1
-        assert_equal(false, ff == 3)
-        assert_equal(false, 3 == ff)
-      endif
+      var ff = 0.3
+      assert_equal(true, ff == 0.3)
+      assert_equal(false, 0.4 == ff)
+      assert_equal(true, 0.1 == g:afloat)
+      assert_equal(false, g:afloat == 0.3)
+
+      ff = 3.0
+      assert_equal(true, ff == 3)
+      assert_equal(true, 3 == ff)
+      ff = 3.1
+      assert_equal(false, ff == 3)
+      assert_equal(false, 3 == ff)
 
       assert_equal(true, 'abc' == 'abc')
       assert_equal(false, 'xyz' == 'abc')
@@ -706,20 +692,18 @@ def Test_expr4_equal()
   v9.CheckScriptFailure(lines, 'E1030: Using a String as a Number: "3"')
   assert_true(g:notReached)
 
-  if has('float')
-    lines =<< trim END
-        vim9script
-        var n: any = 2.2
-        def Compare()
-          eval n == '3'
-          g:notReached = false
-        enddef
-        g:notReached = true
-        Compare()
-    END
-    v9.CheckScriptFailure(lines, 'E892: Using a String as a Float')
-    assert_true(g:notReached)
-  endif
+  lines =<< trim END
+      vim9script
+      var n: any = 2.2
+      def Compare()
+        eval n == '3'
+        g:notReached = false
+      enddef
+      g:notReached = true
+      Compare()
+  END
+  v9.CheckScriptFailure(lines, 'E892: Using a String as a Float')
+  assert_true(g:notReached)
 
   unlet g:notReached
 enddef
@@ -746,16 +730,14 @@ def Test_expr4_compare_null()
       assert_true(null != 123)
       assert_true(null != 0)
 
-      if has('float')
-        assert_false(12.3 == null)
-        assert_false(0.0 == null)
-        assert_false(null == 12.3)
-        assert_false(null == 0.0)
-        assert_true(12.3 != null)
-        assert_true(0.0 != null)
-        assert_true(null != 12.3)
-        assert_true(null != 0.0)
-      endif
+      assert_false(12.3 == null)
+      assert_false(0.0 == null)
+      assert_false(null == 12.3)
+      assert_false(null == 0.0)
+      assert_true(12.3 != null)
+      assert_true(0.0 != null)
+      assert_true(null != 12.3)
+      assert_true(null != 0.0)
 
       assert_true(test_null_blob() == v:null)
       assert_true(null_blob == null)
@@ -1077,20 +1059,18 @@ def Test_expr4_notequal()
       assert_equal(false, g:anint != 10)
       assert_equal(true, 61 != g:anint)
 
-      if has('float')
-        var ff = 0.3
-        assert_equal(false, 0.3 != ff)
-        assert_equal(true, 0.4 != ff)
-        assert_equal(false, 0.1 != g:afloat)
-        assert_equal(true, g:afloat != 0.3)
-
-        ff = 3.0
-        assert_equal(false, ff != 3)
-        assert_equal(false, 3 != ff)
-        ff = 3.1
-        assert_equal(true, ff != 3)
-        assert_equal(true, 3 != ff)
-      endif
+      var ff = 0.3
+      assert_equal(false, 0.3 != ff)
+      assert_equal(true, 0.4 != ff)
+      assert_equal(false, 0.1 != g:afloat)
+      assert_equal(true, g:afloat != 0.3)
+
+      ff = 3.0
+      assert_equal(false, ff != 3)
+      assert_equal(false, 3 != ff)
+      ff = 3.1
+      assert_equal(true, ff != 3)
+      assert_equal(true, 3 != ff)
 
       assert_equal(false, 'abc' != 'abc')
       assert_equal(true, 'xyz' != 'abc')
@@ -1149,13 +1129,11 @@ def Test_expr4_greater()
       assert_false(nr2 > 2)
       assert_false(nr2
                         > 3)
-      if has('float')
-        var ff = 2.0
-        assert_true(ff > 0.0)
-        assert_true(ff > 1.0)
-        assert_false(ff > 2.0)
-        assert_false(ff > 3.0)
-      endif
+      var ff = 2.0
+      assert_true(ff > 0.0)
+      assert_true(ff > 1.0)
+      assert_false(ff > 2.0)
+      assert_false(ff > 3.0)
   END
   v9.CheckDefAndScriptSuccess(lines)
 enddef
@@ -1171,12 +1149,10 @@ def Test_expr4_greaterequal()
       assert_true(nr2 >= 0)
       assert_true(nr2 >= 2)
       assert_false(nr2 >= 3)
-      if has('float')
-        var ff = 2.0
-        assert_true(ff >= 0.0)
-        assert_true(ff >= 2.0)
-        assert_false(ff >= 3.0)
-      endif
+      var ff = 2.0
+      assert_true(ff >= 0.0)
+      assert_true(ff >= 2.0)
+      assert_false(ff >= 3.0)
   END
   v9.CheckDefAndScriptSuccess(lines)
 enddef
@@ -1193,12 +1169,10 @@ def Test_expr4_smaller()
       assert_false(nr2 < 0)
       assert_false(nr2 < 2)
       assert_true(nr2 < 3)
-      if has('float')
-        var ff = 2.0
-        assert_false(ff < 0.0)
-        assert_false(ff < 2.0)
-        assert_true(ff < 3.0)
-      endif
+      var ff = 2.0
+      assert_false(ff < 0.0)
+      assert_false(ff < 2.0)
+      assert_true(ff < 3.0)
   END
   v9.CheckDefAndScriptSuccess(lines)
 enddef
@@ -1217,13 +1191,11 @@ def Test_expr4_smallerequal()
       assert_false(nr2 <= 1)
       assert_true(nr2 <= 2)
       assert_true(nr2 <= 3)
-      if has('float')
-        var ff = 2.0
-        assert_false(ff <= 0.0)
-        assert_false(ff <= 1.0)
-        assert_true(ff <= 2.0)
-        assert_true(ff <= 3.0)
-      endif
+      var ff = 2.0
+      assert_false(ff <= 0.0)
+      assert_false(ff <= 1.0)
+      assert_true(ff <= 2.0)
+      assert_true(ff <= 3.0)
   END
   v9.CheckDefAndScriptSuccess(lines)
 enddef
@@ -1456,10 +1428,8 @@ func Test_expr4_fails()
   call v9.CheckDefAndScriptFailure(["var x = v:none isnot v:null"], 'Cannot use "isnot" with special', 1)
   call v9.CheckDefAndScriptFailure(["var x = 123 is 123"], 'Cannot use "is" with number', 1)
   call v9.CheckDefAndScriptFailure(["var x = 123 isnot 123"], 'Cannot use "isnot" with number', 1)
-  if has('float')
-    call v9.CheckDefAndScriptFailure(["var x = 1.3 is 1.3"], 'Cannot use "is" with float', 1)
-    call v9.CheckDefAndScriptFailure(["var x = 1.3 isnot 1.3"], 'Cannot use "isnot" with float', 1)
-  endif
+  call v9.CheckDefAndScriptFailure(["var x = 1.3 is 1.3"], 'Cannot use "is" with float', 1)
+  call v9.CheckDefAndScriptFailure(["var x = 1.3 isnot 1.3"], 'Cannot use "isnot" with float', 1)
 
   call v9.CheckDefAndScriptFailure(["var x = 0za1 > 0z34"], 'Cannot compare blob with blob', 1)
   call v9.CheckDefAndScriptFailure(["var x = 0za1 >= 0z34"], 'Cannot compare blob with blob', 1)
@@ -1518,9 +1488,7 @@ def Test_expr6()
       assert_equal('afalse', 'a' .. false)
       assert_equal('anull', 'a' .. v:null)
       assert_equal('av:none', 'a' .. v:none)
-      if has('float')
-        assert_equal('a0.123', 'a' .. 0.123)
-      endif
+      assert_equal('a0.123', 'a' .. 0.123)
 
       assert_equal(3, 1 + [2, 3, 4][0])
       assert_equal(5, 2 + {key: 3}['key'])
@@ -1719,31 +1687,27 @@ def Test_expr6_vim9script_channel()
 enddef
 
 def Test_expr6_float()
-  if !has('float')
-    MissingFeature 'float'
-  else
-    var lines =<< trim END
-        assert_equal(66.0, 60.0 + 6.0)
-        assert_equal(66.0, 60.0 + 6)
-        assert_equal(66.0, 60 +
-                             6.0)
-        assert_equal(5.1, g:afloat
-                            + 5)
-        assert_equal(8.1, 8 + g:afloat)
-        assert_equal(10.1, g:anint + g:afloat)
-        assert_equal(10.1, g:afloat + g:anint)
-
-        assert_equal(54.0, 60.0 - 6.0)
-        assert_equal(54.0, 60.0
-                                - 6)
-        assert_equal(54.0, 60 - 6.0)
-        assert_equal(-4.9, g:afloat - 5)
-        assert_equal(7.9, 8 - g:afloat)
-        assert_equal(9.9, g:anint - g:afloat)
-        assert_equal(-9.9, g:afloat - g:anint)
-    END
-    v9.CheckDefAndScriptSuccess(lines)
-  endif
+  var lines =<< trim END
+      assert_equal(66.0, 60.0 + 6.0)
+      assert_equal(66.0, 60.0 + 6)
+      assert_equal(66.0, 60 +
+                           6.0)
+      assert_equal(5.1, g:afloat
+                          + 5)
+      assert_equal(8.1, 8 + g:afloat)
+      assert_equal(10.1, g:anint + g:afloat)
+      assert_equal(10.1, g:afloat + g:anint)
+
+      assert_equal(54.0, 60.0 - 6.0)
+      assert_equal(54.0, 60.0
+                              - 6)
+      assert_equal(54.0, 60 - 6.0)
+      assert_equal(-4.9, g:afloat - 5)
+      assert_equal(7.9, 8 - g:afloat)
+      assert_equal(9.9, g:anint - g:afloat)
+      assert_equal(-9.9, g:afloat - g:anint)
+  END
+  v9.CheckDefAndScriptSuccess(lines)
 enddef
 
 func Test_expr6_fails()
@@ -1852,14 +1816,12 @@ def Test_expr7()
       var y = [3]
       assert_equal(5, x[0] + y[0])
       assert_equal(6, x[0] * y[0])
-      if has('float')
-        var xf = [2.0]
-        var yf = [3.0]
-        assert_equal(5.0, xf[0]
-                            + yf[0])
-        assert_equal(6.0, xf[0]
-                            * yf[0])
-      endif
+      var xf = [2.0]
+      var yf = [3.0]
+      assert_equal(5.0, xf[0]
+                          + yf[0])
+      assert_equal(6.0, xf[0]
+                          * yf[0])
   END
   v9.CheckDefAndScriptSuccess(lines)
 
@@ -1874,13 +1836,11 @@ def Test_expr7()
   v9.CheckDefExecFailure(['echo 123 / g:zero'], 'E1154: Divide by zero')
   v9.CheckDefExecFailure(['echo 123 % g:zero'], 'E1154: Divide by zero')
 
-  if has('float')
-    v9.CheckDefExecAndScriptFailure([
-          'g:one = 1.0',
-          'g:two = 2.0',
-          'echo g:one % g:two',
-          ], 'E804', 3)
-  endif
+  v9.CheckDefExecAndScriptFailure([
+        'g:one = 1.0',
+        'g:two = 2.0',
+        'echo g:one % g:two',
+        ], 'E804', 3)
 
   lines =<< trim END
     var n = 0
@@ -1948,36 +1908,32 @@ def Test_expr7_vim9script()
 enddef
 
 def Test_expr7_float()
-  if !has('float')
-    MissingFeature 'float'
-  else
-    var lines =<< trim END
-        assert_equal(36.0, 6.0 * 6)
-        assert_equal(36.0, 6 *
-                               6.0)
-        assert_equal(36.0, 6.0 * 6.0)
-        assert_equal(1.0, g:afloat * g:anint)
-
-        assert_equal(10.0, 60 / 6.0)
-        assert_equal(10.0, 60.0 /
-                            6)
-        assert_equal(10.0, 60.0 / 6.0)
-        assert_equal(0.01, g:afloat / g:anint)
-
-        assert_equal(4.0, 6.0 * 4 / 6)
-        assert_equal(4.0, 6 *
-                            4.0 /
-                            6)
-        assert_equal(4.0, 6 * 4 / 6.0)
-        assert_equal(4.0, 6.0 * 4.0 / 6)
-        assert_equal(4.0, 6 * 4.0 / 6.0)
-        assert_equal(4.0, 6.0 * 4 / 6.0)
-        assert_equal(4.0, 6.0 * 4.0 / 6.0)
-
-        assert_equal(4.0, 6.0 * 4.0 / 6.0)
-    END
-    v9.CheckDefAndScriptSuccess(lines)
-  endif
+  var lines =<< trim END
+      assert_equal(36.0, 6.0 * 6)
+      assert_equal(36.0, 6 *
+                             6.0)
+      assert_equal(36.0, 6.0 * 6.0)
+      assert_equal(1.0, g:afloat * g:anint)
+
+      assert_equal(10.0, 60 / 6.0)
+      assert_equal(10.0, 60.0 /
+                          6)
+      assert_equal(10.0, 60.0 / 6.0)
+      assert_equal(0.01, g:afloat / g:anint)
+
+      assert_equal(4.0, 6.0 * 4 / 6)
+      assert_equal(4.0, 6 *
+                          4.0 /
+                          6)
+      assert_equal(4.0, 6 * 4 / 6.0)
+      assert_equal(4.0, 6.0 * 4.0 / 6)
+      assert_equal(4.0, 6 * 4.0 / 6.0)
+      assert_equal(4.0, 6.0 * 4 / 6.0)
+      assert_equal(4.0, 6.0 * 4.0 / 6.0)
+
+      assert_equal(4.0, 6.0 * 4.0 / 6.0)
+  END
+  v9.CheckDefAndScriptSuccess(lines)
 enddef
 
 func Test_expr7_fails()
@@ -2013,9 +1969,7 @@ func Test_expr7_fails()
   call v9.CheckDefAndScriptFailure(["var x = {one: 1} % {two: 2}"], ['E1035:', 'E728:'], 1)
 
   call v9.CheckDefAndScriptFailure(["var x = 0xff[1]"], ['E1107:', 'E1062:'], 1)
-  if has('float')
-    call v9.CheckDefAndScriptFailure(["var x = 0.7[1]"], ['E1107:', 'E806:'], 1)
-  endif
+  call v9.CheckDefAndScriptFailure(["var x = 0.7[1]"], ['E1107:', 'E806:'], 1)
 
   for op in ['*', '/', '%']
     let lines = ['var x = 1', op .. '2', '# comment']
@@ -2025,16 +1979,14 @@ func Test_expr7_fails()
 endfunc
 
 func Test_expr7_float_fails()
-  CheckFeature float
   call v9.CheckDefAndScriptFailure(["var x = 1.0 % 2"], ['E1035:', 'E804:'], 1)
 endfunc
 
 " define here to use old style parsing
-if has('float')
-  let g:float_zero = 0.0
-  let g:float_neg = -9.8
-  let g:float_big = 9.9e99
-endif
+let g:float_zero = 0.0
+let g:float_neg = -9.8
+let g:float_big = 9.9e99
+
 let g:blob_empty = 0z
 let g:blob_one = 0z01
 let g:blob_long = 0z0102.0304
@@ -2099,17 +2051,13 @@ enddef
 
 def Test_expr9_float()
   # float constant
-  if !has('float')
-    MissingFeature 'float'
-  else
-    var lines =<< trim END
-        assert_equal(g:float_zero, .0)
-        assert_equal(g:float_zero, 0.0)
-        assert_equal(g:float_neg, -9.8)
-        assert_equal(g:float_big, 9.9e99)
-    END
-    v9.CheckDefAndScriptSuccess(lines)
-  endif
+  var lines =<< trim END
+      assert_equal(g:float_zero, .0)
+      assert_equal(g:float_zero, 0.0)
+      assert_equal(g:float_neg, -9.8)
+      assert_equal(g:float_big, 9.9e99)
+  END
+  v9.CheckDefAndScriptSuccess(lines)
 enddef
 
 def Test_expr9_blob()
@@ -2797,11 +2745,9 @@ def Test_expr9_dict()
       assert_equal('numberexpr', dkeys[12])
       assert_equal('number', dkeys[34])
       assert_equal('bool', dkeys[true])
-      if has('float')
-        dkeys = {[1.2]: 'floatexpr', [3.4]: 'float'}
-        assert_equal('floatexpr', dkeys[1.2])
-        assert_equal('float', dkeys[3.4])
-      endif
+      dkeys = {[1.2]: 'floatexpr', [3.4]: 'float'}
+      assert_equal('floatexpr', dkeys[1.2])
+      assert_equal('float', dkeys[3.4])
 
       # automatic conversion from number to string
       var n = 123
index 07dc59d15a13b53b82c87a9ded381eb77518bcae..641ef73687021d056adfbd83c4026a5bea9ad40c 100644 (file)
@@ -6490,9 +6490,7 @@ func Test_type()
     call assert_equal(2, type(function("tr", [8])))
     call assert_equal(3, type([]))
     call assert_equal(4, type({}))
-    if has('float')
-      call assert_equal(5, type(0.0))
-    endif
+    call assert_equal(5, type(0.0))
     call assert_equal(6, type(v:false))
     call assert_equal(6, type(v:true))
     call assert_equal(7, type(v:none))
@@ -6505,9 +6503,7 @@ func Test_type()
     call assert_equal(v:t_func, type(function("tr", [8])))
     call assert_equal(v:t_list, type([]))
     call assert_equal(v:t_dict, type({}))
-    if has('float')
-      call assert_equal(v:t_float, type(0.0))
-    endif
+    call assert_equal(v:t_float, type(0.0))
     call assert_equal(v:t_bool, type(v:false))
     call assert_equal(v:t_bool, type(v:true))
     call assert_equal(v:t_none, type(v:none))
@@ -6551,11 +6547,9 @@ func Test_type()
     call assert_true(v:none == 0)
     call assert_false(v:none == 1)
     call assert_false(v:none != 0)
-    if has('float')
-      call assert_true(v:null == 0.0)
-      call assert_false(v:null == 0.1)
-      call assert_false(v:null != 0.0)
-    endif
+    call assert_true(v:null == 0.0)
+    call assert_false(v:null == 0.1)
+    call assert_false(v:null != 0.0)
 
     call assert_true(v:false is v:false)
     call assert_true(v:true is v:true)
@@ -6670,16 +6664,14 @@ func Test_echo_and_string()
                     \ "'foo bar'"], l)
 
     " Float
-    if has('float')
-       let a = -1.2e0
-       redir => result
-       echo a
-       echo string(a)
-       redir END
-       let l = split(result, "\n")
-       call assert_equal(["-1.2",
-                        \ "-1.2"], l)
-    endif
+    let a = -1.2e0
+    redir => result
+    echo a
+    echo string(a)
+    redir END
+    let l = split(result, "\n")
+    call assert_equal(["-1.2",
+                     \ "-1.2"], l)
 
     " Funcref
     redir => result
@@ -6816,10 +6808,8 @@ func Test_num64()
     call assert_equal(-9223372036854775807, -1 / 0)
     call assert_equal(-9223372036854775807 - 1,  0 / 0)
 
-    if has('float')
-      call assert_equal( 0x7FFFffffFFFFffff, float2nr( 1.0e150))
-      call assert_equal(-0x7FFFffffFFFFffff, float2nr(-1.0e150))
-    endif
+    call assert_equal( 0x7FFFffffFFFFffff, float2nr( 1.0e150))
+    call assert_equal(-0x7FFFffffFFFFffff, float2nr(-1.0e150))
 
     let rng = range(0xFFFFffff, 0x100000001)
     call assert_equal([0xFFFFffff, 0x100000000, 0x100000001], rng)
@@ -6921,10 +6911,8 @@ func Test_bitwise_functions()
     call assert_equal(0, and(127, 128))
     call assert_fails("call and([], 1)", 'E745:')
     call assert_fails("call and({}, 1)", 'E728:')
-    if has('float')
-      call assert_fails("call and(1.0, 1)", 'E805:')
-      call assert_fails("call and(1, 1.0)", 'E805:')
-    endif
+    call assert_fails("call and(1.0, 1)", 'E805:')
+    call assert_fails("call and(1, 1.0)", 'E805:')
     call assert_fails("call and(1, [])", 'E745:')
     call assert_fails("call and(1, {})", 'E728:')
     " or
@@ -6934,10 +6922,8 @@ func Test_bitwise_functions()
     call assert_equal(123, or(0, 123))
     call assert_fails("call or([], 1)", 'E745:')
     call assert_fails("call or({}, 1)", 'E728:')
-    if has('float')
-      call assert_fails("call or(1.0, 1)", 'E805:')
-      call assert_fails("call or(1, 1.0)", 'E805:')
-    endif
+    call assert_fails("call or(1.0, 1)", 'E805:')
+    call assert_fails("call or(1, 1.0)", 'E805:')
     call assert_fails("call or(1, [])", 'E745:')
     call assert_fails("call or(1, {})", 'E728:')
     " xor
@@ -6945,10 +6931,8 @@ func Test_bitwise_functions()
     call assert_equal(111, xor(127, 16))
     eval 127->xor(16)->assert_equal(111)
     call assert_equal(255, xor(127, 128))
-    if has('float')
-      call assert_fails("call xor(1.0, 1)", 'E805:')
-      call assert_fails("call xor(1, 1.0)", 'E805:')
-    endif
+    call assert_fails("call xor(1.0, 1)", 'E805:')
+    call assert_fails("call xor(1, 1.0)", 'E805:')
     call assert_fails("call xor([], 1)", 'E745:')
     call assert_fails("call xor({}, 1)", 'E728:')
     call assert_fails("call xor(1, [])", 'E745:')
@@ -6958,9 +6942,7 @@ func Test_bitwise_functions()
     eval 127->invert()->and(65535)->assert_equal(65408)
     call assert_equal(65519, and(invert(16), 65535))
     call assert_equal(65407, and(invert(128), 65535))
-    if has('float')
-      call assert_fails("call invert(1.0)", 'E805:')
-    endif
+    call assert_fails("call invert(1.0)", 'E805:')
     call assert_fails("call invert([])", 'E745:')
     call assert_fails("call invert({})", 'E728:')
 endfunc
@@ -7039,38 +7021,36 @@ func Test_compound_assignment_operators()
     let x += 1
     call assert_equal(1, x)
 
-    if has('float')
-      " Test for float
-      let x -= 1.5
-      call assert_equal(-0.5, x)
-      let x = 0.5
-      let x += 4.5
-      call assert_equal(5.0, x)
-      let x -= 1.5
-      call assert_equal(3.5, x)
-      let x *= 3.0
-      call assert_equal(10.5, x)
-      let x /= 2.5
-      call assert_equal(4.2, x)
-      call assert_fails('let x %= 0.5', 'E734:')
-      call assert_fails('let x .= "f"', 'E734:')
-      let x = !3.14
-      call assert_equal(0.0, x)
-
-      " integer and float operations
-      let x = 1
-      let x *= 2.1
-      call assert_equal(2.1, x)
-      let x = 1
-      let x /= 0.25
-      call assert_equal(4.0, x)
-      let x = 1
-      call assert_fails('let x %= 0.25', 'E734:')
-      let x = 1
-      call assert_fails('let x .= 0.25', 'E734:')
-      let x = 1.0
-      call assert_fails('let x += [1.1]', 'E734:')
-    endif
+    " Test for float
+    let x -= 1.5
+    call assert_equal(-0.5, x)
+    let x = 0.5
+    let x += 4.5
+    call assert_equal(5.0, x)
+    let x -= 1.5
+    call assert_equal(3.5, x)
+    let x *= 3.0
+    call assert_equal(10.5, x)
+    let x /= 2.5
+    call assert_equal(4.2, x)
+    call assert_fails('let x %= 0.5', 'E734:')
+    call assert_fails('let x .= "f"', 'E734:')
+    let x = !3.14
+    call assert_equal(0.0, x)
+
+    " integer and float operations
+    let x = 1
+    let x *= 2.1
+    call assert_equal(2.1, x)
+    let x = 1
+    let x /= 0.25
+    call assert_equal(4.0, x)
+    let x = 1
+    call assert_fails('let x %= 0.25', 'E734:')
+    let x = 1
+    call assert_fails('let x .= 0.25', 'E734:')
+    let x = 1.0
+    call assert_fails('let x += [1.1]', 'E734:')
 
     " Test for environment variable
     let $FOO = 1
@@ -7142,9 +7122,7 @@ func Test_refcount()
     call assert_equal(0, test_refcount({}))
     call assert_equal(0, test_refcount(0zff))
     call assert_equal(0, test_refcount({-> line('.')}))
-    if has('float')
-        call assert_equal(-1, test_refcount(0.1))
-    endif
+    call assert_equal(-1, test_refcount(0.1))
     if has('job')
         call assert_equal(0, test_refcount(job_start([&shell, &shellcmdflag, 'echo .'])))
     endif
@@ -7156,10 +7134,8 @@ func Test_refcount()
     call assert_equal(-1, test_refcount(x))
     let x = v:true
     call assert_equal(-1, test_refcount(x))
-    if has('float')
-        let x = 0.1
-        call assert_equal(-1, test_refcount(x))
-    endif
+    let x = 0.1
+    call assert_equal(-1, test_refcount(x))
 
     " Check refcount
     let x = []
@@ -7377,16 +7353,14 @@ endfunc
 
 " Test for errors in converting to float from various types         {{{1
 func Test_float_conversion_errors()
-  if has('float')
-    call assert_fails('let x = 4.0 % 2.0', 'E804:')
-    call assert_fails('echo 1.1[0]', 'E806:')
-    call assert_fails('echo sort([function("min"), 1], "f")', 'E891:')
-    call assert_fails('echo 3.2 == "vim"', 'E892:')
-    call assert_fails('echo sort([[], 1], "f")', 'E893:')
-    call assert_fails('echo sort([{}, 1], "f")', 'E894:')
-    call assert_fails('echo 3.2 == v:true', 'E362:')
-    call assert_fails('echo 3.2 == v:none', 'E907:')
-  endif
+  call assert_fails('let x = 4.0 % 2.0', 'E804:')
+  call assert_fails('echo 1.1[0]', 'E806:')
+  call assert_fails('echo sort([function("min"), 1], "f")', 'E891:')
+  call assert_fails('echo 3.2 == "vim"', 'E892:')
+  call assert_fails('echo sort([[], 1], "f")', 'E893:')
+  call assert_fails('echo sort([{}, 1], "f")', 'E894:')
+  call assert_fails('echo 3.2 == v:true', 'E362:')
+  call assert_fails('echo 3.2 == v:none', 'E907:')
 endfunc
 
 " invalid function names               {{{1
index fb5c9ab4cc49c6a85320f1188ae956fc1702ec37..7bb14e1b57f0101a6509f8c992e17f449c711bb2 100644 (file)
@@ -787,7 +787,6 @@ assert_inrange(typval_T *argvars)
     char       msg[200];
     char_u     numbuf[NUMBUFLEN];
 
-#ifdef FEAT_FLOAT
     if (argvars[0].v_type == VAR_FLOAT
            || argvars[1].v_type == VAR_FLOAT
            || argvars[2].v_type == VAR_FLOAT)
@@ -816,7 +815,6 @@ assert_inrange(typval_T *argvars)
        }
     }
     else
-#endif
     {
        varnumber_T     lower = tv_get_number_chk(&argvars[0], &error);
        varnumber_T     upper = tv_get_number_chk(&argvars[1], &error);
index 58337c9f65a21e71fba4f0f3577ead69dd5e79b3..901222c195822fe97d7fbc505d03be3136969721 100644 (file)
@@ -221,20 +221,19 @@ f_reltime(typval_T *argvars UNUSED, typval_T *rettv UNUSED)
 # endif
 }
 
-# ifdef FEAT_FLOAT
 /*
  * "reltimefloat()" function
  */
     void
 f_reltimefloat(typval_T *argvars UNUSED, typval_T *rettv)
 {
-#  ifdef FEAT_RELTIME
+# ifdef FEAT_RELTIME
     proftime_T tm;
-#  endif
+# endif
 
     rettv->v_type = VAR_FLOAT;
     rettv->vval.v_float = 0;
-#  ifdef FEAT_RELTIME
+# ifdef FEAT_RELTIME
     if (in_vim9script() && check_for_list_arg(argvars, 0) == FAIL)
        return;
 
@@ -242,9 +241,8 @@ f_reltimefloat(typval_T *argvars UNUSED, typval_T *rettv)
        rettv->vval.v_float = profile_float(&tm);
     else if (in_vim9script())
        emsg(_(e_invalid_argument));
-#  endif
-}
 # endif
+}
 
 /*
  * "reltimestr()" function
index 9bcc7818848292a5810242d320e2809f43cf4f1e..a4fdb782f1e6fef272d495f9e5dec6039c616e2e 100644 (file)
@@ -136,10 +136,8 @@ clear_tv(typval_T *varp)
                varp->vval.v_number = 0;
                break;
            case VAR_FLOAT:
-#ifdef FEAT_FLOAT
                varp->vval.v_float = 0.0;
                break;
-#endif
            case VAR_JOB:
 #ifdef FEAT_JOB_CHANNEL
                job_unref(varp->vval.v_job);
@@ -190,10 +188,8 @@ tv_get_bool_or_number_chk(typval_T *varp, int *denote, int want_bool)
            }
            return varp->vval.v_number;
        case VAR_FLOAT:
-#ifdef FEAT_FLOAT
            emsg(_(e_using_float_as_number));
            break;
-#endif
        case VAR_FUNC:
        case VAR_PARTIAL:
            emsg(_(e_using_funcref_as_number));
@@ -296,7 +292,6 @@ tv_get_bool_chk(typval_T *varp, int *denote)
     return tv_get_bool_or_number_chk(varp, denote, TRUE);
 }
 
-#if defined(FEAT_FLOAT) || defined(PROTO)
     static float_T
 tv_get_float_chk(typval_T *varp, int *error)
 {
@@ -357,7 +352,6 @@ tv_get_float(typval_T *varp)
 {
     return tv_get_float_chk(varp, NULL);
 }
-#endif
 
 /*
  * Give an error and return FAIL unless "args[idx]" is unknown
@@ -1007,7 +1001,6 @@ tv_get_string_buf_chk_strict(typval_T *varp, char_u *buf, int strict)
            emsg(_(e_using_dictionary_as_string));
            break;
        case VAR_FLOAT:
-#ifdef FEAT_FLOAT
            if (strict)
            {
                emsg(_(e_using_float_as_string));
@@ -1015,7 +1008,6 @@ tv_get_string_buf_chk_strict(typval_T *varp, char_u *buf, int strict)
            }
            vim_snprintf((char *)buf, NUMBUFLEN, "%g", varp->vval.v_float);
            return buf;
-#endif
        case VAR_STRING:
            if (varp->vval.v_string != NULL)
                return varp->vval.v_string;
@@ -1136,10 +1128,8 @@ copy_tv(typval_T *from, typval_T *to)
            to->vval.v_number = from->vval.v_number;
            break;
        case VAR_FLOAT:
-#ifdef FEAT_FLOAT
            to->vval.v_float = from->vval.v_float;
            break;
-#endif
        case VAR_JOB:
 #ifdef FEAT_JOB_CHANNEL
            to->vval.v_job = from->vval.v_job;
@@ -1289,7 +1279,6 @@ typval_compare(
        n1 = res;
     }
 
-#ifdef FEAT_FLOAT
     // If one of the two variables is a float, compare as a float.
     // When using "=~" or "!~", always compare as string.
     else if ((tv1->v_type == VAR_FLOAT || tv2->v_type == VAR_FLOAT)
@@ -1322,7 +1311,6 @@ typval_compare(
            default:  break;  // avoid gcc warning
        }
     }
-#endif
 
     // If one of the two variables is a number, compare as a number.
     // When using "=~" or "!~", always compare as string.
@@ -1489,11 +1477,9 @@ typval_compare_null(typval_T *tv1, typval_T *tv2)
            case VAR_NUMBER: if (!in_vim9script())
                                 return tv->vval.v_number == 0;
                             break;
-#ifdef FEAT_FLOAT
            case VAR_FLOAT: if (!in_vim9script())
                                 return tv->vval.v_float == 0.0;
                             break;
-#endif
            default: break;
        }
     }
@@ -1870,9 +1856,7 @@ tv_equal(
            return ((ic ? MB_STRICMP(s1, s2) : STRCMP(s1, s2)) == 0);
 
        case VAR_FLOAT:
-#ifdef FEAT_FLOAT
            return tv1->vval.v_float == tv2->vval.v_float;
-#endif
        case VAR_JOB:
 #ifdef FEAT_JOB_CHANNEL
            return tv1->vval.v_job == tv2->vval.v_job;
@@ -2005,7 +1989,6 @@ eval_number(
 {
     int                len;
     int                skip_quotes = !in_old_script(4);
-#ifdef FEAT_FLOAT
     char_u     *p;
     int                get_float = FALSE;
 
@@ -2062,7 +2045,6 @@ eval_number(
        }
     }
     else
-#endif
     if (**arg == '0' && ((*arg)[1] == 'z' || (*arg)[1] == 'Z'))
     {
        char_u  *bp;
index 7d7ac1654e776c1b05711cdbcb5b545d84d3fb8a..15c94041333905c37d7a98dff102fb8b8f0818d9 100644 (file)
@@ -244,11 +244,7 @@ static char *(features[]) =
 #else
        "-find_in_path",
 #endif
-#ifdef FEAT_FLOAT
        "+float",
-#else
-       "-float",
-#endif
 #ifdef FEAT_FOLDING
        "+folding",
 #else
@@ -703,6 +699,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    491,
 /**/
     490,
 /**/
index 862d8c5fbe8193363849dbd782a7fbc54333ccd5..abcf64f94569e443252c1069d5df6fdf19125481 100644 (file)
@@ -469,9 +469,7 @@ struct isn_S {
        varnumber_T         number;
        blob_T              *blob;
        vartype_T           vartype;
-#ifdef FEAT_FLOAT
        float_T             fnumber;
-#endif
        channel_T           *channel;
        job_T               *job;
        partial_T           *partial;
index 1a1190e4b6218d891611a7d09fcfc977817cf0ef..4890de34610e7d5f8bfe6f3ce7ab518b61ceb288 100644 (file)
@@ -2384,9 +2384,7 @@ compile_assignment(char_u *arg, exarg_T *eap, cmdidx_T cmdidx, cctx_T *cctx)
                        r = generate_PUSHBOOL(cctx, VVAL_FALSE);
                        break;
                    case VAR_FLOAT:
-#ifdef FEAT_FLOAT
                        r = generate_PUSHF(cctx, 0.0);
-#endif
                        break;
                    case VAR_STRING:
                        r = generate_PUSHS(cctx, NULL);
@@ -2455,11 +2453,9 @@ compile_assignment(char_u *arg, exarg_T *eap, cmdidx_T cmdidx, cctx_T *cctx)
                expected = lhs.lhs_member_type;
                stacktype = get_type_on_stack(cctx, 0);
                if (
-#ifdef FEAT_FLOAT
                    // If variable is float operation with number is OK.
                    !(expected == &t_float && (stacktype == &t_number
                            || stacktype == &t_number_bool)) &&
-#endif
                    need_type(stacktype, expected, -1, 0, cctx,
                                                         FALSE, FALSE) == FAIL)
                    goto theend;
index 1d30045df8c4b21e22ca8cb6db94d0fbecc0dfc8..b6252612a0c06c815cc944f827af0757dbb1e658 100644 (file)
@@ -3872,12 +3872,10 @@ exec_instructions(ectx_T *ectx)
                        tv->v_type = VAR_SPECIAL;
                        tv->vval.v_number = iptr->isn_arg.number;
                        break;
-#ifdef FEAT_FLOAT
                    case ISN_PUSHF:
                        tv->v_type = VAR_FLOAT;
                        tv->vval.v_float = iptr->isn_arg.fnumber;
                        break;
-#endif
                    case ISN_PUSHBLOB:
                        blob_copy(iptr->isn_arg.blob, tv);
                        break;
@@ -4569,7 +4567,6 @@ exec_instructions(ectx_T *ectx)
            // Computation with two float arguments
            case ISN_OPFLOAT:
            case ISN_COMPAREFLOAT:
-#ifdef FEAT_FLOAT
                {
                    typval_T    *tv1 = STACK_TV_BOT(-2);
                    typval_T    *tv2 = STACK_TV_BOT(-1);
@@ -4602,7 +4599,6 @@ exec_instructions(ectx_T *ectx)
                    else
                        tv1->vval.v_float = res;
                }
-#endif
                break;
 
            case ISN_COMPARELIST:
@@ -4744,9 +4740,7 @@ exec_instructions(ectx_T *ectx)
                    typval_T    *tv1 = STACK_TV_BOT(-2);
                    typval_T    *tv2 = STACK_TV_BOT(-1);
                    varnumber_T n1, n2;
-#ifdef FEAT_FLOAT
                    float_T     f1 = 0, f2 = 0;
-#endif
                    int         error = FALSE;
 
                    if (iptr->isn_arg.op.op_type == EXPR_ADD)
@@ -4767,42 +4761,33 @@ exec_instructions(ectx_T *ectx)
                            break;
                        }
                    }
-#ifdef FEAT_FLOAT
                    if (tv1->v_type == VAR_FLOAT)
                    {
                        f1 = tv1->vval.v_float;
                        n1 = 0;
                    }
                    else
-#endif
                    {
                        SOURCING_LNUM = iptr->isn_lnum;
                        n1 = tv_get_number_chk(tv1, &error);
                        if (error)
                            goto on_error;
-#ifdef FEAT_FLOAT
                        if (tv2->v_type == VAR_FLOAT)
                            f1 = n1;
-#endif
                    }
-#ifdef FEAT_FLOAT
                    if (tv2->v_type == VAR_FLOAT)
                    {
                        f2 = tv2->vval.v_float;
                        n2 = 0;
                    }
                    else
-#endif
                    {
                        n2 = tv_get_number_chk(tv2, &error);
                        if (error)
                            goto on_error;
-#ifdef FEAT_FLOAT
                        if (tv1->v_type == VAR_FLOAT)
                            f2 = n2;
-#endif
                    }
-#ifdef FEAT_FLOAT
                    // if there is a float on either side the result is a float
                    if (tv1->v_type == VAR_FLOAT || tv2->v_type == VAR_FLOAT)
                    {
@@ -4823,7 +4808,6 @@ exec_instructions(ectx_T *ectx)
                        --ectx->ec_stack.ga_len;
                    }
                    else
-#endif
                    {
                        int failed = FALSE;
 
@@ -5110,11 +5094,9 @@ exec_instructions(ectx_T *ectx)
            case ISN_NEGATENR:
                tv = STACK_TV_BOT(-1);
                // CHECKTYPE should have checked the variable type
-#ifdef FEAT_FLOAT
                if (tv->v_type == VAR_FLOAT)
                    tv->vval.v_float = -tv->vval.v_float;
                else
-#endif
                    tv->vval.v_number = -tv->vval.v_number;
                break;
 
@@ -6279,9 +6261,7 @@ list_instructions(char *pfx, isn_T *instr, int instr_count, ufunc_T *ufunc)
                                   get_var_special_name(iptr->isn_arg.number));
                break;
            case ISN_PUSHF:
-#ifdef FEAT_FLOAT
                smsg("%s%4d PUSHF %g", pfx, current, iptr->isn_arg.fnumber);
-#endif
                break;
            case ISN_PUSHS:
                smsg("%s%4d PUSHS \"%s\"", pfx, current, iptr->isn_arg.string);
@@ -6896,11 +6876,7 @@ tv2bool(typval_T *tv)
        case VAR_NUMBER:
            return tv->vval.v_number != 0;
        case VAR_FLOAT:
-#ifdef FEAT_FLOAT
            return tv->vval.v_float != 0.0;
-#else
-           break;
-#endif
        case VAR_PARTIAL:
            return tv->vval.v_partial != NULL;
        case VAR_FUNC:
index 4406ac47e6610697957a3440b47daa88d8e12f89..5f1e07d828a5196e2722b6e61c47ee76430edc05 100644 (file)
@@ -1488,14 +1488,12 @@ apply_leader(typval_T *rettv, int numeric_only, char_u *start, char_u **end)
        if (*p == '-' || *p == '+')
        {
            // only '-' has an effect, for '+' we only check the type
-#ifdef FEAT_FLOAT
            if (rettv->v_type == VAR_FLOAT)
            {
                if (*p == '-')
                    rettv->vval.v_float = -rettv->vval.v_float;
            }
            else
-#endif
            {
                varnumber_T     val;
                int             error = FALSE;
index 11e39f131ba4151c69abf43ad3a9d64e18881022..edc6cb61d7672e1146282b91669f5df31c1fed1b 100644 (file)
@@ -208,9 +208,7 @@ generate_add_instr(
                      vartype == VAR_NUMBER ? ISN_OPNR
                    : vartype == VAR_LIST ? ISN_ADDLIST
                    : vartype == VAR_BLOB ? ISN_ADDBLOB
-#ifdef FEAT_FLOAT
                    : vartype == VAR_FLOAT ? ISN_OPFLOAT
-#endif
                    : ISN_OPANY, 1);
 
     if (vartype != VAR_LIST && vartype != VAR_BLOB
@@ -251,9 +249,7 @@ operator_type(type_T *type1, type_T *type2)
     if (type1->tt_type == type2->tt_type
            && (type1->tt_type == VAR_NUMBER
                || type1->tt_type == VAR_LIST
-#ifdef FEAT_FLOAT
                || type1->tt_type == VAR_FLOAT
-#endif
                || type1->tt_type == VAR_BLOB))
        return type1->tt_type;
     return VAR_ANY;
@@ -293,10 +289,8 @@ generate_two_op(cctx_T *cctx, char_u *op)
                      return FAIL;
                  if (vartype == VAR_NUMBER)
                      isn = generate_instr_drop(cctx, ISN_OPNR, 1);
-#ifdef FEAT_FLOAT
                  else if (vartype == VAR_FLOAT)
                      isn = generate_instr_drop(cctx, ISN_OPFLOAT, 1);
-#endif
                  else
                      isn = generate_instr_drop(cctx, ISN_OPANY, 1);
                  if (isn != NULL)
@@ -326,12 +320,10 @@ generate_two_op(cctx_T *cctx, char_u *op)
     {
        type_T *type = &t_any;
 
-#ifdef FEAT_FLOAT
        // float+number and number+float results in float
        if ((type1->tt_type == VAR_NUMBER || type1->tt_type == VAR_FLOAT)
-               && (type2->tt_type == VAR_NUMBER || type2->tt_type == VAR_FLOAT))
+             && (type2->tt_type == VAR_NUMBER || type2->tt_type == VAR_FLOAT))
            type = &t_float;
-#endif
        set_type_on_stack(cctx, type, 0);
     }
 
@@ -580,11 +572,9 @@ generate_tv_PUSH(cctx_T *cctx, typval_T *tv)
        case VAR_NUMBER:
            generate_PUSHNR(cctx, tv->vval.v_number);
            break;
-#ifdef FEAT_FLOAT
        case VAR_FLOAT:
            generate_PUSHF(cctx, tv->vval.v_float);
            break;
-#endif
        case VAR_BLOB:
            generate_PUSHBLOB(cctx, tv->vval.v_blob);
            tv->vval.v_blob = NULL;
@@ -688,7 +678,6 @@ generate_PUSHSPEC(cctx_T *cctx, varnumber_T number)
     return OK;
 }
 
-#if defined(FEAT_FLOAT) || defined(PROTO)
 /*
  * Generate an ISN_PUSHF instruction.
  */
@@ -704,7 +693,6 @@ generate_PUSHF(cctx_T *cctx, float_T fnumber)
 
     return OK;
 }
-#endif
 
 /*
  * Generate an ISN_PUSHS instruction.
index 4484abae903e2f87806c0d76c03d802b4a83ed2d..843e5abd83b97638ef139eb1cf74c9bb79a83cf5 100644 (file)
@@ -985,14 +985,8 @@ parse_type(char_u **arg, garray_T *type_gap, int give_error)
        case 'f':
            if (len == 5 && STRNCMP(*arg, "float", len) == 0)
            {
-#ifdef FEAT_FLOAT
                *arg += len;
                return &t_float;
-#else
-               if (give_error)
-                   emsg(_(e_this_vim_is_not_compiled_with_float_support));
-               return NULL;
-#endif
            }
            if (len == 4 && STRNCMP(*arg, "func", len) == 0)
            {
index 546103e97858aa099a021848f003e95020fd5043..58494d4d0a2732c2e1c449eb076f875c8316fdcc 100644 (file)
@@ -1225,9 +1225,7 @@ read_viminfo_varlist(vir_T *virp, int writing)
            switch (*tab)
            {
                case 'S': type = VAR_STRING; break;
-#ifdef FEAT_FLOAT
                case 'F': type = VAR_FLOAT; break;
-#endif
                case 'D': type = VAR_DICT; break;
                case 'L': type = VAR_LIST; break;
                case 'B': type = VAR_BLOB; break;
@@ -1242,10 +1240,8 @@ read_viminfo_varlist(vir_T *virp, int writing)
                        || type == VAR_LIST || type == VAR_BLOB)
                    tv.vval.v_string = viminfo_readstring(virp,
                                       (int)(tab - virp->vir_line + 1), TRUE);
-#ifdef FEAT_FLOAT
                else if (type == VAR_FLOAT)
                    (void)string2float(tab + 1, &tv.vval.v_float, FALSE);
-#endif
                else
                {
                    tv.vval.v_number = atol((char *)tab + 1);