HEX
Server: Apache
System: Linux bd12.noc223.com 4.18.0-553.121.1.lve.el8.x86_64 #1 SMP Thu Apr 30 16:40:41 UTC 2026 x86_64
User: handcraf (1693)
PHP: 8.1.28
Disabled: NONE
Upload Files
File: //proc/self/root/opt/alt/python312/lib64/python3.12/test/__pycache__/test_cmath.cpython-312.pyc
�

h�e0^����ddlmZmZmZddlmZmZddlmZddlZddl	Z	ddl
Z
ddl	mZmZm
Z
mZddlZddlZed�Zed�ZdD��cgc]}dD]}e||���
�c}}Zedfed	feefd	efdefd
efdefeefed	fedfed
fedfeefdefd
efdefd	efeefedfed
ffD��cgc]\}}e||���c}}Zeefedfed
fedfed	feefeefdefd
efdefd	efeeffD��cgc]\}}e||���c}}ZGd�d
ej0�ZGd�dej4�Zedk(rej8�yycc}}wcc}}wcc}}w)�)�requires_IEEE_754�cpython_only�
import_helper)�parse_testfile�	test_fileN)�phase�polar�rect�pi�inf�nan)���r�ffffff@r�ffffff�c
��eZdZdD����cgc]}tt|���c}}}}Zej
d��ej
d��d�Zd�Zd�Z	d�Z
		dd	�Zd
�Zd�Z
d�Zd
�Zd�Zed��Zd�Zd�Zed��Zd�Zd�Zed��Zd�Zd�Zd�Zd�Zd�Zed��Zed��Z ed��Z!ycc}}}}w)�
CMathTests)�acos�acosh�asin�asinh�atan�atanh�cos�cosh�exp�log�log10�sin�sinh�sqrt�tan�tanhc�.�tj|d�S)Ny�@��cmathr��xs �6/opt/alt/python312/lib64/python3.12/test/test_cmath.py�<lambda>zCMathTests.<lambda>;s��U�Y�Y�q�*�%=��c�.�tjd|�S)Ny,@;�r%r's r)r*zCMathTests.<lambda><s��U�Y�Y�w��%:�r+c�0�ttd��|_y)Nzutf-8)�encoding)�openr�test_values��selfs r)�setUpzCMathTests.setUp>s���	�G�<��r+c�8�|jj�y�N)r0�closer1s r)�tearDownzCMathTests.tearDownAs������� r+c�p�d}tj|�stj|�r+tj|�rTtj|�r?y||k(r9|dk7rytjd|�tjd|�k(ry|dz
}|j|j	||��y)a#Fail unless floats x and y are identical, in the sense that:
        (1) both x and y are nans, or
        (2) both x and y are infinities, with the same sign, or
        (3) both x and y are zeros, with the same sign, or
        (4) x and y are both finite and nonzero, and x == y

        z&floats {!r} and {!r} are not identicalNr��?z: zeros have different signs)�math�isnan�copysign�fail�format)r2r(�y�msgs    r)�assertFloatIdenticalzCMathTests.assertFloatIdenticalDs���7���:�:�a�=�D�J�J�q�M��z�z�!�}����A���
