mirror of
https://github.com/corda/corda.git
synced 2025-06-13 04:38:19 +00:00
Merge branch 'master' into powerpc
Conflicts: makefile src/assembler.h src/compile.cpp src/compiler.cpp src/compiler.h src/finder.cpp
This commit is contained in:
@ -58,6 +58,21 @@ public class Random {
|
||||
return next(32);
|
||||
}
|
||||
|
||||
public void nextBytes(byte[] bytes) {
|
||||
final int length = bytes.length;
|
||||
for (int i = 0; i < length;) {
|
||||
int r = nextInt();
|
||||
for (int j = Math.min(length - i, 4); j > 0; --j) {
|
||||
bytes[i++] = (byte) r;
|
||||
r >>= 8;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public long nextLong() {
|
||||
return ((long) next(32) << 32) + next(32);
|
||||
}
|
||||
|
||||
public double nextDouble() {
|
||||
return (((long) next(26) << 27) + next(27)) / (double) (1L << 53);
|
||||
}
|
||||
|
Reference in New Issue
Block a user