+
    ik                     4    ^ RI 5 ^ RI5 ^ RItR tR tR tR# )    )*Nc                     ^\         n        \        ^4      R,          R8X  g   Q h\        ^@4      R,          ^8X  g   Q h\        ^@4      R,          R8X  g   Q h\        ^4      R,          R8X  g   Q h\        ^
4      R,          P                  R4      '       g   Q h\        ^
4      R,          P                  R4      '       g   Q h\        ^
4      R,          P                  R4      '       g   Q h\        ^
4      R,          P                  R	4      '       g   Q h\        ^
4      R
,          P                  R4      '       g   Q h\        ^
4      R,          P                  R4      '       g   Q hR# )   g      @i   g      ?g      ?g      P?gR[:XL	@gXs@gIHb=?g3i?g333333?g[-?gRB3Ϲ	?Ng      g      g333333ӿ)mpdpsmpfae     w/Users/tonyclaw/.openclaw/workspace/skills/math-calculator/venv/lib/python3.14/site-packages/mpmath/tests/test_power.pytest_fractional_powr      s!   BFr7c>T!!!r7c>Qr7d?e###r7d?l***GsN12222GsN01111GtO 34444GtO 56666GsN12222GtO 34444r   c            
        \         P                  ! R4       R F  p \        ^24       F  p\         P                  ! ^V ^,
          ,          ^V ,          4      p\         P                  ! ^^d4      pW#,          p\	        \        \        V4      \        V4      V \        4      4      V8  g   Q h\	        \        \        V4      \        V4      V \        4      4      V8  d   K  Q h	  K  	  R# )zF
Test that inexact integer powers are rounded in the right
direction.
i  N)
   5      )	randomseedrangerandintto_intmpf_powfrom_int
round_downround_up)preciababs        r   test_pow_integer_directionr       s    
 KKrAq46{AtG4Aq#&AB'(1+x{D*MNQSSSS'(1+x{D(KLrQQQ  r   c                 	   R p R EF  w  rV\         n        \        ^4      \        ^4      V) ^,           ,          ,           p\        ^4      \        ^4      V) ^,           ,          ,
          pV) pV) pV\         n        \        pV ! V^V4      ^8  g   Q hV ! V^V4      ^8X  g   Q hV ! V^V4      R8  g   Q hV ! V^V4      R8X  g   Q hV ! V^V4      ^8  g   Q hV ! V^V4      ^8X  g   Q hV ! V^V4      ^8  g   Q hV ! V^V4      ^8X  g   Q hV ! VRV4      ^8X  g   Q hV ! VRV4      ^8  g   Q hV ! VRV4      R8X  g   Q hV ! VRV4      R8  g   Q hV ! VRV4      ^8X  g   Q hV ! VRV4      ^8  g   Q hV ! VRV4      ^8X  g   Q hV ! VRV4      ^8  g   Q h\        pV ! V^V4      ^8X  g   Q hV ! V^V4      ^8  g   Q hV ! V^V4      R8X  g   Q hV ! V^V4      R8  g   Q hV ! V^V4      ^8X  g   Q hV ! V^V4      ^8  g   Q hV ! V^V4      ^8X  g   Q hV ! V^V4      ^8  g   Q hV ! VRV4      ^8  g   Q hV ! VRV4      ^8X  g   Q hV ! VRV4      R8  g   Q hV ! VRV4      R8X  g   Q hV ! VRV4      ^8  g   Q hV ! VRV4      ^8X  g   Q hV ! VRV4      ^8  g   Q hV ! VRV4      ^8X  g   Q h\
        pV ! V^V4      ^8  g   Q hV ! V^V4      ^8X  g   Q hV ! V^V4      R8X  g   Q hV ! V^V4      R8  g   Q hV ! V^V4      ^8  g   Q hV ! V^V4      ^8X  g   Q hV ! V^V4      ^8  g   Q hV ! V^V4      ^8X  g   Q hV ! VRV4      ^8X  g   Q hV ! VRV4      ^8  g   Q hV ! VRV4      R8  g   Q hV ! VRV4      R8X  g   Q hV ! VRV4      ^8X  g   Q hV ! VRV4      ^8  g   Q hV ! VRV4      ^8X  g   Q hV ! VRV4      ^8  g   Q h\        pV ! V^V4      ^8X  g   Q hV ! V^V4      ^8  g   Q hV ! V^V4      R8  g   Q hV ! V^V4      R8X  g   Q hV ! V^V4      ^8X  g   Q hV ! V^V4      ^8  g   Q hV ! V^V4      ^8X  g   Q hV ! V^V4      ^8  g   Q hV ! VRV4      ^8  g   Q hV ! VRV4      ^8X  g   Q hV ! VRV4      R8X  g   Q hV ! VRV4      R8  g   Q hV ! VRV4      ^8  g   Q hV ! VRV4      ^8X  g   Q hV ! VRV4      ^8  g   Q hV ! VRV4      ^8X  d   EK  Q h	  ^\         n        R# )aQ  
