hoshi-lang
dev
Yet another programming language
Loading...
Searching...
No Matches
random.cpp
Go to the documentation of this file.
1
//
2
// Created by XIaokang00010 on 2025/11/21.
3
//
4
5
#include <cstdint>
6
#include <
runtime/random/random.h
>
7
8
extern
"C"
uint64_t
runtime_random_legacy_unsigned
() {
9
union
X {
10
int32_t s[2];
11
uint64_t u;
12
X() : s{(int32_t) rand(), (int32_t) rand()} {}
13
};
14
return
X().u;
15
}
16
17
extern
"C"
void
runtime_random_legacy_set_seed
(uint64_t seed) {
18
srand(seed);
19
}
runtime_random_legacy_set_seed
void runtime_random_legacy_set_seed(uint64_t seed)
Definition
random.cpp:17
runtime_random_legacy_unsigned
uint64_t runtime_random_legacy_unsigned()
Definition
random.cpp:8
random.h
runtime
random
random.cpp
Generated by
1.9.8