Bram: I have reduced the size of the patch and fixed white space. The attachment is the new patch.
I don't know why we have to reset the seed to a known value. It's impossible for a computer to generate continual random float number, we have to generate discrete values and convert them to appropriate float numbers. Hong Xu 2010/11/9 -----Original Message----- From: Bram Moolenaar Sent: 2010/11/09 02:08:27 To: H Xu Cc: vim_dev@googlegroups.com Subject: Re: [PATCH] provide random number generating functions for vimscript Hong Xu wrote: > The attachment is a patch which provides two pseudo-random number generating > functions for vimscript. Well, the patch is a bit big, I wonder if it can be done in a simpler way. At the same time, I think there should be a way to reset the seed to a known value. Needed for testing at least. Generating the float random number from an int looks strange. Is that really needed? The computations look like we are dropping some bits. For code style: please fix white space, match the rest of the file. -- "When I die, I want a tombstone that says "GAME OVER" - Ton Richters /// Bram Moolenaar -- b...@moolenaar.net -- 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://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
rand.patch
Description: Tag-c33097b9-a07e-43b5-b18e-70e77177a81b