Skip to content

Commit 6b29a73

Browse files
committed
changed mod -> %
1 parent 515b715 commit 6b29a73

File tree

4 files changed

+5
-10
lines changed

4 files changed

+5
-10
lines changed

ext/symengine/ruby_function.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@
77
#include "symengine.h"
88
#include "symengine_utils.h"
99

10-
VALUE cfunction_func(void (*cwfunc_ptr)(basic_struct*, const basic_struct*), VALUE operand1);
11-
1210
VALUE cfunction_abs(VALUE self, VALUE operand1);
1311
VALUE cfunction_sin(VALUE self, VALUE operand1);
1412
VALUE cfunction_cos(VALUE self, VALUE operand1);

ext/symengine/ruby_ntheory.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,6 @@
88
#include "ruby_basic.h"
99
#include "symengine_utils.h"
1010

11-
VALUE cntheory_onearg(void (*cwfunc_ptr)(basic_struct*, const basic_struct*), VALUE operand1);
12-
VALUE cntheory_twoarg(void (*cwfunc_ptr)(basic_struct*, const basic_struct*, const basic_struct*), VALUE operand1, VALUE operand2);
13-
1411
VALUE cntheory_gcd(VALUE self, VALUE operand1, VALUE operand2);
1512
VALUE cntheory_lcm(VALUE self, VALUE operand1, VALUE operand2);
1613
VALUE cntheory_nextprime(VALUE self, VALUE operand1);

ext/symengine/symengine.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ void Init_symengine() {
150150
rb_define_module_function(m_symengine, "gcd", cntheory_gcd, 2);
151151
rb_define_module_function(m_symengine, "lcm", cntheory_lcm, 2);
152152
rb_define_module_function(m_symengine, "nextprime", cntheory_nextprime, 1);
153-
rb_define_module_function(m_symengine, "mod", cntheory_mod, 2);
153+
rb_define_module_function(m_symengine, "%", cntheory_mod, 2);
154154
rb_define_module_function(m_symengine, "quotient", cntheory_quotient, 2);
155155
rb_define_module_function(m_symengine, "fibonacci", cntheory_fibonacci, 1);
156156
rb_define_module_function(m_symengine, "lucas", cntheory_lucas, 1);

spec/ntheory_spec.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,25 +36,25 @@
3636
describe '#mod' do
3737
context '5 mod 4' do
3838
it 'returns 1' do
39-
f = SymEngine::mod(5, 4)
39+
f = 5 % 4
4040
expect(f).to eql(1)
4141
end
4242
end
4343
context '-5 mod -4' do
4444
it 'returns -1' do
45-
f = SymEngine::mod(-5, -4)
45+
f = -5 % -4
4646
expect(f).to eql(-1)
4747
end
4848
end
4949
context '5 mod -4' do
5050
it 'returns -3' do
51-
f = SymEngine::mod(5, -4)
51+
f = 5 % -4
5252
expect(f).to eql(-3)
5353
end
5454
end
5555
context '-5 mod 4' do
5656
it 'returns 3' do
57-
f = SymEngine::mod(-5, 4)
57+
f = -5 % 4
5858
expect(f).to eql(3)
5959
end
6060
end

0 commit comments

Comments
 (0)