+
    :iI                         ^ RI t^ RIHt ^ RIHt ^ RIHt ^ RIt^ RI	t	R t
R tR tR tR	 t ! R
 R]	P                  4      t]R8X  d   ]	P$                  ! 4        R# R# )    N)TypingError)njit)typesc                 .    \         P                  ! V 4      # N)r   int32xs   &V/var/www/html/photoedit/myenv/lib/python3.14/site-packages/numba/tests/test_casting.pyfloat_to_intr   	   s    ;;q>    c                 <    \         P                  ! V 4      ^,          # )   )r   float64r	   s   &r   int_to_floatr      s    ==ar   c                 .    \         P                  ! V 4      # r   )r   uint32r	   s   &r   float_to_unsignedr      s    <<?r   c                 .    \         P                  ! V 4      # r   )r   
complex128r	   s   &r   float_to_complexr      s    Ar   c                  Z    \         P                  ! \         P                  ! R4      4       R# )   N)r   )npr   zeros r   r   numpy_scalar_cast_errorr      s    HHRXXd^r   c                   P   a  ] tR t^t o R tR tR tR tR tR t	R t
R tR	tV tR
# )TestCastingc                   \         p\        \        P                  34      ! V4      pV P	                  VP
                  ^ ,          P                  \        P                  4       V P	                  V! R4      V! R4      4       V P	                  V! R4      \        R4      4       V P	                  V! R4      V! R4      4       V P	                  V! R4      \        R4      4       R# )r   皙(@Ng()	r   r   r   float32assertEqualnopython_signaturesreturn_typer   intselfpyfunccfuncs   &  r   test_float_to_intTestCasting.test_float_to_int   s    emm%&v.2215AA5;;OtfTl3tc$i0uve}5us5z2r   c                4   \         p\        \        P                  34      ! V4      pV P	                  VP
                  ^ ,          P                  \        P                  4       V P	                  V! R4      V! R4      4       V P	                  V! R4      R4       R# )r   iA  Ng     d@)r   r   r   int64r#   r$   r%   r   r'   s   &  r   test_int_to_floatTestCasting.test_int_to_float'   sp    ekk^$V,2215AA	(sVC[1sX.r   c           
        \         p\        \        P                  34      ! V4      pV P	                  VP
                  ^ ,          P                  \        P                  4       V P	                  V! R4      V! R4      4       V P	                  V! R4      \        P                  ! R\        P                  ! R^4      4      ^ ,          4       R# )r   gGz	@IiN)r   r   r   r"   r#   r$   r%   r   structunpackpackr'   s   &  r   test_float_to_unsigned"TestCasting.test_float_to_unsigned0   s    "emm%&v.2215AA5<<PtfTl3tfmmCSFG:I 'JJK'M 	Nr   c                4   \         p\        \        P                  34      ! V4      pV P	                  VP
                  ^ ,          P                  \        P                  4       V P	                  V! R4      V! R4      4       V P	                  V! R4      R4       R# )r   NgGz	yGz	        )r   r   r   r   r#   r$   r%   r   r'   s   &  r   test_float_to_complex!TestCasting.test_float_to_complex9   ss    !emm%&v.2215AA))	+uve}5uz2r   c                H  a \        R4      R 4       oSP                  4        \        R4      V3R l4       p\        P                  ! R.\        P                  R7      pV P                  V! V4      V^ ,          4       V P                  \        SP                  4      ^4       R# )z,Make sure this compiles.

Cast C to A array
z	f8(f8[:])c                     V ^ ,          # )r   r   r	   s   &r   inner.TestCasting.test_array_to_array.<locals>.innerF   s    Q4Kr   zf8(f8[::1])c                    < S! V 4      # r   r   )r
   r>   s   &r   driver/TestCasting.test_array_to_array.<locals>.driverL   s    8Or   i  dtypeN)r   disable_compiler   arrayr   r#   len	overloads)r(   rA   r
   r>   s   &  @r   test_array_to_arrayTestCasting.test_array_to_arrayA   s    
 
k		 
	 		m		 
	 HHdV2::.AaD)U__-q1r   c                   \         R  4       p\        P                  R3\        P                  R3\        P                  R3\        P
                  ^3\        P                  R3\        P                  R3\        P                  \        P                  ! ^R4      3\        P                  \        P                  ! R4      3R.	pV F;  w  r4\        P                  ! WCR7      pV P                  V! V4      VR	,          4       K=  	  R# )
c                 8    V P                   P                  V 4      # r   )rD   typer	   s   &r   r>   -TestCasting.test_0darrayT_to_T.<locals>.innerU   s    77<<?"r   Tr!   hz
2016-01-01rC   Ny      @       @)z<U3ABCr   )r   r   bool_r"   r   r.   	complex64r   timedelta64
datetime64rF   r#   )r(   r>   inputsTinpr
   s   &     r   test_0darrayT_to_TTestCasting.test_0darrayT_to_TT   s    		# 
	# XXtZZZZXXrN\\4 ]]D!^^R^^As34]]BMM,78

 HQ&AU1Xqu- r   c                    V P                  \        4      ;_uu_ 4       p\        R4      ! \        4       RRR4       V P	                  R\        XP                  4      4       R#   + '       g   i     L7; i)z^
Ensure that a TypingError exception is raised if
user tries to convert numpy array to scalar
Nz?Casting array(float64, 1d, C) to int32 directly is unsupported.r   )assertRaisesr   r   r   assertInstr	exception)r(   raisess   & r   test_array_to_scalar TestCasting.test_array_to_scalari   sQ     {++vH,- , 	W&**+	- ,+s   A##A3	c                &   \         P                  ! \         P                  4      p\         P                  ! \         P                  4      pV! V4      p\	        V4      R 4       pV P                  V! ^4      ^4       V P                  V! R4      4       R# )zw
Test error due mishandling of Optional to Optional casting

Related issue: https://github.com/numba/numba/issues/1718
c                     V # r   r   )as   &r   foo2TestCasting.test_optional_to_optional.<locals>.foo   s    Hr   N)r   Optionalintpr   r   r#   assertIsNone)r(   opt_intopt_fltsigre   s   &    r   test_optional_to_optional%TestCasting.test_optional_to_optionalu   sp     ..,../g	c	 
	 	Q##d)$r   r   N)__name__
__module____qualname____firstlineno__r+   r/   r7   r:   rI   rX   r`   rm   __static_attributes____classdictcell__)__classdict__s   @r   r   r      s3     3/N32&.*
-% %r   r   __main__)numpyr   numba.core.errorsr   numbar   
numba.corer   r4   unittestr   r   r   r   r   TestCaser   ro   mainr   r   r   <module>r~      s]     )     i%(## i%X zMMO r   