Left: | ||
Right: |
OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2012 The Go Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style | |
3 // license that can be found in the LICENSE file. | |
4 package rand2 | |
5 | |
6 /* | |
7 #include <stdlib.h> | |
8 */ | |
9 import "C" | |
10 | |
11 func Random() int { | |
12 var r C.long = C.random() | |
13 return int(r) | |
14 } | |
15 | |
16 // STOP OMIT | |
17 func Seed(i int) { | |
18 C.srandom(C.uint(i)) | |
19 } | |
20 | |
21 // END OMIT | |
OLD | NEW |