Skip to content

Commit 7ddd68e

Browse files
committed
Changed I from Constant to Complex
1 parent e9162e0 commit 7ddd68e

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

ext/symengine/ruby_constant.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,12 @@ VALUE cconstant_euler_gamma() {
2424
}
2525

2626
VALUE cconstant_i() {
27-
return cconstant_const(basic_const_I);
27+
basic_struct *cresult;
28+
VALUE result;
29+
30+
cresult = basic_new_heap();
31+
basic_const_I(cresult);
32+
33+
result = Data_Wrap_Struct(c_complex, NULL, cbasic_free_heap, cresult);
34+
return result;
2835
}

spec/constant_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
describe '#i' do
4747
subject(:i) { SymEngine::I }
4848

49-
it { is_expected.to be_a SymEngine::Constant }
49+
it { is_expected.to be_a SymEngine::Complex }
5050

5151
context 'when squared' do
5252
subject { i * i}

0 commit comments

Comments
 (0)