To Bram: Yes, randfloat would not be frequently used. The attachment is a new patch which simplifies randfloat function and makes srand function more convenient to use.
Hong Xu 2010/11/10 -----Original Message----- From: Bram Moolenaar Sent: 2010/11/10 19:45:52 To: [email protected] Cc: [email protected] Subject: RE: [PATCH] provide random number generating functions for vimscript Hong Xu wrote: > I have reduced the size of the patch and fixed white space. The > attachment is the new patch. Thanks. I'll have another look later. > I don't know why we have to reset the seed to a known value. Sometimes it's useful to reproduce the sequence of numbers. Mainly for debugging and testing. > 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. Then why don't we drop the method to generate a float random number and only provide the integer one? If we do need it, another simplification would be to have the float random number always be between 0.0 and 1.0. The use of a range is much less useful than for integers. I know this kind of functionality will be used very infrequently, we need to keep it as simple and small as possible. -- ARTHUR: No, hang on! Just answer the five questions ... GALAHAD: Three questions ... ARTHUR: Three questions ... And we shall watch ... and pray. "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD /// Bram Moolenaar -- [email protected] -- 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-b2b9a77c-0ad0-4ed3-9f93-07b29d918e7f
