RosettaCodeData/Task/Arithmetic-Integer/Vim-Script/arithmetic-integer.vim

11 lines
364 B
VimL

let a = float2nr(input("Number 1: ") + 0)
let b = float2nr(input("Number 2: ") + 0)
echo "\nSum: " . (a + b)
echo "Difference: " . (a - b)
echo "Product: " . (a * b)
" The result of an integer division is truncated
echo "Quotient: " . (a / b)
" The sign of the result of the remainder operation matches the sign of
" the first operand
echo "Remainder: " . (a % b)