Questions tagged [arithmetic]

Question about ways to make quick calculations in Vim.

Filter by
Sorted by
Tagged with
16
votes
3answers
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?
0
votes
1answer
142 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