File tree 4 files changed +8
-4
lines changed
4 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -32,7 +32,9 @@ cdef enum:
32
32
# Max value for our rand_r replacement (near the bottom).
33
33
# We don't use RAND_MAX because it's different across platforms and
34
34
# particularly tiny on Windows/MSVC.
35
- RAND_R_MAX = 0x7FFFFFFF
35
+ # It corresponds to the maximum representable value for
36
+ # 32-bit signed integers (i.e. 2^31 - 1).
37
+ RAND_R_MAX = 2147483647
36
38
37
39
38
40
cdef inline UINT32_t rand_int(UINT32_t end, UINT32_t* random_state) noexcept nogil:
Original file line number Diff line number Diff line change @@ -236,7 +236,7 @@ cdef class Criterion:
236
236
double upper_bound,
237
237
double value_left,
238
238
double value_right,
239
- ) nogil:
239
+ ) noexcept nogil:
240
240
cdef:
241
241
bint check_lower_bound = (
242
242
(value_left >= lower_bound) &
Original file line number Diff line number Diff line change @@ -23,7 +23,9 @@ cdef enum:
23
23
# Max value for our rand_r replacement (near the bottom).
24
24
# We don't use RAND_MAX because it's different across platforms and
25
25
# particularly tiny on Windows/MSVC.
26
- RAND_R_MAX = 0x7FFFFFFF
26
+ # It corresponds to the maximum representable value for
27
+ # 32-bit signed integers (i.e. 2^31 - 1).
28
+ RAND_R_MAX = 2147483647
27
29
28
30
29
31
# safe_realloc(&p, n) resizes the allocation of p to n * sizeof(*p) bytes or
Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ cdef enum:
14
14
# particularly tiny on Windows/MSVC.
15
15
# It corresponds to the maximum representable value for
16
16
# 32-bit signed integers (i.e. 2^31 - 1).
17
- RAND_R_MAX = 0x7FFFFFFF
17
+ RAND_R_MAX = 2147483647
18
18
19
19
cpdef sample_without_replacement(cnp.int_t n_population,
20
20
cnp.int_t n_samples,
You can’t perform that action at this time.
0 commit comments