The behavior of vim's Ctrl A is weird when incrementing numbers <= 0.005.
Due to some personal need, I want to get a set of numbers that increments by 0.005 each time from 0.005, like this:
0.005
0.010
0.015
...
then I thought of vim's macro and Ctrl A.
I entered 0.005 in vim's first line, use y y p Ctrl A to record a macro. But when I moved the cursor to 5 and then pressed Ctrl A continuously, the third time, the number changed directly from 0.007 to 0.010. If I just press 3 times, the output will become:
0.005
0.010
0.013
0.016
...
That means that I cannot complete the task using vim.
After doing this in other ways, I started to be interested in the behavior of vim's Ctrl A.
The text below comes from vim's help manual:
:h CTRL-A
:
Add [count] to the number or alphabetic character at or after the cursor.
and :h count
:
An optional number that may precede the command to multiply or iterate the command.
If no number is given, a count of one is used, unless otherwise noted.
When I tested some other numbers, I found that the behavior becomes weird starting from 0.01. But I still don't know why Ctrl A behaves like this.
Before starting to read the source of vim, does anyone know why vim's Ctrl A behaves like this on decimals?
BTW, My PC environment is Win10, and I use vim_only_x64 downloading from vim's official site.