�!�V��C�x�����s�A�&�$�-�-��Q�*?�?���5�5���	�	�#�*�*�Q��"�#r+c��|j|j|j�|j|j|j�y)z�Fail unless complex numbers x and y have equal values and signs.

        In particular, if x and y both have real (or imaginary) part
        zero, but the zeros have different signs, this test will fail.

        N)rA�real�imag)r2r(r?s   r)�assertComplexIdenticalz!CMathTests.assertComplexIdentical[s4��	
�!�!�!�&�&�!�&�&�1��!�!�!�&�&�!�&�&�1r+Nc��tj|�r:tj|�ry|j|xsdj|��tj|�r+||k(ry|j|xsdj||��|sT|sRtj
d|�tj
d|�k7r%|j|xsdj||��	t
||z
�}|t||t
|�z�kry|j|xsdj||��y#t$rY�1wxYw)a�Fail if the two floating-point numbers are not almost equal.

        Determine whether floating-point values a and b are equal to within
        a (small) rounding error.  The default values for rel_err and
        abs_err are chosen to be suitable for platforms where a float is
        represented by an IEEE 754 double.  They allow an error of between
        9 and 19 ulps.
        Nz{!r} should be nanz>finite result where infinity expected: expected {!r}, got {!r}r9z,zero has wrong sign: expected {!r}, got {!r}z({!r} and {!r} are not sufficiently close)	r:r;r=r>�isinfr<�abs�max�
OverflowError)r2�a�b�rel_err�abs_errr@�absolute_errors       r)�rAssertAlmostEqualzCMathTests.rAssertAlmostEquales"���:�:�a�=��z�z�!�}���I�I�c�;�1�8�8��;�<��:�:�a�=��A�v���I�I�c�=�0�06��q�!��
>����}�}�R��#�t�}�}�R��';�;��	�	�#�2�"%�%+�V�A�q�\�3�
	� ��1��X�N���W�g��A��.>�!?�?���	�	�#�J�<�C�C�A�q�I�	K���	��	�s�'D7�7	E�Ec	��d}d}|jtj|ddjtj|���|jtj|ddjtj|���y)NgiW�
