Shenghou Ma | 5b7562d | 2012-09-03 03:49:03 +0800 | [diff] [blame] | 1 | // skip |
2 | |||||
Francisco Souza | 60b98d6 | 2012-03-13 09:07:37 +1100 | [diff] [blame] | 3 | // Copyright 2012 The Go Authors. All rights reserved. |
4 | // Use of this source code is governed by a BSD-style | ||||
5 | // license that can be found in the LICENSE file. | ||||
6 | package rand | ||||
7 | |||||
Francisco Souza | 60b98d6 | 2012-03-13 09:07:37 +1100 | [diff] [blame] | 8 | /* |
9 | #include <stdlib.h> | ||||
10 | */ | ||||
11 | import "C" | ||||
12 | |||||
13 | // STOP OMIT | ||||
14 | func Random() int { | ||||
15 | return int(C.random()) | ||||
16 | } | ||||
17 | |||||
18 | // STOP OMIT | ||||
19 | func Seed(i int) { | ||||
20 | C.srandom(C.uint(i)) | ||||
21 | } | ||||
22 | |||||
23 | // END OMIT |