These look correct to me, when you do eval("1/2") you are doing integer
division, so it should return 0. In every other case you have a floating
point so you will be doing floating point division, so you should get .5.
Why is this strange?


On Mon, Nov 12, 2012 at 11:43 PM, oversky <[email protected]> wrote:

> I use eval function to do some simple calculations.
> Today I found that some calculations do not return correct answers.
> For example,
>
> :echo eval('1/2')
> 0
>
> :echo eval('1/2.0')
> 0.5
>
> :echo eval('1.0/2')
> 0.5
>
> :echo eval('1.0/2.0')
> 0.5
>
> I use vim from http://portableapps.com.
> This version is compiled with +float.
> Can anyone confirm this with your vim?
>
> --
> You received this message from the "vim_use" maillist.
> Do not top-post! Type your reply below the text you are replying to.
> For more information, visit http://www.vim.org/maillist.php
>



-- 
Danny Gratzer

-- 
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Reply via email to