ó
‹wÛjc           @   s«  d  d l  m Z m Z d  d l Z d  d l Z d  d l Z d  d l Z d  d l Z d  d l Z d Z	 e
 d ƒ Z e
 d ƒ Z e
 d ƒ Z e j e
 j d ƒ j d ƒ d	 ƒ Z d
 d f \ Z Z e e d
 d k Z e d k rî e j d Z n e Z e j j e ƒ pe j Z e j j e d ƒ Z e j j e d ƒ Z d „  Z  d d „ Z! d d d „ Z" d „  Z# d „  Z$ d e j% f d „  ƒ  YZ& d „  Z' e d k r§e' ƒ  n  d S(   iÿÿÿÿ(   t   run_unittestt   verboseNgñhãˆµøä>t   nant   infs   -inft   doublet   IEEEs   test requires IEEE 754 doublesg €à7yÃACgÇ):’Ëÿ@i   t   __main__i    s   math_testcases.txts   cmath_testcases.txtc         C   s@   t  j d t  j d |  ƒ ƒ d } | d k  r< | d } n  | S(   sV  Convert a non-NaN float x to an integer, in such a way that
    adjacent floats are converted to adjacent integers.  Then
    abs(ulps(x) - ulps(y)) gives the difference in ulps between two
    floats.

    The results from this function will only make sense on platforms
    where C doubles are represented in IEEE 754 binary64 format.

    s   <qs   <di    i   i?   l            (   t   structt   unpackt   pack(   t   xt   n(    (    s„   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_math.pyt   to_ulps$   s    
"i   c         C   s<   t  | ƒ t  |  ƒ } t | ƒ | k r, d Sd j | | ƒ S(   s©   Given non-NaN floats `expected` and `got`,
    check that they're equal to within the given number of ulps.

    Returns None on success and an error message on failure.s*   error = {} ulps; permitted error = {} ulpsN(   R   t   abst   Nonet   format(   t   expectedt   gott   ulpst
   ulps_error(    (    s„   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_math.pyt
   ulps_check3   s
    	gVçž¯â<g
       c         C   sh   t  j |  ƒ r | |  k r d S| |  } t | | t |  ƒ ƒ } t | ƒ | k  rX d Sd j | | ƒ S(   s  Determine whether non-NaN floats 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.s    error = {}; permitted error = {}N(   t   matht   isinfR   t   maxR   R   (   R   R   t   rel_errt   abs_errt   errort   permitted_error(    (    s„   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_math.pyt	   acc_check?   s    
	c      
   c   sÈ   t  |  ƒ �¶ } x¬ | D]¤ } d | k r> | | j d ƒ  } n  | j ƒ  sP q n  | j d ƒ \ } } | j ƒ  \ } } } | j ƒ  } | d }	 | d }
 | | t | ƒ t |	 ƒ |
 f Vq WWd QXd S(   sÏ   Parse a file with test values

    -- starts a comment
    blank lines, or lines containing only a comment, are ignored
    other lines are expected to have the form
      id fn arg -> expected [flag]*

    s   --s   ->i    i   N(   t   opent   indext   stript   splitt   float(   t   fnamet   fpt   linet   lhst   rhst   idt   fnt   argt
   rhs_piecest   expt   flags(    (    s„   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_math.pyt   parse_mtestfileR   s    	

c         c   sÖ   t  |  ƒ �Ä } xº | D]² } | j d ƒ s | j ƒ  r> q n  | j d ƒ \ } } | j ƒ  \ } } } } | j ƒ  }	 |	 d |	 d }
 } |	 d } | | t | ƒ t | ƒ t |
 ƒ t | ƒ | f Vq WWd QXd S(   s“   Parse a file with test values

    Empty lines or lines starting with -- are ignored
    yields id, fn, arg_real, arg_imag, exp_real, exp_imag
    s   --s   ->i    i   i   N(   R   t
   startswithR   R    R!   (   R"   R#   R$   R%   R&   R'   R(   t   arg_realt   arg_imagR*   t   exp_realt   exp_imagR,   (    (    s„   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_math.pyt   parse_testfilek   s    
t	   MathTestsc           B   sÊ  e  Z d  „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z	 d „  Z
 d	 „  Z e d
 „  ƒ Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z e e j e d ƒ d „  ƒ ƒ Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z  d „  Z! d „  Z" d „  Z# d „  Z$ d  „  Z% d! „  Z& d" „  Z' d# „  Z( d$ „  Z) d% „  Z* e j+ e, d& ƒ d' „  ƒ Z- e d( „  ƒ Z. e j+ e/ j0 d) ƒ j1 d* ƒ d+ ƒ d, „  ƒ Z2 RS(-   c         C   s7   t  | | ƒ t k r3 |  j d | | | f ƒ n  d  S(   Ns   %s returned %r, expected %r(   R   t   epst   fail(   t   selft   namet   valueR   (    (    s„   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_math.pyt   ftest…   s    	c         C   s0   |  j  d t j d ƒ |  j  d t j d ƒ d  S(   Nt   pigJØMû!	@t   egB‡
¿@(   R:   R   R;   R<   (   R7   (    (    s„   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_math.pyt   testConstantsŽ   s    c         C   sÀ   |  j  t t j ƒ |  j d t j d ƒ t j ƒ |  j d t j d ƒ t j d ƒ |  j d t j d ƒ d ƒ |  j  t t j t ƒ |  j  t t j t ƒ |  j	 t j
 t j t ƒ ƒ ƒ d  S(   Ns   acos(-1)iÿÿÿÿs   acos(0)i    i   s   acos(1)i   (   t   assertRaisest	   TypeErrorR   t   acosR:   R;   t
   ValueErrort   INFt   NINFt
   assertTruet   isnant   NAN(   R7   (    (    s„   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_math.pyt   testAcos’   s    #c         C   sÉ   |  j  t t j ƒ |  j d t j d ƒ d ƒ |  j d t j d ƒ d ƒ |  j  t t j d ƒ |  j  t t j d ƒ |  j t j t ƒ t ƒ |  j  t t j t ƒ |  j	 t j
 t j t ƒ ƒ ƒ d  S(   Ns   acosh(1)i   i    s   acosh(2)i   g5˜qBõ?iÿÿÿÿ(   R>   R?   R   t   acoshR:   RA   t   assertEqualRB   RC   RD   RE   RF   (   R7   (    (    s„   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_math.pyt	   testAcosh›   s    c         C   sÅ   |  j  t t j ƒ |  j d t j d ƒ t j d ƒ |  j d t j d ƒ d ƒ |  j d t j d ƒ t j d ƒ |  j  t t j t ƒ |  j  t t j t ƒ |  j	 t j
 t j t ƒ ƒ ƒ d  S(   Ns   asin(-1)iÿÿÿÿi   s   asin(0)i    s   asin(1)i   (   R>   R?   R   t   asinR:   R;   RA   RB   RC   RD   RE   RF   (   R7   (    (    s„   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_math.pyt   testAsin¥   s    $#c         C   s¼   |  j  t t j ƒ |  j d t j d ƒ d ƒ |  j d t j d ƒ d ƒ |  j d t j d ƒ d ƒ |  j t j t ƒ t ƒ |  j t j t ƒ t ƒ |  j t j	 t j t
 ƒ ƒ ƒ d  S(	   Ns   asinh(0)i    s   asinh(1)i   g'Ôya64ì?s	   asinh(-1)iÿÿÿÿg'Ôya64ì¿(   R>   R?   R   t   asinhR:   RI   RB   RC   RD   RE   RF   (   R7   (    (    s„   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_math.pyt	   testAsinh®   s    c         C   sà   |  j  t t j ƒ |  j d t j d ƒ t j d ƒ |  j d t j d ƒ d ƒ |  j d t j d ƒ t j d ƒ |  j d t j t ƒ t j d	 ƒ |  j d
 t j t ƒ t j d	 ƒ |  j t j	 t j t
 ƒ ƒ ƒ d  S(   Ns   atan(-1)iÿÿÿÿi   s   atan(0)i    s   atan(1)i   s	   atan(inf)i   s
   atan(-inf)(   R>   R?   R   t   atanR:   R;   RB   RC   RD   RE   RF   (   R7   (    (    s„   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_math.pyt   testAtan·   s    $##$c         C   sâ   |  j  t t j ƒ |  j d t j d ƒ d ƒ |  j d t j d ƒ d ƒ |  j d t j d ƒ d ƒ |  j  t t j d	 ƒ |  j  t t j d
 ƒ |  j  t t j t ƒ |  j  t t j t ƒ |  j	 t j
 t j t ƒ ƒ ƒ d  S(   Ns   atanh(0)i    s
   atanh(0.5)g      à?g­zê“á?s   atanh(-0.5)g      à¿g­zê“á¿i   iÿÿÿÿ(   R>   R?   R   RO   R:   t   atanhRA   RB   RC   RD   RE   RF   (   R7   (    (    s„   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_math.pyt	   testAtanhÀ   s    c         C   sî  |  j  t t j ƒ |  j d t j d d ƒ t j d ƒ |  j d t j d d ƒ t j d ƒ |  j d t j d d ƒ d ƒ |  j d	 t j d d ƒ t j d ƒ |  j d
 t j d d ƒ t j d ƒ |  j d t j d t ƒ t j ƒ |  j d t j d d ƒ t j ƒ |  j d t j d d ƒ t j ƒ |  j t j d d ƒ d ƒ |  j t j d d ƒ d ƒ |  j t j d t ƒ d ƒ |  j	 t j
 t j d t ƒ ƒ ƒ |  j d t j d t ƒ t j ƒ |  j d t j d d ƒ t j ƒ |  j d t j d d ƒ t j ƒ |  j t j d d ƒ d ƒ |  j t j d d ƒ d ƒ |  j t j d t ƒ d ƒ |  j	 t j
 t j d t ƒ ƒ ƒ |  j d t j t t ƒ t j d d ƒ |  j d t j t d ƒ t j d ƒ |  j d t j t d ƒ t j d ƒ |  j d t j t d ƒ t j d ƒ |  j d t j t d ƒ t j d ƒ |  j d t j t t ƒ t j d ƒ |  j	 t j
 t j t t ƒ ƒ ƒ |  j d t j t t ƒ t j d d ƒ |  j d t j t d ƒ t j d ƒ |  j d t j t d ƒ t j d ƒ |  j d t j t d ƒ t j d ƒ |  j d  t j t d ƒ t j d ƒ |  j d! t j t t ƒ t j d ƒ |  j	 t j
 t j t t ƒ ƒ ƒ |  j d" t j d t ƒ t j ƒ |  j d# t j d d ƒ t j d ƒ |  j d$ t j d d ƒ t j d ƒ |  j t j d t ƒ d ƒ |  j	 t j
 t j d t ƒ ƒ ƒ |  j d% t j d t ƒ t j ƒ |  j d& t j d d ƒ t j d ƒ |  j d' t j d d ƒ t j d ƒ |  j t j d t ƒ d ƒ |  j	 t j
 t j d t ƒ ƒ ƒ |  j	 t j
 t j t t ƒ ƒ ƒ |  j	 t j
 t j t d ƒ ƒ ƒ |  j	 t j
 t j t d ƒ ƒ ƒ |  j	 t j
 t j t d ƒ ƒ ƒ |  j	 t j
 t j t d ƒ ƒ ƒ |  j	 t j
 t j t t ƒ ƒ ƒ |  j	 t j
 t j t t ƒ ƒ ƒ d  S((   Ns   atan2(-1, 0)iÿÿÿÿi    i   s   atan2(-1, 1)i   i   s   atan2(0, 1)s   atan2(1, 1)s   atan2(1, 0)s   atan2(0., -inf)g        s   atan2(0., -2.3)gffffffÀs   atan2(0., -0.)g       €gffffff@s   atan2(-0., -inf)s   atan2(-0., -2.3)s   atan2(-0., -0.)s   atan2(inf, -inf)i   s   atan2(inf, -2.3)s   atan2(inf, -0.)s   atan2(inf, 0.)s   atan2(inf, 2.3)s   atan2(inf, inf)s   atan2(-inf, -inf)s   atan2(-inf, -2.3)s   atan2(-inf, -0.)s   atan2(-inf, 0.)s   atan2(-inf, 2.3)s   atan2(-inf, inf)s   atan2(2.3, -inf)s   atan2(2.3, -0.)s   atan2(2.3, 0.)s   atan2(-2.3, -inf)s   atan2(-2.3, -0.)s   atan2(-2.3, 0.)(   R>   R?   R   t   atan2R:   R;   RC   RI   RB   RD   RE   RF   (   R7   (    (    s„   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_math.pyt	   testAtan2Ë   sf    ''&&""""###"*&&&&&"+'''''""&&"#''"""""""c         C   s  |  j  t t j ƒ |  j t t t j d ƒ ƒ ƒ |  j t t t j d ƒ ƒ ƒ |  j t t t j d ƒ ƒ ƒ |  j d t j d ƒ d ƒ |  j d t j d ƒ d ƒ |  j d t j d ƒ d	 ƒ |  j d
 t j d ƒ d ƒ |  j d t j d ƒ d ƒ |  j d t j d ƒ d ƒ |  j t j t ƒ t ƒ |  j t j t	 ƒ t	 ƒ |  j
 t j t j t ƒ ƒ ƒ d t f d „  ƒ  Y} d t f d „  ƒ  Y} |  j d t j | ƒ  ƒ d ƒ |  j  t t j | ƒ  ƒ | ƒ  } d „  | _ |  j  t t j | ƒ |  j  t t j | d ƒ d  S(   Ni   l    g      ð?s	   ceil(0.5)g      à?s	   ceil(1.0)s	   ceil(1.5)g      ø?i   s
   ceil(-0.5)g      à¿i    s
   ceil(-1.0)g      ð¿iÿÿÿÿs
   ceil(-1.5)g      ø¿t   TestCeilc           B   s   e  Z d  „  Z RS(   c         S   s   d S(   Ngfffff¦D@(    (   R7   (    (    s„   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_math.pyt	   __float__  s    (   t   __name__t
   __module__RV   (    (    (    s„   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_math.pyRU     s   t
   TestNoCeilc           B   s   e  Z RS(    (   RW   RX   (    (    (    s„   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_math.pyRY     s   s   ceil(TestCeil())i*   c          W   s   |  S(   N(    (   t   args(    (    s„   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_math.pyt   <lambda>!  t    (   R>   R?   R   t   ceilRI   R!   t   typeR:   RB   RC   RD   RE   RF   t   objectt   __ceil__(   R7   RU   RY   t   t(    (    s„   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_math.pyt   testCeil  s*    	c         C   s¿  |  j  t j d d ƒ d ƒ |  j  t j d d ƒ d ƒ |  j  t j d d ƒ d ƒ |  j  t j d d ƒ d ƒ |  j  t j d	 d
 ƒ d ƒ |  j t t j ƒ |  j  t j d d ƒ d ƒ |  j  t j d d
 ƒ d ƒ |  j  t j t d ƒ t ƒ |  j  t j t d
 ƒ t ƒ |  j  t j t d ƒ t ƒ |  j  t j t d
 ƒ t ƒ |  j  t j d t ƒ d ƒ |  j  t j d t ƒ d ƒ |  j  t j t t ƒ t ƒ |  j  t j t t ƒ t ƒ |  j  t j t t ƒ t ƒ |  j  t j t t ƒ t ƒ |  j t j t j t	 d ƒ ƒ ƒ |  j t j t j t	 t ƒ ƒ ƒ |  j t j t j t	 t ƒ ƒ ƒ |  j t j t j t	 t	 ƒ ƒ ƒ |  j t j
 t j t t	 ƒ ƒ ƒ |  j  t t j d t	 ƒ ƒ d ƒ d  S(   Ni   i*   g      ð?g        iÖÿÿÿg      ð¿i   g      @g      @g       €g      Àg       @(   RI   R   t   copysignR>   R?   RB   RC   RD   RE   RF   R   R   (   R7   (    (    s„   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_math.pyt   testCopysign%  s0    """""c         C   s:  |  j  t t j ƒ |  j d t j t j d ƒ d ƒ |  j d t j d ƒ d ƒ |  j d t j t j d ƒ d ƒ |  j d t j t j ƒ d ƒ yB |  j t j t j t ƒ ƒ ƒ |  j t j t j t	 ƒ ƒ ƒ Wn= t
 k
 r|  j  t
 t j t ƒ |  j  t
 t j t	 ƒ n X|  j t j t j t ƒ ƒ ƒ d  S(	   Ns
   cos(-pi/2)i   i    s   cos(0)i   s	   cos(pi/2)s   cos(pi)iÿÿÿÿ(   R>   R?   R   t   cosR:   R;   RD   RE   RB   RC   RA   RF   (   R7   (    (    s„   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_math.pyt   testCosG  s    $##c         C   sµ   |  j  t t j ƒ |  j d t j d ƒ d ƒ |  j d t j d ƒ d t j d ƒ d d ƒ |  j t j t ƒ t ƒ |  j t j t ƒ t ƒ |  j t j	 t j t
 ƒ ƒ ƒ d  S(   Ns   cosh(0)i    i   s   cosh(2)-2*cosh(1)**2i   iÿÿÿÿ(   R>   R?   R   t   coshR:   RI   RB   RC   RD   RE   RF   (   R7   (    (    s„   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_math.pyt   testCoshU  s    1c         C   s}   |  j  t t j ƒ |  j d t j t j ƒ d ƒ |  j d t j t j d ƒ d ƒ |  j d t j t j d ƒ d ƒ d  S(	   Ns   degrees(pi)g     €f@s   degrees(pi/2)i   g     €V@s   degrees(-pi/4)i   g     €FÀ(   R>   R?   R   t   degreesR:   R;   (   R7   (    (    s„   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_math.pyt   testDegrees]  s    #c         C   sÆ   |  j  t t j ƒ |  j d t j d ƒ d t j ƒ |  j d t j d ƒ d ƒ |  j d t j d ƒ t j ƒ |  j t j t ƒ t ƒ |  j t j t ƒ d ƒ |  j	 t j
 t j t ƒ ƒ ƒ d  S(   Ns   exp(-1)iÿÿÿÿi   s   exp(0)i    s   exp(1)g        (   R>   R?   R   R+   R:   R<   RI   RB   RC   RD   RE   RF   (   R7   (    (    s„   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_math.pyt   testExpc  s    #c         C   sk   |  j  t t j ƒ |  j d t j d ƒ d ƒ |  j d t j d ƒ d ƒ |  j d t j d ƒ d ƒ d  S(   Ns   fabs(-1)iÿÿÿÿi   s   fabs(0)i    s   fabs(1)(   R>   R?   R   t   fabsR:   (   R7   (    (    s„   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_math.pyt   testFabsl  s    c      	   C   sÍ   d „  } t  d ƒ d d d g } t j | ƒ xh | D]` } xW t t t f D]F } |  j t j | | ƒ ƒ | | ƒ | | | ƒ t j | ƒ f ƒ qL Wq6 W|  j	 t
 t j d ƒ |  j	 t
 t j t j ƒ d  S(   Nc         S   s8   d } x+ t  d t |  ƒ d ƒ D] } | | 9} q  W| S(   Ni   (   t   ranget   int(   R   t   resultt   i(    (    s„   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_math.pyt   facts  s     i
   i2   id   iô  iÿÿÿÿ(   Rn   t   randomt   shuffleRo   t   longR!   RI   R   t	   factorialR>   RA   R;   (   R7   Rr   t   valuesR
   t   cast(    (    s„   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_math.pyt   testFactorialr  s    	Hc         C   sM  |  j  t t j ƒ |  j t t t j d ƒ ƒ ƒ |  j t t t j d ƒ ƒ ƒ |  j t t t j d ƒ ƒ ƒ |  j d t j d ƒ d ƒ |  j d t j d ƒ d ƒ |  j d t j d	 ƒ d ƒ |  j d
 t j d ƒ d ƒ |  j d t j d ƒ d ƒ |  j d t j d ƒ d ƒ |  j d t j d ƒ d ƒ |  j d t j d ƒ d ƒ |  j t j t	 ƒ t	 ƒ |  j t j t
 ƒ t
 ƒ |  j t j t j t ƒ ƒ ƒ d t f d „  ƒ  Y} d t f d „  ƒ  Y} |  j d t j | ƒ  ƒ d ƒ |  j  t t j | ƒ  ƒ | ƒ  } d „  | _ |  j  t t j | ƒ |  j  t t j | d ƒ d  S(   Ni   l    g      ð?s
   floor(0.5)g      à?i    s
   floor(1.0)s
   floor(1.5)g      ø?s   floor(-0.5)g      à¿iÿÿÿÿs   floor(-1.0)g      ð¿s   floor(-1.5)g      ø¿iþÿÿÿs   floor(1.23e167)g‚àNÝ¯ bs   floor(-1.23e167)g‚àNÝ¯ ât	   TestFloorc           B   s   e  Z d  „  Z RS(   c         S   s   d S(   Ngfffff&E@(    (   R7   (    (    s„   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_math.pyRV   •  s    (   RW   RX   RV   (    (    (    s„   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_math.pyRz   ”  s   t   TestNoFloorc           B   s   e  Z RS(    (   RW   RX   (    (    (    s„   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_math.pyR{   —  s   s   floor(TestFloor())i*   c          W   s   |  S(   N(    (   RZ   (    (    s„   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_math.pyR[   �  R\   (   R>   R?   R   t   floorRI   R!   R^   R:   R]   RB   RC   RD   RE   RF   R_   t	   __floor__(   R7   Rz   R{   Ra   (    (    s„   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_math.pyt	   testFloor€  s.    	c         C   sC  |  j  t t j ƒ |  j d t j d d ƒ d ƒ |  j d t j d d ƒ d ƒ |  j d t j d d ƒ d ƒ |  j d	 t j d
 d ƒ d ƒ |  j d t j d
 d ƒ d ƒ |  j d t j d
 d ƒ d ƒ |  j t j t j t d ƒ ƒ ƒ |  j t j t j d t ƒ ƒ ƒ |  j t j t j t t ƒ ƒ ƒ |  j  t t j d d ƒ |  j  t t j t	 d ƒ |  j  t t j t
 d ƒ |  j  t t j t	 d ƒ |  j t j d t	 ƒ d ƒ |  j t j d t	 ƒ d ƒ |  j t j d t
 ƒ d ƒ |  j t j d t
 ƒ d ƒ |  j t j d d ƒ d ƒ |  j t j d t
 ƒ d ƒ d  S(   Ns
   fmod(10,1)i
   i   i    s   fmod(10,0.5)g      à?s   fmod(10,1.5)g      ø?s   fmod(-10,1)iöÿÿÿs   fmod(-10,0.5)s   fmod(-10,1.5)iÿÿÿÿg      ð?g        g      @g      À(   R>   R?   R   t   fmodR:   RD   RE   RF   RA   RB   RC   RI   (   R7   (    (    s„   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_math.pyt   testFmod¡  s(    """c            sç   ˆ  j  t t j ƒ ‡  f d †  } | d t j d ƒ d ƒ | d t j d ƒ d ƒ | d t j d ƒ d ƒ | d
 t j d ƒ d ƒ ˆ  j t j t ƒ d t ƒ ˆ  j t j t ƒ d t ƒ ˆ  j t j t j t	 ƒ d ƒ ƒ d  S(   Nc            sh   | | \ } } \ } } t  | | ƒ t k s; | | k rd ˆ  j d |  | | f | | f f ƒ n  d  S(   Ns   %s returned %r, expected %r(   R   R5   R6   (   R8   Rp   R   t   mantR+   t   emantt   eexp(   R7   (    s„   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_math.pyt	   testfrexpº  s    "	s	   frexp(-1)iÿÿÿÿg      à¿i   s   frexp(0)i    s   frexp(1)g      à?s   frexp(2)i   (   g      à¿i   (   i    i    (   g      à?i   (   g      à?i   (
   R>   R?   R   t   frexpRI   RB   RC   RD   RE   RF   (   R7   R„   (    (   R7   s„   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_math.pyt	   testFrexp·  s    s2   fsum is not exact on machines with double roundingc            sR  d d l  m } | j ‰ | j ˆ ‰  ‡  ‡ f d †  } g  d f d g d f d d d d d	 d
 d g d f d1 d d3 g d5 f d6 d d7 g d9 f d; d d< g d> f d@ d dA g dC f g  t d d ƒ D] } d | ^ qÃ t j d ƒ f g  t d d ƒ D] } d
 | | ^ qõ t j d ƒ f g  t d ƒ D] } d | d d | ^ q(dE g d
 f d d d g d f dF d dG dI d dJ g d f g  t d  d! d" ƒ D]( } d | d | d# d | d$ ^ q—dL g t j d& ƒ f g } x› t | ƒ D]� \ } \ } } y t j	 | ƒ } WnU t
 k
 r=|  j d' | | | f ƒ n+ t k
 rg|  j d( | | | f ƒ n X|  j | | ƒ qëWd d) l m }	 m }
 m } x³ t d ƒ D]¥ } d* d d+ d d, d- g d. } d/ } xE t d0 ƒ D]7 } |
 d/ |	 ƒ  ƒ d* | } | | 7} | j | ƒ qÚW| | ƒ | | ƒ } |  j | | ƒ t j	 | ƒ ƒ q¥Wd  S(M   Niÿÿÿÿ(   t
   float_infoc            s"  d \ } } x� |  D]y } t  j | ƒ \ } } t t  j | ˆ ƒ ƒ | ˆ } } | | k rt | | | K} | } n | | | K} | | 7} q Wt t t t | ƒ ƒ ƒ d ˆ ˆ  | ƒ } | d k rd | d >} | d | t | | @oþ | d | d @ƒ } | | 7} n  t  j | | ƒ S(   sÓ   Full precision summation.  Compute sum(iterable) without any
            intermediate accumulation of error.  Based on the 'lsum' function
            at http://code.activestate.com/recipes/393090/

            i    i   i   i   (   i    i    (	   R   R…   Ro   t   ldexpR   t   lent   binR   t   bool(   t   iterablet   tmantt   texpR
   R�   R+   t   tailt   h(   t   etinyt   mant_dig(    s„   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_math.pyt   msumÜ  s    #	-.g        g}Ã”%­I²Tg      ð?g}Ã”%­I²Ôg0Žä.ÿ++gšd~ÅQJg      ð¿gšd~ÅQÊg       @i5   g      à¿iÊÿÿÿiœÿÿÿg      $@g      (@g      @g      à?g      @i   ié  s   0x1.df11f45f4e61ap+2s   -0x1.62a2af1bd3624p-1iè  g333333û?g €à7yÃACg¼‰Ø—²Òœ<g€à7yÃACiËÿÿÿiÎûÿÿiÌ  i   i2   i4   iþ  s   0x1.5555555555555p+970sD   test %d failed: got OverflowError, expected %r for math.fsum(%.100r)sA   test %d failed: got ValueError, expected %r for math.fsum(%.100r)(   Rs   t   gaussRt   i   iùÿÿÿghŠ$.5�ú»g#B’¡œ÷;i
   i    iÈ   g      @Cg      �<g      �¼g      @Cgÿÿÿÿÿÿ?Cg      @Cg      °9g      @Cg     @Cg      @Cg     @Cg      °9g      @Cg     @Cg      @Cgüÿÿÿÿÿ?Cg      �<g      @Cgýÿÿÿÿÿ?CgáïþáÒ-ÇogáïþáÒ-Çïgÿà7yÃACg       <gÿà7yÃACgÿà7yÃAÃg       <g      Ðg      Ðÿ(   t   sysR‡   R’   t   min_expRn   R!   t   fromhext	   enumerateR   t   fsumt   OverflowErrorR6   RA   RI   Rs   R”   Rt   t   xranget   append(   R7   R‡   R“   R   Rq   t   test_valuest   valsR   t   actualRs   R”   Rt   t   jt   st   v(    (   R‘   R’   s„   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_math.pyt   testFsumÉ  sT    		#'9>		

c         C   s	  |  j  t t j ƒ |  j d t j d d ƒ d ƒ |  j d t j d d ƒ d ƒ |  j t j t t ƒ t ƒ |  j t j t t ƒ t ƒ |  j t j t t ƒ t ƒ |  j t j t t ƒ t ƒ |  j	 t j
 t j d t ƒ ƒ ƒ |  j	 t j
 t j t d ƒ ƒ ƒ d  S(	   Ns
   hypot(0,0)i    s
   hypot(3,4)i   i   i   g      ð?g       À(   R>   R?   R   t   hypotR:   RI   RF   RB   RC   RD   RE   (   R7   (    (    s„   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_math.pyt	   testHypot$  s    "c         C   s  |  j  t t j ƒ |  j d t j d d ƒ d ƒ |  j d t j d d ƒ d ƒ |  j d t j d d ƒ d ƒ |  j d	 t j d d ƒ d
 ƒ |  j  t t j d d ƒ |  j  t t j d d ƒ |  j t j d d ƒ d ƒ |  j t j d d ƒ d ƒ |  j t j t d ƒ t ƒ |  j t j t d ƒ t ƒ |  j	 t j
 t j t d ƒ ƒ ƒ xµd d d d d d g D]›} |  j t j t | ƒ t ƒ |  j t j t | ƒ t ƒ |  j t j d | ƒ d ƒ |  j t j d | ƒ d ƒ |  j t j d | ƒ d ƒ |  j t j d | ƒ d ƒ |  j	 t j
 t j t | ƒ ƒ ƒ |  j  t t j d | ƒ |  j  t t j d | ƒ |  j t j d | ƒ d ƒ |  j t j d | ƒ d ƒ |  j t j t | ƒ t ƒ |  j t j t | ƒ t ƒ |  j	 t j
 t j t | ƒ ƒ ƒ qlWd  S(   Ns
   ldexp(0,1)i    i   s
   ldexp(1,1)i   s   ldexp(1,-1)iÿÿÿÿg      à?s   ldexp(-1,1)iþÿÿÿg      ð?i@B g      ð¿iÀ½ðÿg        g       €i   i+ÿÿÿi
   i   l   
 i   i(   i † l     I äT   l    d(	 l      Fµx:^V l	        «O»z—×pøc(   R>   R?   R   Rˆ   R:   Rš   RI   RB   RC   RD   RE   RF   (   R7   R   (    (    s„   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_math.pyt	   testLdexp/  s6    "#c         C   sb  |  j  t t j ƒ |  j d t j d t j ƒ d ƒ |  j d t j d ƒ d ƒ |  j d t j t j ƒ d ƒ |  j d t j d d	 ƒ d
 ƒ |  j d t j d d ƒ d ƒ |  j d t j d d ƒ d	 ƒ |  j t j t ƒ t ƒ |  j  t t j t	 ƒ |  j
 t j t j t ƒ ƒ ƒ x? t d d ƒ D]. } |  j t j | ƒ t j t | ƒ ƒ ƒ q,Wd  S(   Ns   log(1/e)i   iÿÿÿÿs   log(1)i    s   log(e)s	   log(32,2)i    i   i   s   log(10**40, 10)i
   i(   s   log(10**40, 10**20)i   iè  l	        «O»z—×pøcl	        «O»z—×pøcl      Fµx:^V (   R>   R?   R   t   logR:   R<   RI   RB   RA   RC   RD   RE   RF   Rn   Ru   (   R7   R   (    (    s„   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_math.pyt   testLogO  s    #c         C   s7  |  j  t t j ƒ |  j d t j d t j d ƒ d ƒ |  j d t j d ƒ d ƒ |  j d t j t j d ƒ d ƒ |  j d t j d ƒ t j d ƒ ƒ |  j t j t ƒ t ƒ |  j  t	 t j t
 ƒ |  j t j t j t ƒ ƒ ƒ d } |  j t j | ƒ d
 ƒ |  j t j | ƒ t j t | ƒ ƒ ƒ d  S(   Ns   log1p(1/e -1)i   iÿÿÿÿs   log1p(0)i    s
   log1p(e-1)s   log1p(1)i   iZ   gxá�61O@l                (   R>   R?   R   t   log1pR:   R<   R§   RI   RB   RA   RC   RD   RE   RF   t   assertAlmostEqualR!   (   R7   R   (    (    s„   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_math.pyt	   testLog1p^  s    '#%c         C   sû   |  j  t t j ƒ |  j d t j d ƒ d ƒ |  j d t j d ƒ d ƒ |  j d t j d ƒ d ƒ |  j t j t ƒ t ƒ |  j  t t j t	 ƒ |  j
 t j t j t ƒ ƒ ƒ x? t d d	 ƒ D]. } |  j t j | ƒ t j t | ƒ ƒ ƒ qÅ Wd  S(
   Ns
   log10(0.1)gš™™™™™¹?iÿÿÿÿs   log10(1)i   i    s	   log10(10)i
   iè  (   R>   R?   R   t   log10R:   RI   R§   RB   RA   RC   RD   RE   RF   Rn   Ru   (   R7   R   (    (    s„   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_math.pyt	   testLog10k  s    c            sÙ   ˆ  j  t t j ƒ ‡  f d †  } | d t j d ƒ d ƒ | d t j d ƒ d ƒ ˆ  j t j t ƒ d
 t f ƒ ˆ  j t j t ƒ d t f ƒ t j t ƒ } ˆ  j t j	 | d ƒ ƒ ˆ  j t j	 | d ƒ ƒ d  S(   Nc            sl   | | \ } } \ } } t  | | ƒ t k s? t  | | ƒ rh ˆ  j d |  | | f | | f f ƒ n  d  S(   Ns   %s returned %r, expected %r(   R   R5   R6   (   R8   Rp   R   t   v1t   v2t   e1t   e2(   R7   (    s„   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_math.pyt   testmodfz  s    &	s	   modf(1.5)g      ø?g      à?g      ð?s
   modf(-1.5)g      ø¿g      à¿g      ð¿g        g       €i    i   (   g      à?g      ð?(   g      à¿g      ð¿(
   R>   R?   R   t   modfRI   RB   RC   RF   RD   RE   (   R7   R²   t   modf_nan(    (   R7   s„   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_math.pyt   testModfw  s    c         C   s�  |  j  t t j ƒ |  j d t j d d ƒ d ƒ |  j d t j d d ƒ d ƒ |  j d t j d d ƒ d ƒ |  j d t j d d ƒ d	 ƒ |  j t j t d ƒ t ƒ |  j t j t d ƒ t ƒ |  j t j d t ƒ d
 ƒ |  j t j d t ƒ d
 ƒ |  j t j	 t j t
 d ƒ ƒ ƒ |  j t j	 t j d t
 ƒ ƒ ƒ |  j t j	 t j d t
 ƒ ƒ ƒ |  j t j d t
 ƒ d ƒ |  j t j d t ƒ d ƒ |  j t j d d ƒ d ƒ |  j t j d d ƒ d ƒ |  j t j d d ƒ d ƒ |  j t j d d ƒ d
 ƒ |  j t j d d ƒ d
 ƒ |  j  t t j d d ƒ |  j  t t j d d ƒ |  j  t t j d d ƒ |  j  t t j d t ƒ |  j t j	 t j d t
 ƒ ƒ ƒ |  j t j t t ƒ t ƒ |  j t j t d ƒ t ƒ |  j t j t d ƒ t ƒ |  j t j t d ƒ t ƒ |  j t j t d ƒ d
 ƒ |  j t j t d ƒ d
 ƒ |  j t j t d ƒ d ƒ |  j t j t d ƒ d ƒ |  j t j t d ƒ d ƒ |  j t j t t ƒ d ƒ |  j t j	 t j t t
 ƒ ƒ ƒ |  j t j d t ƒ d ƒ |  j t j d d ƒ d ƒ |  j t j d d ƒ d ƒ |  j t j d d ƒ d ƒ |  j t j d d ƒ d
 ƒ |  j t j d d ƒ d
 ƒ |  j  t t j d d ƒ |  j  t t j d d ƒ |  j  t t j d d ƒ |  j  t t j d t ƒ |  j t j	 t j d t
 ƒ ƒ ƒ |  j t j t t ƒ t ƒ |  j t j t d ƒ t ƒ |  j t j t d ƒ t ƒ |  j t j t d ƒ t ƒ |  j t j t d ƒ d
 ƒ |  j t j t d ƒ d
 ƒ |  j t j t d ƒ d ƒ |  j t j t d ƒ d ƒ |  j t j t d ƒ d ƒ |  j t j t t ƒ d ƒ |  j t j	 t j t t
 ƒ ƒ ƒ |  j t j d t ƒ d
 ƒ |  j t j d d ƒ d ƒ |  j  t t j d d ƒ |  j t j d d ƒ d
 ƒ |  j t j d d ƒ d
 ƒ |  j t j d d ƒ d
 ƒ |  j t j d d ƒ d
 ƒ |  j  t t j d d ƒ |  j t j d d ƒ d ƒ |  j t j d t ƒ d
 ƒ |  j t j	 t j d t
 ƒ ƒ ƒ |  j t j d
 t ƒ d
 ƒ |  j t j d
 d ƒ d
 ƒ |  j t j d
 d ƒ d
 ƒ |  j t j d
 d ƒ d
 ƒ |  j t j d
 d ƒ d
 ƒ |  j t j d
 d ƒ d
 ƒ |  j t j d
 d ƒ d
 ƒ |  j t j d
 d ƒ d
 ƒ |  j t j d
 d ƒ d
 ƒ |  j t j d
 t ƒ d
 ƒ |  j t j d
 t
 ƒ d
 ƒ |  j t j d d ƒ d
 ƒ |  j t j d d ƒ d
 ƒ |  j t j t
 d ƒ d
 ƒ |  j t j d d ƒ d
 ƒ |  j t j d d ƒ d
 ƒ |  j t j t
 d ƒ d
 ƒ |  j  t t j d d ƒ |  j  t t j d d ƒ |  j t j d t ƒ d ƒ |  j t j d t ƒ d ƒ |  j t j d t ƒ t ƒ |  j t j d t ƒ t ƒ |  j t j d t ƒ t ƒ |  j t j d t ƒ t ƒ |  j t j d t ƒ d ƒ |  j t j d t ƒ d ƒ |  j t j d t ƒ t ƒ |  j t j d t ƒ t ƒ |  j t j d t ƒ d ƒ |  j t j d t ƒ d ƒ |  j t j d t ƒ d ƒ |  j t j d t ƒ d ƒ |  j t j d t ƒ t ƒ |  j t j d t ƒ t ƒ |  j d t j d d ƒ d ƒ |  j d  t j d d ƒ d! ƒ |  j d" t j d d
 ƒ d ƒ |  j d# t j d d ƒ d
 ƒ |  j d$ t j d d ƒ d
 ƒ |  j d% t j d d ƒ d& ƒ |  j d' t j d d ƒ d( ƒ |  j d) t j d d ƒ d* ƒ |  j  t t j d d& ƒ |  j  t t j d d	 ƒ d  S(+   Ns   pow(0,1)i    i   s   pow(1,0)s   pow(2,1)i   s	   pow(2,-1)iÿÿÿÿg      à?g      ð?g        g      @gffffff@g       @g       €g       ÀgffffffÀg      Àg      ð¿g      .ÀgÍÌÌÌÌÌÀgffffffþ?gš™™™™™ñ?gÍÌÌÌÌÌì?gš™™™™™¹?gš™™™™™¹¿gÍÌÌÌÌÌì¿gš™™™™™ñ¿gffffffþ¿s	   (-2.)**3.g       Às	   (-2.)**2.g      @s	   (-2.)**1.s	   (-2.)**0.s
   (-2.)**-0.s
   (-2.)**-1.g      à¿s
   (-2.)**-2.g      Ð?s
   (-2.)**-3.g      À¿(   R>   R?   R   t   powR:   RI   RB   RC   RD   RE   RF   RA   (   R7   (    (    s„   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_math.pyt   testPowŠ  sâ    """"""""c         C   s}   |  j  t t j ƒ |  j d t j d ƒ t j ƒ |  j d t j d ƒ t j d ƒ |  j d t j d ƒ t j d ƒ d  S(	   Ns   radians(180)i´   s   radians(90)iZ   i   s   radians(-45)iÓÿÿÿi   (   R>   R?   R   t   radiansR:   R;   (   R7   (    (    s„   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_math.pyt   testRadians  s    #c         C   s  |  j  t t j ƒ |  j d t j d ƒ d ƒ |  j d t j t j d ƒ d ƒ |  j d t j t j d ƒ d ƒ yB |  j t j t j t ƒ ƒ ƒ |  j t j t j t	 ƒ ƒ ƒ Wn= t
 k
 r÷ |  j  t
 t j t ƒ |  j  t
 t j t	 ƒ n X|  j t j t j t ƒ ƒ ƒ d  S(   Ns   sin(0)i    s	   sin(pi/2)i   i   s
   sin(-pi/2)iÿÿÿÿ(   R>   R?   R   t   sinR:   R;   RD   RE   RB   RC   RA   RF   (   R7   (    (    s„   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_math.pyt   testSin%  s    #$#c         C   sÞ   |  j  t t j ƒ |  j d t j d ƒ d ƒ |  j d t j d ƒ d t j d ƒ d d ƒ |  j d t j d ƒ t j d ƒ d ƒ |  j t j t ƒ t ƒ |  j t j t ƒ t ƒ |  j	 t j
 t j t ƒ ƒ ƒ d  S(   Ns   sinh(0)i    s   sinh(1)**2-cosh(1)**2i   i   iÿÿÿÿs   sinh(1)+sinh(-1)(   R>   R?   R   t   sinhR:   Rg   RI   RB   RC   RD   RE   RF   (   R7   (    (    s„   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_math.pyt   testSinh2  s    1)c         C   s¹   |  j  t t j ƒ |  j d t j d ƒ d ƒ |  j d t j d ƒ d ƒ |  j d t j d ƒ d ƒ |  j t j t ƒ t ƒ |  j  t t j t ƒ |  j	 t j
 t j t ƒ ƒ ƒ d  S(   Ns   sqrt(0)i    s   sqrt(1)i   s   sqrt(4)i   i   (   R>   R?   R   t   sqrtR:   RI   RB   RA   RC   RD   RE   RF   (   R7   (    (    s„   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_math.pyt   testSqrt;  s    c         C   s  |  j  t t j ƒ |  j d t j d ƒ d ƒ |  j d t j t j d ƒ d ƒ |  j d t j t j d ƒ d ƒ yB |  j t j t j t ƒ ƒ ƒ |  j t j t j t	 ƒ ƒ ƒ Wn3 |  j  t
 t j t ƒ |  j  t
 t j t	 ƒ n X|  j t j t j t ƒ ƒ ƒ d  S(   Ns   tan(0)i    s	   tan(pi/4)i   i   s
   tan(-pi/4)iÿÿÿÿ(   R>   R?   R   t   tanR:   R;   RD   RE   RB   RC   RA   RF   (   R7   (    (    s„   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_math.pyt   testTanD  s    #$#c         C   s  |  j  t t j ƒ |  j d t j d ƒ d ƒ |  j d t j d ƒ t j d ƒ d ƒ |  j d t j t ƒ d ƒ |  j d t j t ƒ d ƒ |  j t j t j t	 ƒ ƒ ƒ t
 j d ƒ j d	 ƒ r|  j t j d
 ƒ d
 ƒ |  j t j d t j d
 ƒ ƒ t j d d
 ƒ ƒ n  d  S(   Ns   tanh(0)i    s   tanh(1)+tanh(-1)i   iÿÿÿÿs	   tanh(inf)s
   tanh(-inf)R   R   g       €g      ð?(   R>   R?   R   t   tanhR:   RB   RC   RD   RE   RF   R!   t   __getformat__R.   RI   Rc   (   R7   (    (    s„   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_math.pyt   testTanhQ  s    )c         C   s�  |  j  t j d ƒ d ƒ |  j  t j d ƒ d ƒ |  j  t t j d ƒ ƒ t ƒ |  j  t t j d ƒ ƒ t ƒ |  j  t j d ƒ d ƒ |  j  t j d ƒ d ƒ |  j  t j d ƒ d ƒ |  j  t j d ƒ d ƒ |  j  t j d ƒ d ƒ |  j  t j d	 ƒ d
 ƒ d t f d „  ƒ  Y} d t f d „  ƒ  Y} |  j  t j | ƒ  ƒ d ƒ |  j t t j ƒ |  j t t j d d ƒ |  j t t f t j | ƒ  ƒ d  S(   Ni   iÿÿÿÿg      ø?g      ø¿gõ…�óþÿÿ?gõ…�óþÿÿ¿gé!çýÿï¿i    g-²�ï?YÀiœÿÿÿt	   TestTruncc           B   s   e  Z d  „  Z RS(   c         S   s   d S(   Ni   (    (   R7   (    (    s„   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_math.pyt	   __trunc__k  s    (   RW   RX   RÆ   (    (    (    s„   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_math.pyRÅ   j  s   t   TestNoTruncc           B   s   e  Z RS(    (   RW   RX   (    (    (    s„   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_math.pyRÇ   n  s   i   i   (	   RI   R   t   truncR^   Ro   R_   R>   R?   t   AttributeError(   R7   RÅ   RÇ   (    (    s„   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_math.pyt
   test_trunc^  s"    c         C   sˆ   |  j  t j t d ƒ ƒ ƒ |  j  t j t d ƒ d ƒ ƒ |  j t j t d ƒ ƒ ƒ |  j t j d ƒ ƒ |  j t j d ƒ ƒ d  S(   NR   R   g        g      ð?(   RD   R   RE   R!   t   assertFalse(   R7   (    (    s„   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_math.pyt	   testIsnanx  s
     c         C   s°   |  j  t j t d ƒ ƒ ƒ |  j  t j t d ƒ ƒ ƒ |  j  t j d ƒ ƒ |  j  t j d ƒ ƒ |  j t j t d ƒ ƒ ƒ |  j t j d ƒ ƒ |  j t j d ƒ ƒ d  S(   NR   s   -infg      ðg      ðÿR   g        g      ð?(   RD   R   R   R!   RË   (   R7   (    (    s„   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_math.pyt	   testIsinf  s    s   requires verbose modec         C   s²   y t  j d ƒ } Wn |  j d ƒ n X| d k rF |  j d ƒ n  y t  j d ƒ } Wn t k
 rl n X|  j d ƒ y t  j d ƒ } Wn t k
 r  n X|  j d ƒ d  S(	   Ni 6eÄs6   underflowing exp() should not have raised an exceptioni    s)   underflowing exp() should have returned 0i Êš;s.   overflowing exp() didn't trigger OverflowErrorg      ð¿s    sqrt(-1) didn't raise ValueError(   R   R+   R6   Rš   R¾   RA   (   R7   R
   (    (    s„   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_math.pyt   test_exceptions�  s     c         C   s  x
t  t ƒ D]ü \ } } } } } } } | d k s | d k s | rL q n  | d k r^ q n  t t | ƒ } y | | ƒ }	 Wni t k
 r´ d d | | | f }
 |  j |
 ƒ n5 t k
 rè d d | | | f }
 |  j |
 ƒ n X|  j d | | | f |	 | ƒ q Wd  S(	   Ng        t   rectt   polars   Unexpected ValueError in s   test %s:%s(%r)
s   Unexpected OverflowError in s	   %s:%s(%r)(   RÏ   RÐ   (   R3   t	   test_filet   getattrR   RA   R6   Rš   R:   (   R7   R'   R(   t   art   ait   ert   eiR,   t   funcRp   t   message(    (    s„   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_math.pyt   test_testfile­  s"    (R   R   s   test requires IEEE 754 doublesc         C   s>  d } d } g  } xt  t ƒ D]ô\ } } } } } t t | ƒ }	 d | k s[ d | k rd d } n d | k ry d } n  y |	 | ƒ }
 Wn- t k
 r¢ d }
 n t k
 r¸ d }
 n Xd  } t |
 t ƒ r–t | t ƒ r–t j	 | ƒ rt j	 |
 ƒ rq n  t j	 | ƒ r–t j	 |
 ƒ r–| d k rKt
 | |
 d	 d
 d d
 ƒ} n3 | d k rlt | |
 d ƒ } n t | |
 d ƒ } | d  k r“q q“q–n  t |
 t ƒ rÉt | t ƒ rÉ|
 | k rÉq qÉn  | j | | | | |
 ƒ } | d  k	 r| d j | ƒ 7} n  | j | ƒ q W| r:|  j d d j | ƒ ƒ n  d  S(   Ni   s$   {}:{}({!r}): expected {!r}, got {!r}t   invalids   divide-by-zeroRA   t   overflowRš   t   lgammaR   g›+¡†›„ö<R   t   erfciÐ  s    ({})s   Failures in test_mtestfile:
  s   
  (   R-   t   math_testcasesRÒ   R   RA   Rš   R   t
   isinstanceR!   RE   R   R   t   strR   Rœ   R6   t   join(   R7   t   ALLOWED_ERRORt   fail_fmtt   failuresR'   R(   R)   R   R,   R×   R   t   accuracy_failuret   fail_msg(    (    s„   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_math.pyt   test_mtestfileÄ  sN    "			
 		(3   RW   RX   R:   R=   RG   RJ   RL   RN   RP   RR   RT   Rb   t   requires_IEEE_754Rd   Rf   Rh   Rj   Rk   Rm   Ry   R~   R€   R†   t   unittestt   skipIft   HAVE_DOUBLE_ROUNDINGR£   R¥   R¦   R¨   R«   R­   Rµ   R·   R¹   R»   R½   R¿   RÁ   RÄ   RÊ   RÌ   RÍ   t
   skipUnlessR   RÎ   RÙ   R!   RÃ   R.   Rç   (    (    (    s„   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_math.pyR4   ƒ   sV   						
								=	"								!			Y		 					•											 c          C   sS   d d l  m }  t j ƒ  } | j t j t ƒ ƒ | j |  d ƒ ƒ t | ƒ d  S(   Niÿÿÿÿ(   t   DocFileSuites   ieee754.txt(   t   doctestRí   Ré   t	   TestSuitet   addTestt	   makeSuiteR4   R    (   Rí   t   suite(    (    s„   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_math.pyt	   test_main  s
    ((   t   test.test_supportR    R   Ré   R   t   osR•   Rs   R   R5   R!   RF   RB   RC   Rì   RÃ   R.   Rè   R
   t   yRë   RW   t   argvt   filet   __file__t   patht   dirnamet   curdirt   test_dirRá   RÞ   RÑ   R   R   R   R-   R3   t   TestCaseR4   Ró   (    (    (    s„   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_math.pyt   <module>   sB   				ÿ ÿ ÿ ƒ	