# Questions tagged [arithmetic]

Question about ways to make quick calculations in Vim.

7 questions
Filter by
Sorted by
Tagged with
131 views

### Expression register and fractions

I tried to use the arithmetic register with a fraction (7/8) and it returned 0! How do I exert better control over the register so that it gives me what I want? The literal sequence I used, while in ...
• 199
2k views

### How do you sum up integers on separate lines in vim?

I have a list of integers, where each is on a separate line. I'm trying to find a quick way to sum them up directly in VIM without having to write a script that does it for me.
• 181
2k views

### How do I use a variable with an ex command?

I wrote a moderately complex routine for Vim and I need to programmatically set the height of windows. The way to do this is with :resize [N] as the help says. But my invocation didn't work until ...
• 2,081
13k views

### Quickly calculate the total of a column of numbers

I'm writing down a markdown table which looks like this: | 13/05/15 | 09:30-16:00 | 6.5 | | 14/05/15 | 10:00-16:30 | 6.5 | | 16/05/15 | 15:30-01:00 | 9.5 | | 21/05/15 | 09:00-16:30 | 7.5 | | 22/...
• 912
146 views

### Why is division of a negative number by 0 not the minimum number? [duplicate]

Related to Why does vim allow to divide by zero, what's going on here? :let a=-42/0 :echo a -2147483647 :let b=a - 1 :echo b -2147483648
• 133
2k views

### Why does vim allow integer division by zero?

I just discovered that vim obviously allows division by zero: :let a=42/0 :echo a prints 2147483647 (which is the value of a). Is this documented somewhere and why does vim allow division by zero?
• 1,985