�@g-DT�!	@�	zcmath.pi is {}; should be {})�placesr@zcmath.e is {}; should be {})�assertAlmostEqualr&rr>�e)r2�
e_expected�pi_expecteds   r)�test_constantszCMathTests.test_constants�sp��+�
�,�����u�x�x��Q�.�5�5�e�h�h��L�	�	N����u�w�w�
�1�-�4�4�U�W�W�j�I�	�	Kr+c�\�|jtjjtj�|jtjj
d�|jtjjd�|jtjj
tj�|jt	jtjj��|jtjj
d�|jtjjd�|jt	jtjj
��|jt	jdtjj�d�|jt	jdtjj
�d�|jt	jdtjj�d�|jt	jdtjj
�d�|jttj�d�|jttj�d�|jttj�d�|jttj�d�y)Nrr9r�infjr
�nanj)
�assertEqualr&rrCr:rDrZ�
assertTruer;r
r[r<�reprr1s r)�test_infinity_and_nan_constantsz*CMathTests.test_infinity_and_nan_constants�s��������������2����������-���������#�.���������$�(�(�3�����
�
�5�9�9�>�>�2�3����������-���������#�.�����
�
�5�:�:�?�?�3�4�������r�5�9�9�>�>�:�B�?�������r�5�9�9�>�>�:�B�?�������r�5�:�:�?�?�;�R�@�������r�5�:�:�?�?�;�R�@�	
����e�i�i��%�0�����e�j�j�)�6�2�����e�i�i��%�0�����e�j�j�)�6�2r+c
�B���
�d�d�
dddddt�tg}Gd�d�}Gd	�d
t��G�fd�d�}Gd
�dt�}Gd�d�}Gd�d�}G��
fd�d�}G�
fd�d�}|jD�]}	|j	|	|���|	���|j	|	|��|	���|j	|	|��|	�
��|j	|	|��|	t|����|j
t|	|��|j
t|	|��|D]}
|j
t|	||
���!|j
�|	|����y)Ny��z�@7Ă?�?g]�ֆ�znot complex���@c��eZdZd�Zd�Zy)�.CMathTests.test_user_object.<locals>.MyComplexc��||_yr5��value)r2rhs  r)�__init__z7CMathTests.test_user_object.<locals>.MyComplex.__init__�s	��"��
r+c��|jSr5rgr1s r)�__complex__z:CMathTests.test_user_object.<locals>.MyComplex.__complex__�s���z�z�!r+N)�__name__�
__module__�__qualname__rirk�r+r)�	MyComplexre�s��
#�
"r+rpc��eZdZy)�2CMathTests.test_user_object.<locals>.SomeExceptionN�rlrmrnror+r)�
SomeExceptionrr����r+rtc���eZdZ�fd�Zy)�7CMathTests.test_user_object.<locals>.MyComplexExceptionc�����r5ro)r2rts �r)rkzCCMathTests.test_user_object.<locals>.MyComplexException.__complex__�s	���#�#r+N)rlrmrnrk)rts�r)�MyComplexExceptionrw�s���
$r+ryc��eZdZy)�;CMathTests.test_user_object.<locals>.NeitherComplexNorFloatNrsror+r)�NeitherComplexNorFloatr{�rur+r|c��eZdZd�Zd�Zy)�*CMathTests.test_user_object.<locals>.Indexc��y�N�ror1s r)�__int__z2CMathTests.test_user_object.<locals>.Index.__int__����ar+c��yr�ror1s r)�	__index__z4CMathTests.test_user_object.<locals>.Index.__index__�s��r+N)rlrmrnr�r�ror+r)�Indexr~�s��'�)r+r�c��eZdZd�Zy)�*CMathTests.test_user_object.<locals>.MyIntc��yr�ror1s r)r�z2CMathTests.test_user_object.<locals>.MyInt.__int__�r�r+N)rlrmrnr�ror+r)�MyIntr��s��'r+r�c�"��eZdZ�fd�Z�fd�Zy)�4CMathTests.test_user_object.<locals>.FloatAndComplexc����Sr5ro�r2�flt_args �r)�	__float__z>CMathTests.test_user_object.<locals>.FloatAndComplex.__float__������r+c����Sr5ro)r2�cx_args �r)rkz@CMathTests.test_user_object.<locals>.FloatAndComplex.__complex__�s����
r+N)rlrmrnr�rk)r�r�s��r)�FloatAndComplexr��s
���
�
r+r�c���eZdZ�fd�Zy)�.CMathTests.test_user_object.<locals>.JustFloatc����Sr5ror�s �r)r�z8CMathTests.test_user_object.<locals>.JustFloat.__float__�r�r+N)rlrmrnr�)r�s�r)�	JustFloatr��s���
r+r�)�object�NotImplemented�	Exception�test_functionsr\�int�assertRaises�	TypeError)r2�
non_complexesrpryr|r�r�r�r��f�bad_complexrtr�r�s           @@@r)�test_user_objectzCMathTests.test_user_object�sw���,����'��1�b�$���>�3�
�	"�	"�	�I�	�	$�	$�
	�V�	�	*�	*�	(�	(�
	�	�
	�	��$�$�	F�A����Q�y��0�1�1�V�9�=����Q��0�1�1�V�9�=����Q�y�{�^�Q�w�Z�8����Q�u�w�Z��3�u�w�<��9�
���i��,B�,D�E����i��E�G�4�,�
H���!�!�)�Q�	�+�0F�G�
H�
���m�Q�0B�0D�E�!	Fr+c	���|jD]5}dD].}|j||�||j����0�7|jD] }dD]}|jt||���"y)N)r�rc)rK�long_string�0�1j�)r�r\r�r�r�)r2r��args   r)�test_input_typezCMathTests.test_input_type�s���$�$�	=�A��
=��� � ��3���3�=�=�?�);�<�
=�	=�
�$�$�	5�A�:�
5���!�!�)�Q��4�
5�	5r+c���gd�}||D�cgc]}|��c}zgd�z}|dgz|D�cgc]}d|z��	c}z}dg|z}dg|z|D�cgc]}|��c}z}|||||||||||||d�
}|j�D]r\}}	tt|�}
tt|�}|	D]H}||�}
|j	|
|�|
j
�|j
d|
j��J�tdD]k}|D]d}tj||�}
|j	tj||�|
j
�|j
d|
j��f�mycc}wcc}wcc}w)N)g{�G�z�?g�������?g�������?��?g�������?g�G�z��?)rr9��r9r)
rrrrrrrrrr r!r"r#)r�rcg$@)	�items�getattrr:r&rPrCr\rDr)r2r0r(�
unit_interval�positive�nonnegative�	real_liner��fn�values�float_fn�
complex_fn�v�z�bases               r)�test_cmath_matches_mathz"CMathTests.test_cmath_matches_maths���
7��$�;�&?�a��r�&?�?���
��"��%�{�(C�!��A��(C�C���d�X�o���D�8�O�8�&<�a��r�&<�<�	�#�"��������� ���
 ��)�.�.�0�	-�J�B���t�R�(�H� ���+�J��
-���q�M���'�'����Q�V�V�<�� � ��Q�V�V�,�
-�	-�#�	-�D��
-���I�I�a��&���'�'�����D�(9�1�6�6�B�� � ��Q�V�V�,�
-�	-��E'@��)D��'=s�
E�E!�
E&c�H�dh}d}tjdk(r@tj�d}	tt	t
|j
d���}d�}d�}tt�D�]\}}}}	}
}}t||	�}
t|
|�}|�
|dkr||vr�0|dk(r|}n|d	k(r|}ntt|�}d
|vsd|vr,	||
�}|jdj||||	��d
|vr,	||
�}|jdj||||	��||
�}d|vrRtt!|j"�|j$�}tt!|j"�|j$�}d|vrRt|j"t!|j$��}t|j"t!|j$��}|dvrd}nd}dj||||	|j"|j$|j"|j$�}|j'|j"|j"||��|j'|j$|j$|����y#t$rY��'wxYw#t$rY��"wxYw#t$rY��2wxYw)N�tan0064�darwinr�.c�V�tj|j|j�S)zaWrapped version of rect that accepts a complex number instead of
            two float arguments.)r&r
