The following map and function calculates equations using the program 'bc' (found on most Linux systems, available for most systems). Visually select the equation you want to calculate, then hit ;bc - if the selection ends with an '=' sign, the answer will be appended after the equal, otherwise, the answer is echoed as a message. The code to put in a vimrc and source is at the end.

Equations can span multiple lines, and the full bc syntax is probably supported. Additionally, sin (), cos (), etc, are transformed into the names used by bc (s () c (), etc).

Please do not give such things as tips! Make this as a script and put this in the scripts section. Starting from version 6.0 (which is hopefully what most people are using),
vim provides the ability to have "plugins". (:he plugin). imho, it's bad practice to keep extending your ~/.vimrc. the rc file should be used for tweaking Vim's settings and such.
it is not a good place to put functions etc. this make the .vimrc very bloated.

Good points - I've uploaded it as script#219 with a fix that escapes ";" chars.

See also :help quote= about the expression register. E.g., in command mode, type

"=10+15<enter>p

(where <enter> means press the Enter key) will put 25 into your file at the current cursor position. See :help functions for the list of functions that Vim supports (no maths functions).

I found a bc.exe which does at least some of the calculations on Windows 2000 (http://unxutils.sourceforge.net/). Adaptions for Windows 2000 using bc.exe from sourceforge: