[Tkabber-dev] r1641 - trunk/tkabber

tkabber-svn at jabber.ru tkabber-svn at jabber.ru
Mon Feb 9 21:18:40 MSK 2009


Author: sergei
Date: 2009-02-09 21:18:39 +0300 (Mon, 09 Feb 2009)
New Revision: 1641

Modified:
   trunk/tkabber/ChangeLog
   trunk/tkabber/utils.tcl
Log:
	* utils.tcl: Made [rand $n] procedure to produce numbers uniformly
	  distributed among integers from 0 to $n.


Modified: trunk/tkabber/ChangeLog
===================================================================
--- trunk/tkabber/ChangeLog	2009-02-05 20:57:55 UTC (rev 1640)
+++ trunk/tkabber/ChangeLog	2009-02-09 18:18:39 UTC (rev 1641)
@@ -1,3 +1,8 @@
+2009-02-09  Sergei Golovan  <sgolovan at nes.ru>
+
+	* utils.tcl: Made [rand $n] procedure to produce numbers uniformly
+	  distributed among integers from 0 to $n.
+
 2009-02-05  Sergei Golovan  <sgolovan at nes.ru>
 
 	* custom.tcl: Store customization variables to a temporary file and

Modified: trunk/tkabber/utils.tcl
===================================================================
--- trunk/tkabber/utils.tcl	2009-02-05 20:57:55 UTC (rev 1640)
+++ trunk/tkabber/utils.tcl	2009-02-09 18:18:39 UTC (rev 1641)
@@ -1,7 +1,7 @@
 # $Id$
 
 proc rand {num} {
-    return [expr round(rand()*$num)]
+    return [expr int(floor(rand()*$num))]
 }
 
 proc psuffix {xlib} {



More information about the Tkabber-dev mailing list