@@ -56,3 +56,50 @@ VALUE cntheory_mod(VALUE self, VALUE operand1, VALUE operand2) {
5656VALUE cntheory_quotient (VALUE self , VALUE operand1 , VALUE operand2 ) {
5757 return cntheory_twoarg (ntheory_quotient , operand1 , operand2 );
5858}
59+
60+ VALUE cntheory_fibonacci (VALUE self , VALUE operand1 ){
61+ basic_struct * cresult ;
62+ VALUE result ;
63+
64+ unsigned long cbasic_operand1 ;
65+ cbasic_operand1 = NUM2ULONG (operand1 );
66+
67+ cresult = basic_new_heap ();
68+ ntheory_fibonacci (cresult , cbasic_operand1 );
69+ result = Data_Wrap_Struct (Klass_of_Basic (cresult ), NULL , cbasic_free_heap , cresult );
70+
71+ return result ;
72+ }
73+
74+ VALUE cntheory_lucas (VALUE self , VALUE operand1 ){
75+ basic_struct * cresult ;
76+ VALUE result ;
77+
78+ unsigned long cbasic_operand1 ;
79+ cbasic_operand1 = NUM2ULONG (operand1 );
80+
81+ cresult = basic_new_heap ();
82+ ntheory_lucas (cresult , cbasic_operand1 );
83+ result = Data_Wrap_Struct (Klass_of_Basic (cresult ), NULL , cbasic_free_heap , cresult );
84+
85+ return result ;
86+ }
87+
88+ VALUE cntheory_binomial (VALUE self , VALUE operand1 , VALUE operand2 ){
89+ basic_struct * cresult ;
90+ VALUE result ;
91+
92+ basic cbasic_operand1 ;
93+ basic_new_stack (cbasic_operand1 );
94+ sympify (operand1 , cbasic_operand1 );
95+
96+ unsigned long cbasic_operand2 ;
97+ cbasic_operand2 = NUM2ULONG (operand2 );
98+
99+ cresult = basic_new_heap ();
100+ ntheory_binomial (cresult , cbasic_operand1 , cbasic_operand2 );
101+ result = Data_Wrap_Struct (Klass_of_Basic (cresult ), NULL , cbasic_free_heap , cresult );
102+ basic_free_stack (cbasic_operand1 );
103+
104+ return result ;
105+ }
0 commit comments