Re: vim7: limits of values of vim variables?
- Mikolaj Machowski wrote:
> After question on comp.editors about power function in Vim I wroteIt's just that the size of an int is 32 bits, thus the result doesn't
> function! Power(number, power)
> if a:power < 0
> return 0
> elseif a:power == 0
> let eval = 1
> exe 'let eval = '.repeat(a:number.'*', a:power-1).a:number
> return eval
> After calling::
> echo Power(2,31)
> And higher values there are some strange results. :help limits mention
> nothing about that.
fit. On a system where int is 64 bits it should work.
I'll add a remark to the help on limits. Although it's already
mentioned at ":help variables".
hundred-and-one symptoms of being an internet addict:
2. You kiss your girlfriend's home page.
/// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ download, build and distribute -- http://www.A-A-P.org ///
\\\ help me help AIDS victims -- http://www.ICCF.nl ///