@@ -571,16 +571,6 @@ PInt comb(PInt n, PInt k) {
571
571
}
572
572
573
573
@ Specialization
574
- int comb (@ SuppressWarnings ("unused" ) double n , @ SuppressWarnings ("unused" ) Object k ) {
575
- throw raise (TypeError , ErrorMessages .OBJ_CANNOT_BE_INTERPRETED_AS_INTEGER , "float" );
576
- }
577
-
578
- @ Specialization
579
- int comb (@ SuppressWarnings ("unused" ) Object n , @ SuppressWarnings ("unused" ) double k ) {
580
- throw raise (TypeError , ErrorMessages .OBJ_CANNOT_BE_INTERPRETED_AS_INTEGER , "float" );
581
- }
582
-
583
- @ Specialization (guards = "!isNumber(n) || !isNumber(k)" )
584
574
Object comb (VirtualFrame frame , Object n , Object k ,
585
575
@ Cached ("createBinaryProfile()" ) ConditionProfile hasFrame ,
586
576
@ CachedLibrary (limit = "2" ) PythonObjectLibrary lib ,
@@ -650,23 +640,13 @@ PInt perm(PInt n, PInt k) {
650
640
return factory ().createInt (calculatePerm (n .getValue (), k .getValue ()));
651
641
}
652
642
653
- @ Specialization
654
- int perm (@ SuppressWarnings ("unused" ) double n , @ SuppressWarnings ("unused" ) Object k ) {
655
- throw raise (TypeError , ErrorMessages .OBJ_CANNOT_BE_INTERPRETED_AS_INTEGER , "float" );
656
- }
657
-
658
- @ Specialization
659
- int perm (@ SuppressWarnings ("unused" ) Object n , @ SuppressWarnings ("unused" ) double k ) {
660
- throw raise (TypeError , ErrorMessages .OBJ_CANNOT_BE_INTERPRETED_AS_INTEGER , "float" );
661
- }
662
-
663
643
@ Specialization
664
644
Object perm (VirtualFrame frame , Object n , @ SuppressWarnings ("unused" ) PNone k ,
665
645
@ Cached FactorialNode factorialNode ) {
666
646
return factorialNode .execute (frame , n );
667
647
}
668
648
669
- @ Specialization (guards = "!isNumber(n) || !isNumber (k)" )
649
+ @ Specialization (guards = "!isPNone (k)" )
670
650
Object perm (VirtualFrame frame , Object n , Object k ,
671
651
@ Cached ("createBinaryProfile()" ) ConditionProfile hasFrame ,
672
652
@ CachedLibrary (limit = "2" ) PythonObjectLibrary lib ,
0 commit comments