
    
9j	                        S SK Jr  S SKrS SKJr  S SKJr  S SKJr  S SK	J
r
  SS jrSS jrSS	 jr\R                  " S
SSS5      rS r\" SSS5      r\" SSS5      r\" SSS5      r\" SSS5      rg)    )annotationsN)_core)fusion)ufunc)	bf16_loopc                    [         R                  " 5       (       a.  [         R                  " [        R                  R
                  XUS9$ [        R                  " U SS9n U R                  XS9$ )a  Rounds to the given number of decimals.

Args:
    a (cupy.ndarray): The source array.
    decimals (int): Number of decimal places to round to (default: 0).
        If decimals is negative, it specifies the number of positions to
        the left of the decimal point.
    out (cupy.ndarray): Output array.

Returns:
    cupy.ndarray: Rounded array.

.. seealso:: :func:`numpy.around`

outF)copy)r   
_is_fusing_call_ufuncr   core_round_ufuncarrayroundadecimalsr
   s      M/home/wildlama/miniconda3/lib/python3.13/site-packages/cupy/_math/rounding.pyaroundr      sX      !!JJ##Qc; 	;AE"A7787%%    c                    [        XUS9$ )Nr	   )r   r   s      r   r   r   "   s    !3''r   c                L    [         R                  " S[        5        [        XUS9$ )NzPlease use `round` instead.r	   )warningswarnDeprecationWarningr   r   s      r   round_r   &   s    MM/1CD!3''r   rint   	cupy_rintzbRounds each element of an array to the nearest integer.

    .. seealso:: :data:`numpy.rint`

    c                p    [         R                  " U SSSSSSSSS	S
SSU4/[        US9QSU4PSU4P7SUS9$ )Nz?->?zb->bzB->Bzh->hzH->Hzi->izI->Izl->lzL->Lzq->qzQ->Qze->e)codezf->fzd->dz
out0 = in0)doc)r   create_ufuncr   )nameopr#   s      r   create_rounding_ufuncr'   4   sx    RL	
 B	
 RL	
 RL	
" 	) r   
cupy_floorzout0 = floor(in0)zaRounds each element of an array to its floor integer.

    .. seealso:: :data:`numpy.floor`

    	cupy_ceilzout0 = ceil(in0)zbRounds each element of an array to its ceiling integer.

    .. seealso:: :data:`numpy.ceil`

    
cupy_trunczout0 = trunc(in0)zYRounds each element of an array towards zero.

    .. seealso:: :data:`numpy.trunc`

    cupy_fixz+out0 = (in0 >= 0.0) ? floor(in0): ceil(in0)zxIf given value x is positive, it return floor(x).
    Else, it return ceil(x).

    .. seealso:: :func:`numpy.fix`

    )r   N)
__future__r   r   cupyr   
cupy._corer   
cupy._mathr   
cupy._utilr   r   r   r   create_math_ufuncr   r'   floorceiltruncfix r   r   <module>r7      s    "      &.((
 
A{	2 		  		 1	r   