James McCoy wrote: > According to “:help Number”, one would expect to be able to work with > 64-bit numbers in vimscript, especially if you're on a 64-bit OS. > > However, Vim only uses a long to represent vimscript numbers if > sizeof(int) isn't at least 32-bits. The attached patch removes the > sizeof(int) check and always uses long so the user always gets the > native max integer size available.
For a long time, Vim script numbers were intentionally 32 bits. Because that should work everywhere. Using 64 bits in some places would cause some scripts to fail on other machines. Now that 64 bits is very common, we should change that and use 64 bits where possible. Also because some machines now have 64 bit ints, thus this may be used already anyway. Your patch doesn't work for MS-Windows, where long is still 32 bits. We should do some more work and use the type for 64 bit where possible. We also need to update the documentation. We should also make it possible to test whether the Number type is 32 or 64 bits, so that scripts can give an error if it's not sufficient. -- >From "know your smileys": <|-) Chinese <|-( Chinese and doesn't like these kind of jokes /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org /// -- -- 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.
