Tuesday, November 29, 2011

RE: expression register as calculator with floats?

John Little wrote:
>> Just be sure to specify floating point numbers even for any
>> integers involved, e.g. 59.0 instead of just 59.
>
> Why you make this proviso?
> F. ex., vim evaluates 59 + 37.5 as 96.5.

For safety: 4/12 is 0 but 4/12.0 is 0.333333.

Also, integer operations can overflow sooner.
On some systems, 123400*123400 is negative.

John

--
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

No comments: