Index: doc/mathfunc.n
===================================================================
RCS file: /cvsroot/tcl/tcl/doc/mathfunc.n,v
retrieving revision 1.9
diff -u -r1.9 mathfunc.n
--- doc/mathfunc.n	26 Apr 2006 04:41:10 -0000	1.9
+++ doc/mathfunc.n	4 May 2006 12:51:39 -0000
@@ -232,9 +232,8 @@
 the floating-point range.
 .TP
 \fBsrand(\fIarg\fB)\fR
-The \fIarg\fR, which must be an integer value acceptable to
-\fBstring is integer\fR (that is, a 32-bit integer), is used to reset the
-seed for the random number generator of \fBrand\fR.  Returns the first random
+The \fIarg\fR, which must be an integer, is used to reset the seed for
+the random number generator of \fBrand\fR.  Returns the first random
 number (see \fBrand()\fR) from that seed.  Each interpreter has its own seed.
 .TP
 \fBtan(\fIarg\fB)\fR
Index: generic/tclBasic.c
===================================================================
RCS file: /cvsroot/tcl/tcl/generic/tclBasic.c,v
retrieving revision 1.193
diff -u -r1.193 tclBasic.c
--- generic/tclBasic.c	6 Mar 2006 21:56:34 -0000	1.193
+++ generic/tclBasic.c	4 May 2006 12:51:40 -0000
@@ -5677,9 +5677,20 @@
 	return TCL_ERROR;
     }
 
-    if (Tcl_GetLongFromObj(interp, objv[1], &i) != TCL_OK) {
-	/* TODO: more ::errorInfo here? or in caller? */
-	return TCL_ERROR;
+    if (Tcl_GetLongFromObj(NULL, objv[1], &i) != TCL_OK) {
+	Tcl_Obj *objPtr;
+	mp_int big;
+
+	if (Tcl_GetBignumFromObj(interp, objv[1], &big) != TCL_OK) {
+	    /* TODO: more ::errorInfo here? or in caller? */
+	    return TCL_ERROR;
+	}
+
+	mp_mod_2d(&big, (int) CHAR_BIT * sizeof(long), &big);
+	objPtr = Tcl_NewBignumObj(&big);
+	Tcl_IncrRefCount(objPtr);
+	Tcl_GetLongFromObj(NULL, objPtr, &i);
+	Tcl_DecrRefCount(objPtr);
     }
 
     /*
