On Wednesday, July 13, 2016 at 7:12:30 AM UTC-5, Ken Takata wrote:
> Hi Ben,
> 
> 2016/7/13 Wed 5:44:06 UTC+9 Ben Fritz wrote:
> > The recent updates to Vim to support 64-bit integers broke a plugin I was 
> > using that provides a vimscript implementation of a pseudorandom number 
> > generator, by sending it into a near-infinite loop.
> > 
> > The problem was that the plugin assumes 32-bit integers, so I "fixed" it 
> > with a bitwise and() in the internal logic with a 32-bit integer max value.
> > 
> > But I'd rather just update to use 64-bit integers.
> > 
> > I could hard-code maximums based on has(num64), but would it be useful in 
> > general to just make a v:max_number or something which would contain the 
> > maximum value for a Number variable? I'd rather use something built-in than 
> > hard-code it anywhere it's needed.
> 
> I wrote a patch for this:
> https://bitbucket.org/k_takata/vim-ktakata-mq/src/201d986bfabca7b759b7cbb9a4703e9996b8fc43/v_max_number.patch?fileviewer=file-view-default
> 
> BTW, the result of `1/0` cannot be used for this?
> 

I suppose "1/0" does return the maximum integer value. That's actually quite 
surprising, I would have expected an exception to be thrown in that case rather 
than a value of any kind. I suppose it's documented under :help expr-/ but even 
so it *feels* wrong. I may use it anyway :-\

-- 
-- 
You received this message from the "vim_dev" 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

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Raspunde prin e-mail lui