rCrD�r�s r)�rect_complexz5CMathTests.test_specific_values.<locals>.rect_complexEs���:�:�a�f�f�a�f�f�-�-r+c�$�tt|��S)zYWrapped version of polar that returns a complex number instead of
            two floats.)�complexr	r�s r)�
polar_complexz6CMathTests.test_specific_values.<locals>.polar_complexJs���E�!�H�%�%r+)�
rbr
r	zdivide-by-zero�invalidz9ValueError not raised in test {}: {}(complex({!r}, {!r}))�overflowz<OverflowError not raised in test {}: {}(complex({!r}, {!r}))zignore-real-signzignore-imag-sign)rr�V瞯�<�
z�{}: {}(complex({!r}, {!r}))
Expected: complex({!r}, {!r})
Received: complex({!r}, {!r})
Received value insufficiently close to expected value.)rNr@)r@)�sys�platform�mac_ver�tuple�mapr��split�
ValueErrorrrr�r�r&r=r>rJrHrCrDrP)r2�
SKIP_ON_TIGER�osx_version�version_txtr�r��idr��ar�ai�er�ei�flagsr��expected�function�actual�real_abs_err�
error_messages                   r)�test_specific_valueszCMathTests.test_specific_values7s���#��
����<�<�8�#�"�*�*�,�Q�/�K�
�#�C��[�->�->�s�-C�$D�E��	.�
	&�
