Skip to content

Commit 166dd25

Browse files
committed
to_f working, not optimal
1 parent fa54c24 commit 166dd25

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

ext/symengine/ruby_real_mpfr.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,14 @@ VALUE crealmpfr_init(VALUE self, VALUE num_value, VALUE prec_value)
3535

3636
VALUE crealmpfr_to_float(VALUE self)
3737
{
38-
VALUE result;
39-
basic cbasic_operand1;
40-
basic_new_stack(cbasic_operand1);
41-
sympify(self, cbasic_operand1);
42-
43-
result = rb_float_new(real_mpfr_get_d(cbasic_operand1));
38+
// TODO: Make the following method work
39+
//VALUE result;
40+
//basic cbasic_operand1;
41+
//basic_new_stack(cbasic_operand1);
42+
//sympify(self, cbasic_operand1);
43+
//result = rb_float_new(real_mpfr_get_d(cbasic_operand1));
4444

45-
basic_free_stack(cbasic_operand1);
46-
return result;
45+
return rb_funcall(( rb_funcall( self, rb_intern("to_s"), 1, rb_str_new2("F")) ),
46+
rb_intern("to_f"), 0, NULL);
4747
}
4848

0 commit comments

Comments
 (0)