Skip to content

Commit 3b8d53b

Browse files
committed
Changed T_DATA Class comparison
1 parent 5ca9523 commit 3b8d53b

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

ext/symengine/symengine_utils.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ void sympify(VALUE operand2, basic_struct *cbasic_operand2) {
88
VALUE a, b;
99
double f;
1010
char *c;
11+
VALUE rb_cBigDecimal;
1112

1213
switch(TYPE(operand2)) {
1314
case T_FIXNUM:
@@ -61,7 +62,8 @@ void sympify(VALUE operand2, basic_struct *cbasic_operand2) {
6162

6263
case T_DATA:
6364
c = rb_obj_classname(operand2);
64-
if(strcmp(c, "BigDecimal") == 0){
65+
rb_cBigDecimal = CLASS_OF(rb_eval_string("BigDecimal.new('0.0001')")) ;
66+
if(CLASS_OF(operand2) == rb_cBigDecimal){
6567
c = RSTRING_PTR( rb_funcall(operand2, rb_intern("to_s"), 1, rb_str_new2("F")) );
6668
real_mpfr_set_str(cbasic_operand2, c, 200);
6769
break;

0 commit comments

Comments
 (0)