@@ -479,14 +479,22 @@ cdef class arb(flint_scalar):
479
479
if ttype == FMPZ_UNKNOWN:
480
480
return NotImplemented
481
481
res = 0
482
- if op == 2 : res = arb_eq(sval, tval)
483
- elif op == 3 : res = arb_ne(sval, tval)
484
- elif op == 0 : res = arb_lt(sval, tval)
485
- elif op == 1 : res = arb_le(sval, tval)
486
- elif op == 4 : res = arb_gt(sval, tval)
487
- elif op == 5 : res = arb_ge(sval, tval)
488
- if stype == FMPZ_TMP: arb_clear(sval)
489
- if ttype == FMPZ_TMP: arb_clear(tval)
482
+ if op == 2 :
483
+ res = arb_eq(sval, tval)
484
+ elif op == 3 :
485
+ res = arb_ne(sval, tval)
486
+ elif op == 0 :
487
+ res = arb_lt(sval, tval)
488
+ elif op == 1 :
489
+ res = arb_le(sval, tval)
490
+ elif op == 4 :
491
+ res = arb_gt(sval, tval)
492
+ elif op == 5 :
493
+ res = arb_ge(sval, tval)
494
+ if stype == FMPZ_TMP:
495
+ arb_clear(sval)
496
+ if ttype == FMPZ_TMP:
497
+ arb_clear(tval)
490
498
return res
491
499
492
500
def __contains__ (self , other ):
@@ -563,7 +571,8 @@ cdef class arb(flint_scalar):
563
571
return NotImplemented
564
572
u = arb.__new__ (arb)
565
573
arb_add((< arb> u).val, (< arb> s).val, tval, getprec())
566
- if ttype == FMPZ_TMP: arb_clear(tval)
574
+ if ttype == FMPZ_TMP:
575
+ arb_clear(tval)
567
576
return u
568
577
569
578
def __radd__ (s , t ):
@@ -574,7 +583,8 @@ cdef class arb(flint_scalar):
574
583
return NotImplemented
575
584
u = arb.__new__ (arb)
576
585
arb_add((< arb> u).val, tval, s.val, getprec())
577
- if ttype == FMPZ_TMP: arb_clear(tval)
586
+ if ttype == FMPZ_TMP:
587
+ arb_clear(tval)
578
588
return u
579
589
580
590
def __sub__ (s , t ):
@@ -585,7 +595,8 @@ cdef class arb(flint_scalar):
585
595
return NotImplemented
586
596
u = arb.__new__ (arb)
587
597
arb_sub((< arb> u).val, (< arb> s).val, tval, getprec())
588
- if ttype == FMPZ_TMP: arb_clear(tval)
598
+ if ttype == FMPZ_TMP:
599
+ arb_clear(tval)
589
600
return u
590
601
591
602
def __rsub__ (s , t ):
@@ -596,7 +607,8 @@ cdef class arb(flint_scalar):
596
607
return NotImplemented
597
608
u = arb.__new__ (arb)
598
609
arb_sub((< arb> u).val, tval, s.val, getprec())
599
- if ttype == FMPZ_TMP: arb_clear(tval)
610
+ if ttype == FMPZ_TMP:
611
+ arb_clear(tval)
600
612
return u
601
613
602
614
def __mul__ (s , t ):
@@ -607,7 +619,8 @@ cdef class arb(flint_scalar):
607
619
return NotImplemented
608
620
u = arb.__new__ (arb)
609
621
arb_mul((< arb> u).val, (< arb> s).val, tval, getprec())
610
- if ttype == FMPZ_TMP: arb_clear(tval)
622
+ if ttype == FMPZ_TMP:
623
+ arb_clear(tval)
611
624
return u
612
625
613
626
def __rmul__ (s , t ):
@@ -618,7 +631,8 @@ cdef class arb(flint_scalar):
618
631
return NotImplemented
619
632
u = arb.__new__ (arb)
620
633
arb_mul((< arb> u).val, tval, s.val, getprec())
621
- if ttype == FMPZ_TMP: arb_clear(tval)
634
+ if ttype == FMPZ_TMP:
635
+ arb_clear(tval)
622
636
return u
623
637
624
638
def __truediv__ (s , t ):
@@ -629,7 +643,8 @@ cdef class arb(flint_scalar):
629
643
return NotImplemented
630
644
u = arb.__new__ (arb)
631
645
arb_div((< arb> u).val, (< arb> s).val, tval, getprec())
632
- if ttype == FMPZ_TMP: arb_clear(tval)
646
+ if ttype == FMPZ_TMP:
647
+ arb_clear(tval)
633
648
return u
634
649
635
650
def __rtruediv__ (s , t ):
@@ -640,7 +655,8 @@ cdef class arb(flint_scalar):
640
655
return NotImplemented
641
656
u = arb.__new__ (arb)
642
657
arb_div((< arb> u).val, tval, s.val, getprec())
643
- if ttype == FMPZ_TMP: arb_clear(tval)
658
+ if ttype == FMPZ_TMP:
659
+ arb_clear(tval)
644
660
return u
645
661
646
662
def __pow__ (s , t , modulus ):
@@ -653,7 +669,8 @@ cdef class arb(flint_scalar):
653
669
return NotImplemented
654
670
u = arb.__new__ (arb)
655
671
arb_pow((< arb> u).val, (< arb> s).val, tval, getprec())
656
- if ttype == FMPZ_TMP: arb_clear(tval)
672
+ if ttype == FMPZ_TMP:
673
+ arb_clear(tval)
657
674
return u
658
675
659
676
def __rpow__ (s , t , modulus ):
@@ -666,7 +683,8 @@ cdef class arb(flint_scalar):
666
683
return NotImplemented
667
684
u = arb.__new__ (arb)
668
685
arb_pow((< arb> u).val, tval, s.val, getprec())
669
- if ttype == FMPZ_TMP: arb_clear(tval)
686
+ if ttype == FMPZ_TMP:
687
+ arb_clear(tval)
670
688
return u
671
689
672
690
def floor (s ):
@@ -2252,11 +2270,16 @@ cdef class arb(flint_scalar):
2252
2270
c = any_as_arb(c)
2253
2271
u = arb.__new__ (arb)
2254
2272
flags = 0
2255
- if regularized: flags |= 1
2256
- if ab: flags |= 2
2257
- if ac: flags |= 4
2258
- if bc: flags |= 8
2259
- if abc: flags |= 16
2273
+ if regularized:
2274
+ flags |= 1
2275
+ if ab:
2276
+ flags |= 2
2277
+ if ac:
2278
+ flags |= 4
2279
+ if bc:
2280
+ flags |= 8
2281
+ if abc:
2282
+ flags |= 16
2260
2283
arb_hypgeom_2f1((< arb> u).val, (< arb> a).val, (< arb> b).val, (< arb> c).val,
2261
2284
(< arb> self ).val, flags, getprec())
2262
2285
return u
0 commit comments