Interpreting the decimal point in arhithmetic calculations in Vim
It seems to me that all of a sudden Vim doesn't recognize the decimal point anymore.
For example, if I do 开发者_C百科a
: echo 22.0/3.0
then I receive a
2200
This is probably because Vim sees the dot as a string concatenator and so calculates
22 . (0/3) . 0
which is 22 . 0 . 0
which then is 2200
.
I can confirm this suspicion by doing a :echo 3.9
and when I receive a 39
.
I am pretty sure that I had this working correctly (whereas correctly means: as I expected). So, have I changed some setting or something?
Thanks / Rene
This works in Vim 7.2, gVim as well. You explicitly have to surround the numbers with quotes to get the result you posted. I suggest you upgrade your Vim.
精彩评论