Sunday, January 23, 2011

Re: create variable on the fly

Hi ZyX!

On So, 23 Jan 2011, ZyX wrote:

> by Christian Brabandt:
>
> > Something like this:
> > if (a>0 && b>0 && a+b < 0)
> > return -1
> > endif
> There are lots of cases when this does not work, for example:
> :echo +(printf('%u', -1)/2)
> 2147483647
> :echo 2147483647*2147483647
> 1
>
> Maybe it is better to use python? It can do long arithmetics and thus one is
> able to reliably check whether calculations have exceeded the limit.

Yeah, but wouldn't you also have to take care of overflowing in Python
as well? If you have the possibility, 64bit version might help. But that
is no real solution.


regards,
Christian

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

Post a Comment