2424# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
2525# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2626
27+ # cython: language_level=3
28+
2729cdef extern from "Python.h" :
2830 void * PyMem_Malloc (size_t n )
2931 void PyMem_Free (void * buf )
@@ -262,7 +264,7 @@ cdef object vec_cont1_array(irk_state *state, irk_cont1_vec func, object size,
262264
263265 multi = < broadcast > PyArray_MultiIterNew (1 , < void * > oa )
264266 imax = multi .size
265- n = res_size / imax
267+ n = res_size // imax
266268 with lock , nogil :
267269 for i from 0 <= i < imax :
268270 oa_data = < double * > PyArray_MultiIter_DATA (multi , 0 )
@@ -323,7 +325,7 @@ cdef object vec_cont2_array(irk_state *state, irk_cont2_vec func, object size,
323325
324326 multi = < broadcast > PyArray_MultiIterNew (2 , < void * > oa , < void * > ob )
325327 imax = multi .size
326- n = res_size / imax
328+ n = res_size // imax
327329 with lock , nogil :
328330 for i from 0 <= i < imax :
329331 oa_data = < double * > PyArray_MultiIter_DATA (multi , 0 )
@@ -389,7 +391,7 @@ cdef object vec_cont3_array(irk_state *state, irk_cont3_vec func, object size,
389391
390392 multi = < broadcast > PyArray_MultiIterNew (3 , < void * > oa , < void * > ob , < void * > oc )
391393 imax = multi .size
392- n = res_size / imax
394+ n = res_size // imax
393395 with lock , nogil :
394396 for i from 0 <= i < imax :
395397 oa_data = < double * > PyArray_MultiIter_DATA (multi , 0 )
@@ -423,8 +425,10 @@ cdef object vec_disc0_array(irk_state *state, irk_disc0_vec func, object size,
423425
424426 return array
425427
426- cdef object vec_long_disc0_array (irk_state * state , irk_disc0_vec_long func , object size ,
427- object lock ):
428+ cdef object vec_long_disc0_array (
429+ irk_state * state , irk_disc0_vec_long func ,
430+ object size , object lock
431+ ):
428432 cdef long * array_data
429433 cdef long res
430434 cdef ndarray array "arrayObject"
@@ -444,8 +448,10 @@ cdef object vec_long_disc0_array(irk_state *state, irk_disc0_vec_long func, obje
444448 return array
445449
446450
447- cdef object vec_discnp_array_sc (irk_state * state , irk_discnp_vec func , object size ,
448- int n , double p , object lock ):
451+ cdef object vec_discnp_array_sc (
452+ irk_state * state , irk_discnp_vec func , object size ,
453+ int n , double p , object lock
454+ ):
449455 cdef int * array_data
450456 cdef int res
451457 cdef ndarray array "arrayObject"
@@ -494,7 +500,7 @@ cdef object vec_discnp_array(irk_state *state, irk_discnp_vec func, object size,
494500
495501 multi = < broadcast > PyArray_MultiIterNew (2 , < void * > on , < void * > op )
496502 imax = multi .size
497- n = res_size / imax
503+ n = res_size // imax
498504 with lock , nogil :
499505 for i from 0 <= i < imax :
500506 on_data = < int * > PyArray_MultiIter_DATA (multi , 0 )
@@ -558,7 +564,7 @@ cdef object vec_discdd_array(irk_state *state, irk_discdd_vec func, object size,
558564
559565 multi = < broadcast > PyArray_MultiIterNew (2 , < void * > on , < void * > op )
560566 imax = multi .size
561- n = res_size / imax
567+ n = res_size // imax
562568 with lock , nogil :
563569 for i from 0 <= i < imax :
564570 on_data = < double * > PyArray_MultiIter_DATA (multi , 0 )
@@ -625,7 +631,7 @@ cdef object vec_discnmN_array(irk_state *state, irk_discnmN_vec func, object siz
625631
626632 multi = < broadcast > PyArray_MultiIterNew (3 , < void * > on , < void * > om , < void * > oN )
627633 imax = multi .size
628- n = res_size / imax
634+ n = res_size // imax
629635 with lock , nogil :
630636 for i from 0 <= i < imax :
631637 on_data = < int * > PyArray_MultiIter_DATA (multi , 0 )
@@ -708,7 +714,7 @@ cdef object vec_discd_array(irk_state *state, irk_discd_vec func, object size, n
708714 raise ValueError ("size is not compatible with inputs" )
709715
710716 imax = oa .size
711- n = res_size / imax
717+ n = res_size // imax
712718 with lock , nogil :
713719 for i from 0 <= i < imax :
714720 oa_data = < double * > PyArray_MultiIter_DATA (multi , 1 )
@@ -747,7 +753,7 @@ cdef object vec_long_discd_array(irk_state *state, irk_discd_long_vec func, obje
747753 raise ValueError ("size is not compatible with inputs" )
748754
749755 imax = oa .size
750- n = res_size / imax
756+ n = res_size // imax
751757 with lock , nogil :
752758 for i from 0 <= i < imax :
753759 oa_data = < double * > PyArray_MultiIter_DATA (multi , 1 )
@@ -784,7 +790,7 @@ cdef object vec_Poisson_array(irk_state *state, irk_discdptr_vec func1, irk_disc
784790 raise ValueError ("size is not compatible with inputs" )
785791
786792 imax = olambda .size
787- n = res_size / imax
793+ n = res_size // imax
788794 if imax < n :
789795 with lock , nogil :
790796 for i from 0 <= i < imax :
@@ -1678,11 +1684,11 @@ cdef class RandomState:
16781684 with self .lock :
16791685 ret = randfunc (low , high - 1 , size )
16801686
1681- if size is None :
1682- if dtype in (np . bool , np . int , np .long ):
1683- return dtype (ret )
1687+ if size is None :
1688+ if dtype in (bool , int , np . compat .long ):
1689+ return dtype (ret )
16841690
1685- return ret
1691+ return ret
16861692
16871693
16881694 def randint_untyped (self , low , high = None , size = None ):
@@ -5447,7 +5453,7 @@ cdef class RandomState:
54475453 mean_data = < double * > PyArray_DATA (marr )
54485454 t_data = < double * > PyArray_DATA (tarr )
54495455
5450- n = PyArray_SIZE (resarr ) / dim
5456+ n = PyArray_SIZE (resarr ) // dim
54515457
54525458 method = choose_method (method , [ICDF , BOXMULLER2 , BOXMULLER ], _method_alias_dict_gaussian )
54535459 if (method is ICDF ):
0 commit comments