Stress test directed rounding for powers with integer exponents.
Basically, we look at the following cases:

>>> 1.0001 ** -5 # doctest: +SKIP
0.99950014996500702
>>> 0.9999 ** -5 # doctest: +SKIP
1.000500150035007
>>> (-1.0001) ** -5 # doctest: +SKIP
-0.99950014996500702
>>> (-0.9999) ** -5 # doctest: +SKIP
-1.000500150035007

>>> 1.0001 ** -6 # doctest: +SKIP
0.99940020994401269
>>> 0.9999 ** -6 # doctest: +SKIP
1.0006002100560125
>>> (-1.0001) ** -6 # doctest: +SKIP
0.99940020994401269
>>> (-0.9999) ** -6 # doctest: +SKIP
1.0006002100560125

etc.

We run the tests with values a very small epsilon away from 1:
small enough that the result is indistinguishable from 1 when
rounded to nearest at the output precision. We check that the
result is not erroneously rounded to 1 in cases where the
rounding should be done strictly away from 1.
c                 `    \        \        V P                  V\        P                  V4      4      # )N)make_mpfmpf_pow_int_mpf_r   r   )xnrs   &&&r   powr'test_pow_epsilon_rounding.<locals>.powrC   s     AGGQ;<<r   N))d      )i  i  i)r   r   r   r   r   round_ceilinground_floorr   )r)   inprecoutprecpos10001pos09999neg10001neg09999r(   s           r   test_pow_epsilon_roundingr7   #   sL   @= 7q6CFfWQY//q6CFfWQY//99Ha#a'''Ha#q(((Ha#b(((Ha#r)))Ha#a'''Ha#q(((Ha#a'''Ha#q(((Hb!$)))Hb!$q(((Hb!$***Hb!$r)))Hb!$)))Hb!$q(((Hb!$)))Hb!$q(((Ha#q(((Ha#a'''Ha#r)))Ha#b(((Ha#q(((Ha#a'''Ha#q(((Ha#a'''Hb!$q(((Hb!$)))Hb!$r)))Hb!$***Hb!$q(((Hb!$)))Hb!$q(((Hb!$)))Ha#a'''Ha#q(((Ha#r)))Ha#b(((Ha#a'''Ha#q(((Ha#a'''Ha#q(((Hb!$)))Hb!$q(((Hb!$r)))Hb!$***Hb!$)))Hb!$q(((Hb!$)))Hb!$q(((Ha#q(((Ha#a'''Ha#b(((Ha#r)))Ha#q(((Ha#a'''Ha#q(((Ha#a'''Hb!$q(((Hb!$)))Hb!$***Hb!$r)))Hb!$q(((Hb!$)))Hb!$q(((Hb!$)))i 7l BFr   )mpmathmpmath.libmpr   r   r    r7   r
   r   r   <module>r:      s      5R yr   