.<�I�-F�=	;�)�B��B��B��E��"�b�/�C��r�2��H��&�;��+@���&���V�|�'���w��(��"�5�"�-���5�(�I��,>�P�%�c�]�F��I�I�8�8>��r�2�r�2�8N�P��U�"�P�%�c�]�F��I�I�8�8>��r�2�r�2�8N�P��c�]�F�!�U�*� ��V�[�[�!1�6�;�;�?��"�3�x�}�}�#5�x�}�}�E��!�U�*� ����c�&�+�+�.>�?��"�8�=�=�#�h�m�m�2D�E���%�%�$��%��I��&��R��R��]�]�H�M�M��[�[�&�+�+�/�
�
�#�#�H�M�M�6�;�;�0<�,9�
$�
;�
�#�#�H�M�M�6�;�;�,9�
$�
;�y=	;���
��
��>"�����%����s5�(I4�J�7J�4	J�J�	J�J�	J!� J!c������fd�}|dd�|dd�|ddtf�|ddtd	zf�|d
dtd	zf�td�}|t|d�|d
f�|t|d�|tf�|td|�|td	zf�|td|�|td	zf�|t||�|tdzf�|t||�|tdzf�|t||�|dtzdzf�|t||�|dtzdzf�td�}|t|d�||f�|td|�||f�|t||�||f�|t||�||f�|t||�||f�|t||�||f�|t||�||f�y)Nc�b���|�}t||�D]\}}�j||��yr5)�ziprP)r�r��gotrU�g�funcr2s     ��r)�checkz%CMathTests.check_polar.<locals>.check�s6����s�)�C��H�c�*�
.���1��'�'��1�-�
.r+r)rrra)r9r���r9��?r�y��g@rr�rb����r
)r�floatr�)r2r�r�rr
s``   r)�check_polarzCMathTests.check_polar�s����	.�	�a���
�a���
�b�2�r�(��
�b�2�r�A�v�,��
�c�B���a��=�!��E�l��
�g�c�1�o��R�y�)�
�g�s�d�A���b�	�*�
�g�a��o��R�!�V�}�-�
�g�a�#����r�c�A�g��/�
�g�c�3��#�r�A�v��/�
�g�c�C�4� �3���a��.�1�
�g�s�d�C� �3��B���
�"3�4�
�g�s�d�S�D�!�C��b��1��#5�6��E�l��
�g�c�1�o��S�z�*�
�g�a��o��S�z�*�
�g�c�3��#�s��,�
�g�c�3��#�s��,�
�g�s�d�C� �3��*�-�
�g�c�3��#�s��,�
�g�c�C�4� �3��*�-r+c�.�|jt�yr5)r�r	r1s r)�
test_polarzCMathTests.test_polar�s������r+c�\��tjd���fd�}|j|�y)N�	_testcapic����jd�	t|��jd�S#�jd�wxYw)N�r)�	set_errnor	)r�r�s �r)�polar_with_errno_setz9CMathTests.test_polar_errno.<locals>.polar_with_errno_set�s:�������#�
'��Q�x��#�#�A�&��	�#�#�A�&�s	�
0�A)r�
import_moduler�)r2r�r�s  @r)�test_polar_errnozCMathTests.test_polar_errno�s+���"�/�/��<�	�	'�	
���-�.r+c��
�|jtd�d�|jtd�d�|jtd�t�|jtd�t�|jtd�t�|jtd�tdz�|jtd	�tdz�|jtt	dd��d�|jtt	dd
��d
�|jtt	d
d��t�|jtt	d
d
��t�|jtt	t
d
��t�|jtt	t
d��t�|jtt	t
t
��dtz�|jtt	dt
��tdz�|jtt	d
t
��tdz�|jtt	dt
��tdz�|jtt	d
t
��tdz�|jtt	t
t
��tdz�|jtt	t
d��d
�|jtt	t
d
��d
�|jtt	t
d��d�|jtt	t
d
��d�|jtt	t
t
��tdz�|jtt	d
t
��tdz�|jtt	dt
��tdz�|jtt	d
t
��tdz�|jtt	dt
��tdz�|jtt	t
t
��dtz�|jtt	t
d
��t�|jtt	t
d��t�tD]/}|jtjt|����1y)Nrrr9r�y�Y��n�y�Y��n��r�r�y��rrg�rr�g�?)
rTrrr\r��INF�complex_nansr]r:r;�r2r�s  r)�
test_phasezCMathTests.test_phase�s������u�Q�x��,����u�R�y�"�-����u�S�z�2�.����u�[�1�2�6����u�[�1�B�3�7����u�R�y�"�Q�$�/����u�S�z�B�3�q�5�1�	
����w�s�C�0�1�3�7�����w�s�D�1�2�D�9�����w�t�S�1�2�B�7�����w�t�T�2�3�b�S�9�	
���u�W�c�T�4�%8�9�B�3�?����u�W�c�T�4�%8�9�B�3�?����u�W�c�T�C�4�%8�9�5��8�D����u�W�T�C�4�%8�9�B�3�q�5�A����u�W�T�C�4�%8�9�B�3�q�5�A����u�W�S�3�$�%7�8�2�#�a�%�@����u�W�S�3�$�%7�8�2�#�a�%�@����u�W�S�3�$�%7�8�2�#�a�%�@�����w�s�D�1�2�D�9�����w�s�D�1�2�D�9�����w�s�C�0�1�3�7�����w�s�C�0�1�3�7����u�W�S�#�%6�7��A��>����u�W�S�#�%6�7��A��>����u�W�S�#�%6�7��A��>����u�W�T�3�%7�8�"�Q�$�?����u�W�T�3�%7�8�"�Q�$�?����u�W�c�T�3�%7�8�$�r�'�B����u�W�c�T�3�%7�8�"�=����u�W�c�T�3�%7�8�"�=��	2�A��O�O�D�J�J�u�Q�x�0�1�	2r+c
�^�tD]}|jt|�d��tD]!}|jt|�t��#|jtttt��t�|jtjtttd����|jtjtttd����|jtjtttd����|jtjtttd����|jtttt��t�|jtttt��t�|jtjttdt����|jtjttdt����|jtjttdt����|jtjttdt����|jtttt��t�|jtjtttt����y)Nrrrr)
�
complex_zerosr\rH�complex_infinitiesr�r��NANr]r:r;r�s  r)�test_abszCMathTests.test_abs�s����	*�A����S��V�S�)�	*�$�	*�A����S��V�S�)�	*�	
����W�S�3�$�/�0�#�6�����
�
�3�w�s�D�'9�#:�;�<�����
�
�3�w�s�D�'9�#:�;�<�����
�
�3�w�s�C�'8�#9�:�;�����
�
�3�w�s�C�'8�#9�:�;�����W�S�#�.�/��5�����W�c�T�3�/�0�#�6�����
�
�3�w�t�S�'9�#:�;�<�����
�
�3�w�t�S�'9�#:�;�<�����
�
�3�w�s�C�'8�#9�:�;�����
�
�3�w�s�C�'8�#9�:�;�����W�S�#�.�/��5�����
�
�3�w�s�C�'8�#9�:�;r+c�N�|jtttdd��y)Ng��U���)r�rJrHr�r1s r)�test_abs_overflowszCMathTests.test_abs_overflows�s��	
���-��g�g�w�.G�Hr+c��d}t|j|dz
�|kDst|j|dz
�|kDr|j||f�yy)NgH�����z>rra)rHrCrDr=)r2rKrL�epss    r)�assertCEqualzCMathTests.assertCEqualsN�����q�v�v��!��}���#�s�1�6�6�A�a�D�=�'9�C�'?��I�I�q�!�f��(@r+c�D�|jtdd�d�|jtdd�d�|jtdt�d�|jtdtdz�d�|jtdtdz�d�y)	Nr)rrra)r9r)r�rr�)rr9)rr�)rr
rr1s r)�	test_rectzCMathTests.test_rects|�����$�q�!�*�f�-����$�q�!�*�g�.����$�q�2�#�,��1����$�q�"�Q�$�-��1����$�q�2�#�a�%�.�(�3r+c	��td�ddddtd�td�g}|D]d}|D]]}t||�}|jtj|�tj|�xrtj|���_�fy)Nz-infrrrrrr
)r�r�r\r&�isfiniter:)r2�	real_valsr(r?r�s     r)�
test_isfinitezCMathTests.test_isfinites����6�]�D�$��#�u�U�|�U�5�\�;�	��	I�A��
I���A�q�M��� � �����!2�"&�-�-��"2�"G�t�}�}�Q�7G�I�
I�	Ir+c�@�|jtjd��|jtjd��|jtjt��|j	tjt
��|j	tjt
t
d���|j	tjt
dt
���|j	tjt
t
t
���|j	tjt
t
t���|j	tjt
tt
���y�Nrar�r)�assertFalser&r;r�r]rr�r1s r)�
test_isnanzCMathTests.test_isnan����������Q��(�������R��)�������S�)�*�������C�(�)�������G�C��O�4�5�������G�A�s�O�4�5�������G�C��$5�6�7�������G�C��$5�6�7�������G�C��$5�6�7r+c�@�|jtjd��|jtjd��|jtjt��|j	tjt
��|j	tjt
t
d���|j	tjt
dt
���|j	tjt
t
t
���|j	tjt
tt
���|j	tjt
t
t���yr)rr&rGrr]r�r�r1s r)�
test_isinfzCMathTests.test_isinf rr+c�d�tD]'}|jtj|�|��)yr5)r�rEr&r#r�s  r)�testTanhSignzCMathTests.testTanhSign+�)���	:�A��'�'��
�
�1�
�q�9�	:r+c�d�tD]'}|jtj|�|��)yr5)r�rEr&rr�s  r)�testAtanSignzCMathTests.testAtanSign4rr+c�d�tD]'}|jtj|�|��)yr5)r�rEr&rr�s  r)�
testAtanhSignzCMathTests.testAtanhSign9s)���	;�A��'�'����A���:�	;r+)r�r�N)"rlrmrnr�r&r��appendr3r7rArErPrXr_r�r�r�rr�r�r�rr�r�rrrr	r
rrrrr)�.0�fnamer�r&s0000r)rr4s9��:#�$�$��g�e�U�+�$�N�
���=�>����:�;�=�!�$�.2�CI�#�0K�dK�3�,DF�L
5�.-�`�T;��T;�l.�8 ��	/��	/�'2�R<�2�I��I��
4�I�	8�	8��:��:��:��:��;��;��I$s�B:
rc�<�eZdZejZd�Zd�Zd�Zd�Zy)�IsCloseTestsc�z�|jt�5|jddd��ddd�|jt�5|jddd��ddd�|jt�5|jdddd��ddd�y#1swY�oxYw#1swY�IxYw#1swYyxYw)Nr���rel_tol��abs_tol)r#r%)r�r��iscloser1s r)�test_reject_complex_tolerancesz+IsCloseTests.test_reject_complex_tolerancesBs���
�
�
�y�
)�	-��L�L��R��L�,�	-��
�
�y�
)�	-��L�L��R��L�,�	-��
�
�y�
)�	9��L�L��R��R�L�8�	9�	9�
	-�	-��	-�	-��	9�	9�s#�B�B%�:B1�B"�%B.�1B:c�X�gd�}|j|d��|j|d��y)N))��?�?y��?�?)r)y�?��?)y��?y���?)y�?�y�?������g�-���q=r"g�vIh�%<=)�assertAllClose�assertAllNotClose)r2�complex_exampless  r)�test_complex_valuesz IsCloseTests.test_complex_valuesLs4����	
���,�e��<����/���?r+c��gd�}|j|d��|j|d��|jddd��|jddd��y)	N))y����MbP?r)���MbP?r)�����MbP?����MbP?r)y����MbP�����MbP?r)�����MbP?����MbP�r)y����MbP�����MbP�rg�~j�t�X?r$g����Mb@?r1r0g����Mb`?r/)r*r+�
assertIsClose�assertIsNotClose)r2�near_zero_exampless  r)�test_complex_near_zeroz#IsCloseTests.test_complex_near_zeroWs^�� ��	
���.���@����1�7��C����<��u��E����l�L�%��Hr+c�B�|jttdz�|jtdzt�|jtt�|jtt�|jdt�|jdtdz�y)Nr�r)r3r�r1s r)�test_complex_specialz!IsCloseTests.test_complex_specialgsr�����c�3�r�6�*����c�"�f�c�*����c�C�4�(����s�d�C�(����a��%����a��R��(r+N)	rlrmrnr&r&r'r-r5r7ror+r)r r ?s!���m�m�G�9�	@�I� )r+r �__main__)�test.supportrrr�test.test_mathrr�	test_math�unittestr&r:rr	r
rr�r�r�r�rr�r�rr��TestCaserr rl�main)r(r?s00r)�<module>r?s���G�G�4�"���(�(��
��E�l���E�l��(3�I�1�[�I����A��I��I�
�	�c�
�	�c�
�	�c�
�	�c�
�	�c�
�	
�s��	
�s��

��s��

��s��

��s��

��t��

��t��

���t��	
��t��	
��t��	�s�d��	�s�d��	�s�d��	�d��	�d��)1
����1�g�a��m���.

�s�d��	�d��	�d��	�c�
�	�c�
�	�c�
�

��s��	
�s��	
�s��	�c�
�	�c�
�	�c�
�
+
�
�$�!�Q���1�
�
��H;��"�"�H;�V.)�9�)�)�.)�b�z���H�M�M�O���EJ����,
s�E�6E�8E