In Python 2.x this is easily solved like this:
>>> 1/2
0
>>> from __future__ import division
>>> 1/2
0.5
Unfortunately, my Vim is not able to import from future:
:py print 1/2
0
:py from __future__ import division
:py print 1/2
0
The workaround I use is to have the code that does calculations in a separate Python module which imports division from future, and then import that module from Vim script. I can post my script for inline calculations with Pythons if someone is interested.
There other advantages in using Python for calculations instead of VimScript.
Integer overflow is less likely to be a problem. This is what I get:
:echo 111111111*111111111
165372529
:py print 111111111*111111111
12345678987654321
The x**y notation is more convenient than pow(x,y).
Regards,
Vlad